diff --git a/.gitignore b/.gitignore index 17302c9..680e735 100644 --- a/.gitignore +++ b/.gitignore @@ -184,3 +184,5 @@ $RECYCLE.BIN/ # Visual Studio 2014 CTP **/*.sln.ide + +.idea/* diff --git a/src/sib_api_v3_sdk/Api/AccountApi.cs b/src/sib_api_v3_sdk/Api/AccountApi.cs deleted file mode 100644 index 3493243..0000000 --- a/src/sib_api_v3_sdk/Api/AccountApi.cs +++ /dev/null @@ -1,311 +0,0 @@ -/* - * SendinBlue API - * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :- -- -- -- -- -- --: | - -- -- -- -- -- -- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | - * - * OpenAPI spec version: 3.0.0 - * Contact: contact@sendinblue.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using RestSharp.Portable; -using sib_api_v3_sdk.Client; -using sib_api_v3_sdk.Model; - -namespace sib_api_v3_sdk.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IAccountApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Get your account information, plan and credits details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// GetAccount - GetAccount GetAccount (); - - /// - /// Get your account information, plan and credits details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ApiResponse of GetAccount - ApiResponse GetAccountWithHttpInfo (); - #endregion Synchronous Operations - #region Asynchronous Operations - /// - /// Get your account information, plan and credits details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Task of GetAccount - System.Threading.Tasks.Task GetAccountAsync (); - - /// - /// Get your account information, plan and credits details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Task of ApiResponse (GetAccount) - System.Threading.Tasks.Task> GetAccountAsyncWithHttpInfo (); - #endregion Asynchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public partial class AccountApi : IAccountApi - { - private sib_api_v3_sdk.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// - /// - public AccountApi(String basePath) - { - this.Configuration = new sib_api_v3_sdk.Client.Configuration { BasePath = basePath }; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using Configuration object - /// - /// An instance of Configuration - /// - public AccountApi(sib_api_v3_sdk.Client.Configuration configuration = null) - { - if (configuration == null) // use the default one in Configuration - this.Configuration = sib_api_v3_sdk.Client.Configuration.Default; - else - this.Configuration = configuration; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] - public void SetBasePath(String basePath) - { - // do nothing - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public sib_api_v3_sdk.Client.Configuration Configuration {get; set;} - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public sib_api_v3_sdk.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - /// - /// Gets the default header. - /// - /// Dictionary of HTTP header - [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] - public IDictionary DefaultHeader() - { - return new ReadOnlyDictionary(this.Configuration.DefaultHeader); - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] - public void AddDefaultHeader(string key, string value) - { - this.Configuration.AddDefaultHeader(key, value); - } - - /// - /// Get your account information, plan and credits details - /// - /// Thrown when fails to make API call - /// GetAccount - public GetAccount GetAccount () - { - ApiResponse localVarResponse = GetAccountWithHttpInfo(); - return localVarResponse.Data; - } - - /// - /// Get your account information, plan and credits details - /// - /// Thrown when fails to make API call - /// ApiResponse of GetAccount - public ApiResponse< GetAccount > GetAccountWithHttpInfo () - { - - var localVarPath = "./account"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetAccount", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetAccount) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetAccount))); - } - - /// - /// Get your account information, plan and credits details - /// - /// Thrown when fails to make API call - /// Task of GetAccount - public async System.Threading.Tasks.Task GetAccountAsync () - { - ApiResponse localVarResponse = await GetAccountAsyncWithHttpInfo(); - return localVarResponse.Data; - - } - - /// - /// Get your account information, plan and credits details - /// - /// Thrown when fails to make API call - /// Task of ApiResponse (GetAccount) - public async System.Threading.Tasks.Task> GetAccountAsyncWithHttpInfo () - { - - var localVarPath = "./account"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetAccount", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetAccount) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetAccount))); - } - - } -} diff --git a/src/sib_api_v3_sdk/Api/CompaniesApi.cs b/src/sib_api_v3_sdk/Api/CompaniesApi.cs deleted file mode 100644 index 751fe7b..0000000 --- a/src/sib_api_v3_sdk/Api/CompaniesApi.cs +++ /dev/null @@ -1,1617 +0,0 @@ -/* - * SendinBlue API - * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :- -- -- -- -- -- --: | - -- -- -- -- -- -- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | - * - * OpenAPI spec version: 3.0.0 - * Contact: contact@sendinblue.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using RestSharp.Portable; -using sib_api_v3_sdk.Client; -using sib_api_v3_sdk.Model; - -namespace sib_api_v3_sdk.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface ICompaniesApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Get company attributes - /// - /// - /// - /// - /// Thrown when fails to make API call - /// CompanyAttributes - CompanyAttributes CompaniesAttributesGet (); - - /// - /// Get company attributes - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ApiResponse of CompanyAttributes - ApiResponse CompaniesAttributesGetWithHttpInfo (); - /// - /// Get all companies - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter by attrbutes. If you have filter for owner on your side please send it as {"attributes.owner":"5b1a17d914b73d35a76ca0c7"} (optional) - /// Filter by linked contacts ids (optional) - /// Filter by linked deals ids (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// The field used to sort field names. (optional) - /// CompaniesList - CompaniesList CompaniesGet (string filters = null, long? linkedContactsIds = null, string linkedDealsIds = null, long? page = null, long? limit = null, string sort = null, string sortBy = null); - - /// - /// Get all companies - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter by attrbutes. If you have filter for owner on your side please send it as {"attributes.owner":"5b1a17d914b73d35a76ca0c7"} (optional) - /// Filter by linked contacts ids (optional) - /// Filter by linked deals ids (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// The field used to sort field names. (optional) - /// ApiResponse of CompaniesList - ApiResponse CompaniesGetWithHttpInfo (string filters = null, long? linkedContactsIds = null, string linkedDealsIds = null, long? page = null, long? limit = null, string sort = null, string sortBy = null); - /// - /// Delete a company - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - void CompaniesIdDelete (string id); - - /// - /// Delete a company - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object(void) - ApiResponse CompaniesIdDeleteWithHttpInfo (string id); - /// - /// Get a company - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Company - Company CompaniesIdGet (string id); - - /// - /// Get a company - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Company - ApiResponse CompaniesIdGetWithHttpInfo (string id); - /// - /// Update a company - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Updated company details. - /// Company - Company CompaniesIdPatch (string id, Body1 body); - - /// - /// Update a company - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Updated company details. - /// ApiResponse of Company - ApiResponse CompaniesIdPatchWithHttpInfo (string id, Body1 body); - /// - /// Link and Unlink company with contacts and deals - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Linked / Unlinked contacts and deals ids. - /// - void CompaniesLinkUnlinkIdPatch (string id, Body2 body); - - /// - /// Link and Unlink company with contacts and deals - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Linked / Unlinked contacts and deals ids. - /// ApiResponse of Object(void) - ApiResponse CompaniesLinkUnlinkIdPatchWithHttpInfo (string id, Body2 body); - /// - /// Create a company - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Company create data. - /// InlineResponse200 - InlineResponse200 CompaniesPost (Body body); - - /// - /// Create a company - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Company create data. - /// ApiResponse of InlineResponse200 - ApiResponse CompaniesPostWithHttpInfo (Body body); - #endregion Synchronous Operations - #region Asynchronous Operations - /// - /// Get company attributes - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Task of CompanyAttributes - System.Threading.Tasks.Task CompaniesAttributesGetAsync (); - - /// - /// Get company attributes - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Task of ApiResponse (CompanyAttributes) - System.Threading.Tasks.Task> CompaniesAttributesGetAsyncWithHttpInfo (); - /// - /// Get all companies - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter by attrbutes. If you have filter for owner on your side please send it as {"attributes.owner":"5b1a17d914b73d35a76ca0c7"} (optional) - /// Filter by linked contacts ids (optional) - /// Filter by linked deals ids (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// The field used to sort field names. (optional) - /// Task of CompaniesList - System.Threading.Tasks.Task CompaniesGetAsync (string filters = null, long? linkedContactsIds = null, string linkedDealsIds = null, long? page = null, long? limit = null, string sort = null, string sortBy = null); - - /// - /// Get all companies - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter by attrbutes. If you have filter for owner on your side please send it as {"attributes.owner":"5b1a17d914b73d35a76ca0c7"} (optional) - /// Filter by linked contacts ids (optional) - /// Filter by linked deals ids (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// The field used to sort field names. (optional) - /// Task of ApiResponse (CompaniesList) - System.Threading.Tasks.Task> CompaniesGetAsyncWithHttpInfo (string filters = null, long? linkedContactsIds = null, string linkedDealsIds = null, long? page = null, long? limit = null, string sort = null, string sortBy = null); - /// - /// Delete a company - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Task of void - System.Threading.Tasks.Task CompaniesIdDeleteAsync (string id); - - /// - /// Delete a company - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Task of ApiResponse - System.Threading.Tasks.Task> CompaniesIdDeleteAsyncWithHttpInfo (string id); - /// - /// Get a company - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Task of Company - System.Threading.Tasks.Task CompaniesIdGetAsync (string id); - - /// - /// Get a company - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Task of ApiResponse (Company) - System.Threading.Tasks.Task> CompaniesIdGetAsyncWithHttpInfo (string id); - /// - /// Update a company - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Updated company details. - /// Task of Company - System.Threading.Tasks.Task CompaniesIdPatchAsync (string id, Body1 body); - - /// - /// Update a company - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Updated company details. - /// Task of ApiResponse (Company) - System.Threading.Tasks.Task> CompaniesIdPatchAsyncWithHttpInfo (string id, Body1 body); - /// - /// Link and Unlink company with contacts and deals - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Linked / Unlinked contacts and deals ids. - /// Task of void - System.Threading.Tasks.Task CompaniesLinkUnlinkIdPatchAsync (string id, Body2 body); - - /// - /// Link and Unlink company with contacts and deals - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Linked / Unlinked contacts and deals ids. - /// Task of ApiResponse - System.Threading.Tasks.Task> CompaniesLinkUnlinkIdPatchAsyncWithHttpInfo (string id, Body2 body); - /// - /// Create a company - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Company create data. - /// Task of InlineResponse200 - System.Threading.Tasks.Task CompaniesPostAsync (Body body); - - /// - /// Create a company - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Company create data. - /// Task of ApiResponse (InlineResponse200) - System.Threading.Tasks.Task> CompaniesPostAsyncWithHttpInfo (Body body); - #endregion Asynchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public partial class CompaniesApi : ICompaniesApi - { - private sib_api_v3_sdk.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// - /// - public CompaniesApi(String basePath) - { - this.Configuration = new sib_api_v3_sdk.Client.Configuration { BasePath = basePath }; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using Configuration object - /// - /// An instance of Configuration - /// - public CompaniesApi(sib_api_v3_sdk.Client.Configuration configuration = null) - { - if (configuration == null) // use the default one in Configuration - this.Configuration = sib_api_v3_sdk.Client.Configuration.Default; - else - this.Configuration = configuration; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] - public void SetBasePath(String basePath) - { - // do nothing - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public sib_api_v3_sdk.Client.Configuration Configuration {get; set;} - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public sib_api_v3_sdk.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - /// - /// Gets the default header. - /// - /// Dictionary of HTTP header - [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] - public IDictionary DefaultHeader() - { - return new ReadOnlyDictionary(this.Configuration.DefaultHeader); - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] - public void AddDefaultHeader(string key, string value) - { - this.Configuration.AddDefaultHeader(key, value); - } - - /// - /// Get company attributes - /// - /// Thrown when fails to make API call - /// CompanyAttributes - public CompanyAttributes CompaniesAttributesGet () - { - ApiResponse localVarResponse = CompaniesAttributesGetWithHttpInfo(); - return localVarResponse.Data; - } - - /// - /// Get company attributes - /// - /// Thrown when fails to make API call - /// ApiResponse of CompanyAttributes - public ApiResponse< CompanyAttributes > CompaniesAttributesGetWithHttpInfo () - { - - var localVarPath = "./companies/attributes"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CompaniesAttributesGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CompanyAttributes) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CompanyAttributes))); - } - - /// - /// Get company attributes - /// - /// Thrown when fails to make API call - /// Task of CompanyAttributes - public async System.Threading.Tasks.Task CompaniesAttributesGetAsync () - { - ApiResponse localVarResponse = await CompaniesAttributesGetAsyncWithHttpInfo(); - return localVarResponse.Data; - - } - - /// - /// Get company attributes - /// - /// Thrown when fails to make API call - /// Task of ApiResponse (CompanyAttributes) - public async System.Threading.Tasks.Task> CompaniesAttributesGetAsyncWithHttpInfo () - { - - var localVarPath = "./companies/attributes"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CompaniesAttributesGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CompanyAttributes) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CompanyAttributes))); - } - - /// - /// Get all companies - /// - /// Thrown when fails to make API call - /// Filter by attrbutes. If you have filter for owner on your side please send it as {"attributes.owner":"5b1a17d914b73d35a76ca0c7"} (optional) - /// Filter by linked contacts ids (optional) - /// Filter by linked deals ids (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// The field used to sort field names. (optional) - /// CompaniesList - public CompaniesList CompaniesGet (string filters = null, long? linkedContactsIds = null, string linkedDealsIds = null, long? page = null, long? limit = null, string sort = null, string sortBy = null) - { - ApiResponse localVarResponse = CompaniesGetWithHttpInfo(filters, linkedContactsIds, linkedDealsIds, page, limit, sort, sortBy); - return localVarResponse.Data; - } - - /// - /// Get all companies - /// - /// Thrown when fails to make API call - /// Filter by attrbutes. If you have filter for owner on your side please send it as {"attributes.owner":"5b1a17d914b73d35a76ca0c7"} (optional) - /// Filter by linked contacts ids (optional) - /// Filter by linked deals ids (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// The field used to sort field names. (optional) - /// ApiResponse of CompaniesList - public ApiResponse< CompaniesList > CompaniesGetWithHttpInfo (string filters = null, long? linkedContactsIds = null, string linkedDealsIds = null, long? page = null, long? limit = null, string sort = null, string sortBy = null) - { - - var localVarPath = "./companies"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (filters != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "filters", filters)); // query parameter - if (linkedContactsIds != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "linkedContactsIds", linkedContactsIds)); // query parameter - if (linkedDealsIds != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "linkedDealsIds", linkedDealsIds)); // query parameter - if (page != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "page", page)); // query parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - if (sortBy != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sortBy", sortBy)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CompaniesGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CompaniesList) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CompaniesList))); - } - - /// - /// Get all companies - /// - /// Thrown when fails to make API call - /// Filter by attrbutes. If you have filter for owner on your side please send it as {"attributes.owner":"5b1a17d914b73d35a76ca0c7"} (optional) - /// Filter by linked contacts ids (optional) - /// Filter by linked deals ids (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// The field used to sort field names. (optional) - /// Task of CompaniesList - public async System.Threading.Tasks.Task CompaniesGetAsync (string filters = null, long? linkedContactsIds = null, string linkedDealsIds = null, long? page = null, long? limit = null, string sort = null, string sortBy = null) - { - ApiResponse localVarResponse = await CompaniesGetAsyncWithHttpInfo(filters, linkedContactsIds, linkedDealsIds, page, limit, sort, sortBy); - return localVarResponse.Data; - - } - - /// - /// Get all companies - /// - /// Thrown when fails to make API call - /// Filter by attrbutes. If you have filter for owner on your side please send it as {"attributes.owner":"5b1a17d914b73d35a76ca0c7"} (optional) - /// Filter by linked contacts ids (optional) - /// Filter by linked deals ids (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// The field used to sort field names. (optional) - /// Task of ApiResponse (CompaniesList) - public async System.Threading.Tasks.Task> CompaniesGetAsyncWithHttpInfo (string filters = null, long? linkedContactsIds = null, string linkedDealsIds = null, long? page = null, long? limit = null, string sort = null, string sortBy = null) - { - - var localVarPath = "./companies"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (filters != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "filters", filters)); // query parameter - if (linkedContactsIds != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "linkedContactsIds", linkedContactsIds)); // query parameter - if (linkedDealsIds != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "linkedDealsIds", linkedDealsIds)); // query parameter - if (page != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "page", page)); // query parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - if (sortBy != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sortBy", sortBy)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CompaniesGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CompaniesList) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CompaniesList))); - } - - /// - /// Delete a company - /// - /// Thrown when fails to make API call - /// - /// - public void CompaniesIdDelete (string id) - { - CompaniesIdDeleteWithHttpInfo(id); - } - - /// - /// Delete a company - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object(void) - public ApiResponse CompaniesIdDeleteWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling CompaniesApi->CompaniesIdDelete"); - - var localVarPath = "./companies/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CompaniesIdDelete", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete a company - /// - /// Thrown when fails to make API call - /// - /// Task of void - public async System.Threading.Tasks.Task CompaniesIdDeleteAsync (string id) - { - await CompaniesIdDeleteAsyncWithHttpInfo(id); - - } - - /// - /// Delete a company - /// - /// Thrown when fails to make API call - /// - /// Task of ApiResponse - public async System.Threading.Tasks.Task> CompaniesIdDeleteAsyncWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling CompaniesApi->CompaniesIdDelete"); - - var localVarPath = "./companies/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CompaniesIdDelete", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Get a company - /// - /// Thrown when fails to make API call - /// - /// Company - public Company CompaniesIdGet (string id) - { - ApiResponse localVarResponse = CompaniesIdGetWithHttpInfo(id); - return localVarResponse.Data; - } - - /// - /// Get a company - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Company - public ApiResponse< Company > CompaniesIdGetWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling CompaniesApi->CompaniesIdGet"); - - var localVarPath = "./companies/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CompaniesIdGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (Company) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Company))); - } - - /// - /// Get a company - /// - /// Thrown when fails to make API call - /// - /// Task of Company - public async System.Threading.Tasks.Task CompaniesIdGetAsync (string id) - { - ApiResponse localVarResponse = await CompaniesIdGetAsyncWithHttpInfo(id); - return localVarResponse.Data; - - } - - /// - /// Get a company - /// - /// Thrown when fails to make API call - /// - /// Task of ApiResponse (Company) - public async System.Threading.Tasks.Task> CompaniesIdGetAsyncWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling CompaniesApi->CompaniesIdGet"); - - var localVarPath = "./companies/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CompaniesIdGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (Company) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Company))); - } - - /// - /// Update a company - /// - /// Thrown when fails to make API call - /// - /// Updated company details. - /// Company - public Company CompaniesIdPatch (string id, Body1 body) - { - ApiResponse localVarResponse = CompaniesIdPatchWithHttpInfo(id, body); - return localVarResponse.Data; - } - - /// - /// Update a company - /// - /// Thrown when fails to make API call - /// - /// Updated company details. - /// ApiResponse of Company - public ApiResponse< Company > CompaniesIdPatchWithHttpInfo (string id, Body1 body) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling CompaniesApi->CompaniesIdPatch"); - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling CompaniesApi->CompaniesIdPatch"); - - var localVarPath = "./companies/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CompaniesIdPatch", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (Company) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Company))); - } - - /// - /// Update a company - /// - /// Thrown when fails to make API call - /// - /// Updated company details. - /// Task of Company - public async System.Threading.Tasks.Task CompaniesIdPatchAsync (string id, Body1 body) - { - ApiResponse localVarResponse = await CompaniesIdPatchAsyncWithHttpInfo(id, body); - return localVarResponse.Data; - - } - - /// - /// Update a company - /// - /// Thrown when fails to make API call - /// - /// Updated company details. - /// Task of ApiResponse (Company) - public async System.Threading.Tasks.Task> CompaniesIdPatchAsyncWithHttpInfo (string id, Body1 body) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling CompaniesApi->CompaniesIdPatch"); - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling CompaniesApi->CompaniesIdPatch"); - - var localVarPath = "./companies/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CompaniesIdPatch", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (Company) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Company))); - } - - /// - /// Link and Unlink company with contacts and deals - /// - /// Thrown when fails to make API call - /// - /// Linked / Unlinked contacts and deals ids. - /// - public void CompaniesLinkUnlinkIdPatch (string id, Body2 body) - { - CompaniesLinkUnlinkIdPatchWithHttpInfo(id, body); - } - - /// - /// Link and Unlink company with contacts and deals - /// - /// Thrown when fails to make API call - /// - /// Linked / Unlinked contacts and deals ids. - /// ApiResponse of Object(void) - public ApiResponse CompaniesLinkUnlinkIdPatchWithHttpInfo (string id, Body2 body) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling CompaniesApi->CompaniesLinkUnlinkIdPatch"); - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling CompaniesApi->CompaniesLinkUnlinkIdPatch"); - - var localVarPath = "./companies/link-unlink/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CompaniesLinkUnlinkIdPatch", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Link and Unlink company with contacts and deals - /// - /// Thrown when fails to make API call - /// - /// Linked / Unlinked contacts and deals ids. - /// Task of void - public async System.Threading.Tasks.Task CompaniesLinkUnlinkIdPatchAsync (string id, Body2 body) - { - await CompaniesLinkUnlinkIdPatchAsyncWithHttpInfo(id, body); - - } - - /// - /// Link and Unlink company with contacts and deals - /// - /// Thrown when fails to make API call - /// - /// Linked / Unlinked contacts and deals ids. - /// Task of ApiResponse - public async System.Threading.Tasks.Task> CompaniesLinkUnlinkIdPatchAsyncWithHttpInfo (string id, Body2 body) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling CompaniesApi->CompaniesLinkUnlinkIdPatch"); - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling CompaniesApi->CompaniesLinkUnlinkIdPatch"); - - var localVarPath = "./companies/link-unlink/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CompaniesLinkUnlinkIdPatch", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Create a company - /// - /// Thrown when fails to make API call - /// Company create data. - /// InlineResponse200 - public InlineResponse200 CompaniesPost (Body body) - { - ApiResponse localVarResponse = CompaniesPostWithHttpInfo(body); - return localVarResponse.Data; - } - - /// - /// Create a company - /// - /// Thrown when fails to make API call - /// Company create data. - /// ApiResponse of InlineResponse200 - public ApiResponse< InlineResponse200 > CompaniesPostWithHttpInfo (Body body) - { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling CompaniesApi->CompaniesPost"); - - var localVarPath = "./companies"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CompaniesPost", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (InlineResponse200) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse200))); - } - - /// - /// Create a company - /// - /// Thrown when fails to make API call - /// Company create data. - /// Task of InlineResponse200 - public async System.Threading.Tasks.Task CompaniesPostAsync (Body body) - { - ApiResponse localVarResponse = await CompaniesPostAsyncWithHttpInfo(body); - return localVarResponse.Data; - - } - - /// - /// Create a company - /// - /// Thrown when fails to make API call - /// Company create data. - /// Task of ApiResponse (InlineResponse200) - public async System.Threading.Tasks.Task> CompaniesPostAsyncWithHttpInfo (Body body) - { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling CompaniesApi->CompaniesPost"); - - var localVarPath = "./companies"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CompaniesPost", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (InlineResponse200) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse200))); - } - - } -} diff --git a/src/sib_api_v3_sdk/Api/ContactsApi.cs b/src/sib_api_v3_sdk/Api/ContactsApi.cs index f69268f..0dd82bc 100644 --- a/src/sib_api_v3_sdk/Api/ContactsApi.cs +++ b/src/sib_api_v3_sdk/Api/ContactsApi.cs @@ -1,6138 +1,340 @@ -/* - * SendinBlue API - * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :- -- -- -- -- -- --: | - -- -- -- -- -- -- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | - * - * OpenAPI spec version: 3.0.0 - * Contact: contact@sendinblue.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; -using RestSharp.Portable; -using sib_api_v3_sdk.Client; using sib_api_v3_sdk.Model; namespace sib_api_v3_sdk.Api { + using sib_api_v3_sdk.Client; + /// /// Represents a collection of functions to interact with the API endpoints /// public interface IContactsApi : IApiAccessor { - #region Synchronous Operations /// - /// Add existing contacts to a list + /// Get a contact's details /// /// - /// + /// Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats (https://developers.sendinblue.com/reference/contacts-7#getcontactstats) endpoint with the appropriate date ranges. /// /// Thrown when fails to make API call - /// Id of the list - /// Emails addresses OR IDs of the contacts - /// PostContactInfo - PostContactInfo AddContactToList (long? listId, AddContactToList contactEmails); + /// Email (urlencoded) OR ID of the contact OR its SMS attribute value + /// Task of GetExtendedContactDetails + System.Threading.Tasks.Task GetContactInfoAsync (string identifier); /// /// Add existing contacts to a list /// /// - /// + /// /// /// Thrown when fails to make API call /// Id of the list /// Emails addresses OR IDs of the contacts - /// ApiResponse of PostContactInfo - ApiResponse AddContactToListWithHttpInfo (long? listId, AddContactToList contactEmails); - /// - /// Create contact attribute - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Category of the attribute - /// Name of the attribute - /// Values to create an attribute - /// - void CreateAttribute (string attributeCategory, string attributeName, CreateAttribute createAttribute); + /// Task of PostContactInfo + System.Threading.Tasks.Task AddContactToListAsync (long? listId, AddContactToList contactEmails); /// - /// Create contact attribute - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Category of the attribute - /// Name of the attribute - /// Values to create an attribute - /// ApiResponse of Object(void) - ApiResponse CreateAttributeWithHttpInfo (string attributeCategory, string attributeName, CreateAttribute createAttribute); - /// - /// Create a contact + /// Update a contact /// /// - /// + /// /// /// Thrown when fails to make API call - /// Values to create a contact - /// CreateUpdateContactModel - CreateUpdateContactModel CreateContact (CreateContact createContact); + /// Email (urlencoded) OR ID of the contact + /// Values to update a contact + /// Task of void + System.Threading.Tasks.Task UpdateContactAsync (string identifier, UpdateContact updateContact); /// /// Create a contact /// /// - /// - /// - /// Thrown when fails to make API call - /// Values to create a contact - /// ApiResponse of CreateUpdateContactModel - ApiResponse CreateContactWithHttpInfo (CreateContact createContact); - /// - /// Create Contact via DOI (Double-Opt-In) Flow - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create the Double opt-in (DOI) contact - /// - void CreateDoiContact (CreateDoiContact createDoiContact); - - /// - /// Create Contact via DOI (Double-Opt-In) Flow - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create the Double opt-in (DOI) contact - /// ApiResponse of Object(void) - ApiResponse CreateDoiContactWithHttpInfo (CreateDoiContact createDoiContact); - /// - /// Create a folder - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Name of the folder - /// CreateModel - CreateModel CreateFolder (CreateUpdateFolder createFolder); - - /// - /// Create a folder - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Name of the folder - /// ApiResponse of CreateModel - ApiResponse CreateFolderWithHttpInfo (CreateUpdateFolder createFolder); - /// - /// Create a list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create a list - /// CreateModel - CreateModel CreateList (CreateList createList); - - /// - /// Create a list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create a list - /// ApiResponse of CreateModel - ApiResponse CreateListWithHttpInfo (CreateList createList); - /// - /// Delete an attribute - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Category of the attribute - /// Name of the existing attribute - /// - void DeleteAttribute (string attributeCategory, string attributeName); - - /// - /// Delete an attribute - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Category of the attribute - /// Name of the existing attribute - /// ApiResponse of Object(void) - ApiResponse DeleteAttributeWithHttpInfo (string attributeCategory, string attributeName); - /// - /// Delete a contact - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact - /// - void DeleteContact (string identifier); - - /// - /// Delete a contact - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact - /// ApiResponse of Object(void) - ApiResponse DeleteContactWithHttpInfo (string identifier); - /// - /// Delete a folder (and all its lists) - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the folder - /// - void DeleteFolder (long? folderId); - - /// - /// Delete a folder (and all its lists) - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the folder - /// ApiResponse of Object(void) - ApiResponse DeleteFolderWithHttpInfo (long? folderId); - /// - /// Delete a list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the list - /// - void DeleteList (long? listId); - - /// - /// Delete a list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the list - /// ApiResponse of Object(void) - ApiResponse DeleteListWithHttpInfo (long? listId); - /// - /// List all attributes - /// - /// - /// - /// - /// Thrown when fails to make API call - /// GetAttributes - GetAttributes GetAttributes (); - - /// - /// List all attributes - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ApiResponse of GetAttributes - ApiResponse GetAttributesWithHttpInfo (); - /// - /// Get a contact's details - /// - /// - /// Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats (https://developers.sendinblue.com/reference/contacts-7#getcontactstats) endpoint with the appropriate date ranges. - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact OR its SMS attribute value - /// **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional) - /// **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. (optional) - /// GetExtendedContactDetails - GetExtendedContactDetails GetContactInfo (string identifier, Object startDate = null, Object endDate = null); - - /// - /// Get a contact's details - /// - /// - /// Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats (https://developers.sendinblue.com/reference/contacts-7#getcontactstats) endpoint with the appropriate date ranges. - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact OR its SMS attribute value - /// **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional) - /// **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. (optional) - /// ApiResponse of GetExtendedContactDetails - ApiResponse GetContactInfoWithHttpInfo (string identifier, Object startDate = null, Object endDate = null); - /// - /// Get email campaigns' statistics for a contact - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days (optional) - /// GetContactCampaignStats - GetContactCampaignStats GetContactStats (string identifier, string startDate = null, string endDate = null); - - /// - /// Get email campaigns' statistics for a contact - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days (optional) - /// ApiResponse of GetContactCampaignStats - ApiResponse GetContactStatsWithHttpInfo (string identifier, string startDate = null, string endDate = null); - /// - /// Get all the contacts - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Index of the first document of the page (optional, default to 0) - /// Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// GetContacts - GetContacts GetContacts (long? limit = null, long? offset = null, string modifiedSince = null, string sort = null); - - /// - /// Get all the contacts - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Index of the first document of the page (optional, default to 0) - /// Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// ApiResponse of GetContacts - ApiResponse GetContactsWithHttpInfo (long? limit = null, long? offset = null, string modifiedSince = null, string sort = null); - /// - /// Get contacts in a list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the list - /// Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) - /// Number of documents per page (optional, default to 50) - /// Index of the first document of the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// GetContacts - GetContacts GetContactsFromList (long? listId, string modifiedSince = null, long? limit = null, long? offset = null, string sort = null); - - /// - /// Get contacts in a list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the list - /// Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) - /// Number of documents per page (optional, default to 50) - /// Index of the first document of the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// ApiResponse of GetContacts - ApiResponse GetContactsFromListWithHttpInfo (long? listId, string modifiedSince = null, long? limit = null, long? offset = null, string sort = null); - /// - /// Returns a folder's details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the folder - /// GetFolder - GetFolder GetFolder (long? folderId); - - /// - /// Returns a folder's details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the folder - /// ApiResponse of GetFolder - ApiResponse GetFolderWithHttpInfo (long? folderId); - /// - /// Get lists in a folder - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the folder - /// Number of documents per page (optional, default to 10) - /// Index of the first document of the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// GetFolderLists - GetFolderLists GetFolderLists (long? folderId, long? limit = null, long? offset = null, string sort = null); - - /// - /// Get lists in a folder - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the folder - /// Number of documents per page (optional, default to 10) - /// Index of the first document of the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// ApiResponse of GetFolderLists - ApiResponse GetFolderListsWithHttpInfo (long? folderId, long? limit = null, long? offset = null, string sort = null); - /// - /// Get all folders - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents per page - /// Index of the first document of the page - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// GetFolders - GetFolders GetFolders (long? limit, long? offset, string sort = null); - - /// - /// Get all folders - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents per page - /// Index of the first document of the page - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// ApiResponse of GetFolders - ApiResponse GetFoldersWithHttpInfo (long? limit, long? offset, string sort = null); - /// - /// Get a list's details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the list - /// GetExtendedList - GetExtendedList GetList (long? listId); - - /// - /// Get a list's details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the list - /// ApiResponse of GetExtendedList - ApiResponse GetListWithHttpInfo (long? listId); - /// - /// Get all the lists - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 10) - /// Index of the first document of the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// GetLists - GetLists GetLists (long? limit = null, long? offset = null, string sort = null); - - /// - /// Get all the lists - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 10) - /// Index of the first document of the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// ApiResponse of GetLists - ApiResponse GetListsWithHttpInfo (long? limit = null, long? offset = null, string sort = null); - /// - /// Import contacts - /// - /// - /// It returns the background process ID which on completion calls the notify URL that you have set in the input. - /// - /// Thrown when fails to make API call - /// Values to import contacts in Sendinblue. To know more about the expected format, please have a look at ``https://help.sendinblue.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` - /// CreatedProcessId - CreatedProcessId ImportContacts (RequestContactImport requestContactImport); - - /// - /// Import contacts - /// - /// - /// It returns the background process ID which on completion calls the notify URL that you have set in the input. - /// - /// Thrown when fails to make API call - /// Values to import contacts in Sendinblue. To know more about the expected format, please have a look at ``https://help.sendinblue.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` - /// ApiResponse of CreatedProcessId - ApiResponse ImportContactsWithHttpInfo (RequestContactImport requestContactImport); - /// - /// Delete a contact from a list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the list - /// Emails addresses OR IDs of the contacts - /// PostContactInfo - PostContactInfo RemoveContactFromList (long? listId, RemoveContactFromList contactEmails); - - /// - /// Delete a contact from a list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the list - /// Emails addresses OR IDs of the contacts - /// ApiResponse of PostContactInfo - ApiResponse RemoveContactFromListWithHttpInfo (long? listId, RemoveContactFromList contactEmails); - /// - /// Export contacts - /// - /// - /// It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv. - /// - /// Thrown when fails to make API call - /// Values to request a contact export - /// CreatedProcessId - CreatedProcessId RequestContactExport (RequestContactExport requestContactExport); - - /// - /// Export contacts - /// - /// - /// It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv. - /// - /// Thrown when fails to make API call - /// Values to request a contact export - /// ApiResponse of CreatedProcessId - ApiResponse RequestContactExportWithHttpInfo (RequestContactExport requestContactExport); - /// - /// Update contact attribute - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Category of the attribute - /// Name of the existing attribute - /// Values to update an attribute - /// - void UpdateAttribute (string attributeCategory, string attributeName, UpdateAttribute updateAttribute); - - /// - /// Update contact attribute - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Category of the attribute - /// Name of the existing attribute - /// Values to update an attribute - /// ApiResponse of Object(void) - ApiResponse UpdateAttributeWithHttpInfo (string attributeCategory, string attributeName, UpdateAttribute updateAttribute); - /// - /// Update multiple contacts - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to update multiple contacts - /// - void UpdateBatchContacts (UpdateBatchContacts updateBatchContacts); - - /// - /// Update multiple contacts - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to update multiple contacts - /// ApiResponse of Object(void) - ApiResponse UpdateBatchContactsWithHttpInfo (UpdateBatchContacts updateBatchContacts); - /// - /// Update a contact - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact - /// Values to update a contact - /// - void UpdateContact (string identifier, UpdateContact updateContact); - - /// - /// Update a contact - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact - /// Values to update a contact - /// ApiResponse of Object(void) - ApiResponse UpdateContactWithHttpInfo (string identifier, UpdateContact updateContact); - /// - /// Update a folder - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the folder - /// Name of the folder - /// - void UpdateFolder (long? folderId, CreateUpdateFolder updateFolder); - - /// - /// Update a folder - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the folder - /// Name of the folder - /// ApiResponse of Object(void) - ApiResponse UpdateFolderWithHttpInfo (long? folderId, CreateUpdateFolder updateFolder); - /// - /// Update a list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the list - /// Values to update a list - /// - void UpdateList (long? listId, UpdateList updateList); - - /// - /// Update a list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the list - /// Values to update a list - /// ApiResponse of Object(void) - ApiResponse UpdateListWithHttpInfo (long? listId, UpdateList updateList); - #endregion Synchronous Operations - #region Asynchronous Operations - /// - /// Add existing contacts to a list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the list - /// Emails addresses OR IDs of the contacts - /// Task of PostContactInfo - System.Threading.Tasks.Task AddContactToListAsync (long? listId, AddContactToList contactEmails); - - /// - /// Add existing contacts to a list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the list - /// Emails addresses OR IDs of the contacts - /// Task of ApiResponse (PostContactInfo) - System.Threading.Tasks.Task> AddContactToListAsyncWithHttpInfo (long? listId, AddContactToList contactEmails); - /// - /// Create contact attribute - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Category of the attribute - /// Name of the attribute - /// Values to create an attribute - /// Task of void - System.Threading.Tasks.Task CreateAttributeAsync (string attributeCategory, string attributeName, CreateAttribute createAttribute); - - /// - /// Create contact attribute - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Category of the attribute - /// Name of the attribute - /// Values to create an attribute - /// Task of ApiResponse - System.Threading.Tasks.Task> CreateAttributeAsyncWithHttpInfo (string attributeCategory, string attributeName, CreateAttribute createAttribute); - /// - /// Create a contact - /// - /// - /// + /// /// /// Thrown when fails to make API call /// Values to create a contact /// Task of CreateUpdateContactModel System.Threading.Tasks.Task CreateContactAsync (CreateContact createContact); - - /// - /// Create a contact - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create a contact - /// Task of ApiResponse (CreateUpdateContactModel) - System.Threading.Tasks.Task> CreateContactAsyncWithHttpInfo (CreateContact createContact); - /// - /// Create Contact via DOI (Double-Opt-In) Flow - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create the Double opt-in (DOI) contact - /// Task of void - System.Threading.Tasks.Task CreateDoiContactAsync (CreateDoiContact createDoiContact); - - /// - /// Create Contact via DOI (Double-Opt-In) Flow - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create the Double opt-in (DOI) contact - /// Task of ApiResponse - System.Threading.Tasks.Task> CreateDoiContactAsyncWithHttpInfo (CreateDoiContact createDoiContact); - /// - /// Create a folder - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Name of the folder - /// Task of CreateModel - System.Threading.Tasks.Task CreateFolderAsync (CreateUpdateFolder createFolder); - - /// - /// Create a folder - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Name of the folder - /// Task of ApiResponse (CreateModel) - System.Threading.Tasks.Task> CreateFolderAsyncWithHttpInfo (CreateUpdateFolder createFolder); - /// - /// Create a list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create a list - /// Task of CreateModel - System.Threading.Tasks.Task CreateListAsync (CreateList createList); - - /// - /// Create a list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create a list - /// Task of ApiResponse (CreateModel) - System.Threading.Tasks.Task> CreateListAsyncWithHttpInfo (CreateList createList); - /// - /// Delete an attribute - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Category of the attribute - /// Name of the existing attribute - /// Task of void - System.Threading.Tasks.Task DeleteAttributeAsync (string attributeCategory, string attributeName); - - /// - /// Delete an attribute - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Category of the attribute - /// Name of the existing attribute - /// Task of ApiResponse - System.Threading.Tasks.Task> DeleteAttributeAsyncWithHttpInfo (string attributeCategory, string attributeName); - /// - /// Delete a contact - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact - /// Task of void - System.Threading.Tasks.Task DeleteContactAsync (string identifier); - - /// - /// Delete a contact - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact - /// Task of ApiResponse - System.Threading.Tasks.Task> DeleteContactAsyncWithHttpInfo (string identifier); - /// - /// Delete a folder (and all its lists) - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the folder - /// Task of void - System.Threading.Tasks.Task DeleteFolderAsync (long? folderId); - - /// - /// Delete a folder (and all its lists) - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the folder - /// Task of ApiResponse - System.Threading.Tasks.Task> DeleteFolderAsyncWithHttpInfo (long? folderId); - /// - /// Delete a list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the list - /// Task of void - System.Threading.Tasks.Task DeleteListAsync (long? listId); - - /// - /// Delete a list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the list - /// Task of ApiResponse - System.Threading.Tasks.Task> DeleteListAsyncWithHttpInfo (long? listId); - /// - /// List all attributes - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Task of GetAttributes - System.Threading.Tasks.Task GetAttributesAsync (); - - /// - /// List all attributes - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Task of ApiResponse (GetAttributes) - System.Threading.Tasks.Task> GetAttributesAsyncWithHttpInfo (); - /// - /// Get a contact's details - /// - /// - /// Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats (https://developers.sendinblue.com/reference/contacts-7#getcontactstats) endpoint with the appropriate date ranges. - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact OR its SMS attribute value - /// **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional) - /// **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. (optional) - /// Task of GetExtendedContactDetails - System.Threading.Tasks.Task GetContactInfoAsync (string identifier, Object startDate = null, Object endDate = null); - - /// - /// Get a contact's details - /// - /// - /// Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats (https://developers.sendinblue.com/reference/contacts-7#getcontactstats) endpoint with the appropriate date ranges. - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact OR its SMS attribute value - /// **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional) - /// **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. (optional) - /// Task of ApiResponse (GetExtendedContactDetails) - System.Threading.Tasks.Task> GetContactInfoAsyncWithHttpInfo (string identifier, Object startDate = null, Object endDate = null); - /// - /// Get email campaigns' statistics for a contact - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days (optional) - /// Task of GetContactCampaignStats - System.Threading.Tasks.Task GetContactStatsAsync (string identifier, string startDate = null, string endDate = null); - - /// - /// Get email campaigns' statistics for a contact - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days (optional) - /// Task of ApiResponse (GetContactCampaignStats) - System.Threading.Tasks.Task> GetContactStatsAsyncWithHttpInfo (string identifier, string startDate = null, string endDate = null); - /// - /// Get all the contacts - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Index of the first document of the page (optional, default to 0) - /// Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of GetContacts - System.Threading.Tasks.Task GetContactsAsync (long? limit = null, long? offset = null, string modifiedSince = null, string sort = null); - - /// - /// Get all the contacts - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Index of the first document of the page (optional, default to 0) - /// Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of ApiResponse (GetContacts) - System.Threading.Tasks.Task> GetContactsAsyncWithHttpInfo (long? limit = null, long? offset = null, string modifiedSince = null, string sort = null); - /// - /// Get contacts in a list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the list - /// Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) - /// Number of documents per page (optional, default to 50) - /// Index of the first document of the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of GetContacts - System.Threading.Tasks.Task GetContactsFromListAsync (long? listId, string modifiedSince = null, long? limit = null, long? offset = null, string sort = null); - - /// - /// Get contacts in a list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the list - /// Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) - /// Number of documents per page (optional, default to 50) - /// Index of the first document of the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of ApiResponse (GetContacts) - System.Threading.Tasks.Task> GetContactsFromListAsyncWithHttpInfo (long? listId, string modifiedSince = null, long? limit = null, long? offset = null, string sort = null); - /// - /// Returns a folder's details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the folder - /// Task of GetFolder - System.Threading.Tasks.Task GetFolderAsync (long? folderId); - - /// - /// Returns a folder's details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the folder - /// Task of ApiResponse (GetFolder) - System.Threading.Tasks.Task> GetFolderAsyncWithHttpInfo (long? folderId); - /// - /// Get lists in a folder - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the folder - /// Number of documents per page (optional, default to 10) - /// Index of the first document of the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of GetFolderLists - System.Threading.Tasks.Task GetFolderListsAsync (long? folderId, long? limit = null, long? offset = null, string sort = null); - - /// - /// Get lists in a folder - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the folder - /// Number of documents per page (optional, default to 10) - /// Index of the first document of the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of ApiResponse (GetFolderLists) - System.Threading.Tasks.Task> GetFolderListsAsyncWithHttpInfo (long? folderId, long? limit = null, long? offset = null, string sort = null); - /// - /// Get all folders - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents per page - /// Index of the first document of the page - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of GetFolders - System.Threading.Tasks.Task GetFoldersAsync (long? limit, long? offset, string sort = null); - - /// - /// Get all folders - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents per page - /// Index of the first document of the page - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of ApiResponse (GetFolders) - System.Threading.Tasks.Task> GetFoldersAsyncWithHttpInfo (long? limit, long? offset, string sort = null); - /// - /// Get a list's details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the list - /// Task of GetExtendedList - System.Threading.Tasks.Task GetListAsync (long? listId); - - /// - /// Get a list's details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the list - /// Task of ApiResponse (GetExtendedList) - System.Threading.Tasks.Task> GetListAsyncWithHttpInfo (long? listId); - /// - /// Get all the lists - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 10) - /// Index of the first document of the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of GetLists - System.Threading.Tasks.Task GetListsAsync (long? limit = null, long? offset = null, string sort = null); - - /// - /// Get all the lists - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 10) - /// Index of the first document of the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of ApiResponse (GetLists) - System.Threading.Tasks.Task> GetListsAsyncWithHttpInfo (long? limit = null, long? offset = null, string sort = null); - /// - /// Import contacts - /// - /// - /// It returns the background process ID which on completion calls the notify URL that you have set in the input. - /// - /// Thrown when fails to make API call - /// Values to import contacts in Sendinblue. To know more about the expected format, please have a look at ``https://help.sendinblue.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` - /// Task of CreatedProcessId - System.Threading.Tasks.Task ImportContactsAsync (RequestContactImport requestContactImport); - - /// - /// Import contacts - /// - /// - /// It returns the background process ID which on completion calls the notify URL that you have set in the input. - /// - /// Thrown when fails to make API call - /// Values to import contacts in Sendinblue. To know more about the expected format, please have a look at ``https://help.sendinblue.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` - /// Task of ApiResponse (CreatedProcessId) - System.Threading.Tasks.Task> ImportContactsAsyncWithHttpInfo (RequestContactImport requestContactImport); - /// - /// Delete a contact from a list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the list - /// Emails addresses OR IDs of the contacts - /// Task of PostContactInfo - System.Threading.Tasks.Task RemoveContactFromListAsync (long? listId, RemoveContactFromList contactEmails); - - /// - /// Delete a contact from a list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the list - /// Emails addresses OR IDs of the contacts - /// Task of ApiResponse (PostContactInfo) - System.Threading.Tasks.Task> RemoveContactFromListAsyncWithHttpInfo (long? listId, RemoveContactFromList contactEmails); - /// - /// Export contacts - /// - /// - /// It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv. - /// - /// Thrown when fails to make API call - /// Values to request a contact export - /// Task of CreatedProcessId - System.Threading.Tasks.Task RequestContactExportAsync (RequestContactExport requestContactExport); - - /// - /// Export contacts - /// - /// - /// It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv. - /// - /// Thrown when fails to make API call - /// Values to request a contact export - /// Task of ApiResponse (CreatedProcessId) - System.Threading.Tasks.Task> RequestContactExportAsyncWithHttpInfo (RequestContactExport requestContactExport); - /// - /// Update contact attribute - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Category of the attribute - /// Name of the existing attribute - /// Values to update an attribute - /// Task of void - System.Threading.Tasks.Task UpdateAttributeAsync (string attributeCategory, string attributeName, UpdateAttribute updateAttribute); - - /// - /// Update contact attribute - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Category of the attribute - /// Name of the existing attribute - /// Values to update an attribute - /// Task of ApiResponse - System.Threading.Tasks.Task> UpdateAttributeAsyncWithHttpInfo (string attributeCategory, string attributeName, UpdateAttribute updateAttribute); - /// - /// Update multiple contacts - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to update multiple contacts - /// Task of void - System.Threading.Tasks.Task UpdateBatchContactsAsync (UpdateBatchContacts updateBatchContacts); - - /// - /// Update multiple contacts - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to update multiple contacts - /// Task of ApiResponse - System.Threading.Tasks.Task> UpdateBatchContactsAsyncWithHttpInfo (UpdateBatchContacts updateBatchContacts); - /// - /// Update a contact - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact - /// Values to update a contact - /// Task of void - System.Threading.Tasks.Task UpdateContactAsync (string identifier, UpdateContact updateContact); - - /// - /// Update a contact - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact - /// Values to update a contact - /// Task of ApiResponse - System.Threading.Tasks.Task> UpdateContactAsyncWithHttpInfo (string identifier, UpdateContact updateContact); - /// - /// Update a folder - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the folder - /// Name of the folder - /// Task of void - System.Threading.Tasks.Task UpdateFolderAsync (long? folderId, CreateUpdateFolder updateFolder); - - /// - /// Update a folder - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the folder - /// Name of the folder - /// Task of ApiResponse - System.Threading.Tasks.Task> UpdateFolderAsyncWithHttpInfo (long? folderId, CreateUpdateFolder updateFolder); - /// - /// Update a list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the list - /// Values to update a list - /// Task of void - System.Threading.Tasks.Task UpdateListAsync (long? listId, UpdateList updateList); - - /// - /// Update a list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the list - /// Values to update a list - /// Task of ApiResponse - System.Threading.Tasks.Task> UpdateListAsyncWithHttpInfo (long? listId, UpdateList updateList); - #endregion Asynchronous Operations } - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public partial class ContactsApi : IContactsApi - { - private sib_api_v3_sdk.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// - /// - public ContactsApi(String basePath) - { - this.Configuration = new sib_api_v3_sdk.Client.Configuration { BasePath = basePath }; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using Configuration object - /// - /// An instance of Configuration - /// - public ContactsApi(sib_api_v3_sdk.Client.Configuration configuration = null) - { - if (configuration == null) // use the default one in Configuration - this.Configuration = sib_api_v3_sdk.Client.Configuration.Default; - else - this.Configuration = configuration; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] - public void SetBasePath(String basePath) - { - // do nothing - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public sib_api_v3_sdk.Client.Configuration Configuration {get; set;} - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public sib_api_v3_sdk.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - /// - /// Gets the default header. - /// - /// Dictionary of HTTP header - [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] - public IDictionary DefaultHeader() - { - return new ReadOnlyDictionary(this.Configuration.DefaultHeader); - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] - public void AddDefaultHeader(string key, string value) - { - this.Configuration.AddDefaultHeader(key, value); - } - - /// - /// Add existing contacts to a list - /// - /// Thrown when fails to make API call - /// Id of the list - /// Emails addresses OR IDs of the contacts - /// PostContactInfo - public PostContactInfo AddContactToList (long? listId, AddContactToList contactEmails) - { - ApiResponse localVarResponse = AddContactToListWithHttpInfo(listId, contactEmails); - return localVarResponse.Data; - } - - /// - /// Add existing contacts to a list - /// - /// Thrown when fails to make API call - /// Id of the list - /// Emails addresses OR IDs of the contacts - /// ApiResponse of PostContactInfo - public ApiResponse< PostContactInfo > AddContactToListWithHttpInfo (long? listId, AddContactToList contactEmails) - { - // verify the required parameter 'listId' is set - if (listId == null) - throw new ApiException(400, "Missing required parameter 'listId' when calling ContactsApi->AddContactToList"); - // verify the required parameter 'contactEmails' is set - if (contactEmails == null) - throw new ApiException(400, "Missing required parameter 'contactEmails' when calling ContactsApi->AddContactToList"); - - var localVarPath = "./contacts/lists/{listId}/contacts/add"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (listId != null) localVarPathParams.Add("listId", this.Configuration.ApiClient.ParameterToString(listId)); // path parameter - if (contactEmails != null && contactEmails.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(contactEmails); // http body (model) parameter - } - else - { - localVarPostBody = contactEmails; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("AddContactToList", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (PostContactInfo) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostContactInfo))); - } - - /// - /// Add existing contacts to a list - /// - /// Thrown when fails to make API call - /// Id of the list - /// Emails addresses OR IDs of the contacts - /// Task of PostContactInfo - public async System.Threading.Tasks.Task AddContactToListAsync (long? listId, AddContactToList contactEmails) - { - ApiResponse localVarResponse = await AddContactToListAsyncWithHttpInfo(listId, contactEmails); - return localVarResponse.Data; - - } - - /// - /// Add existing contacts to a list - /// - /// Thrown when fails to make API call - /// Id of the list - /// Emails addresses OR IDs of the contacts - /// Task of ApiResponse (PostContactInfo) - public async System.Threading.Tasks.Task> AddContactToListAsyncWithHttpInfo (long? listId, AddContactToList contactEmails) - { - // verify the required parameter 'listId' is set - if (listId == null) - throw new ApiException(400, "Missing required parameter 'listId' when calling ContactsApi->AddContactToList"); - // verify the required parameter 'contactEmails' is set - if (contactEmails == null) - throw new ApiException(400, "Missing required parameter 'contactEmails' when calling ContactsApi->AddContactToList"); - - var localVarPath = "./contacts/lists/{listId}/contacts/add"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (listId != null) localVarPathParams.Add("listId", this.Configuration.ApiClient.ParameterToString(listId)); // path parameter - if (contactEmails != null && contactEmails.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(contactEmails); // http body (model) parameter - } - else - { - localVarPostBody = contactEmails; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("AddContactToList", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (PostContactInfo) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostContactInfo))); - } - - /// - /// Create contact attribute - /// - /// Thrown when fails to make API call - /// Category of the attribute - /// Name of the attribute - /// Values to create an attribute - /// - public void CreateAttribute (string attributeCategory, string attributeName, CreateAttribute createAttribute) - { - CreateAttributeWithHttpInfo(attributeCategory, attributeName, createAttribute); - } - - /// - /// Create contact attribute - /// - /// Thrown when fails to make API call - /// Category of the attribute - /// Name of the attribute - /// Values to create an attribute - /// ApiResponse of Object(void) - public ApiResponse CreateAttributeWithHttpInfo (string attributeCategory, string attributeName, CreateAttribute createAttribute) - { - // verify the required parameter 'attributeCategory' is set - if (attributeCategory == null) - throw new ApiException(400, "Missing required parameter 'attributeCategory' when calling ContactsApi->CreateAttribute"); - // verify the required parameter 'attributeName' is set - if (attributeName == null) - throw new ApiException(400, "Missing required parameter 'attributeName' when calling ContactsApi->CreateAttribute"); - // verify the required parameter 'createAttribute' is set - if (createAttribute == null) - throw new ApiException(400, "Missing required parameter 'createAttribute' when calling ContactsApi->CreateAttribute"); - - var localVarPath = "./contacts/attributes/{attributeCategory}/{attributeName}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (attributeCategory != null) localVarPathParams.Add("attributeCategory", this.Configuration.ApiClient.ParameterToString(attributeCategory)); // path parameter - if (attributeName != null) localVarPathParams.Add("attributeName", this.Configuration.ApiClient.ParameterToString(attributeName)); // path parameter - if (createAttribute != null && createAttribute.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(createAttribute); // http body (model) parameter - } - else - { - localVarPostBody = createAttribute; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateAttribute", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Create contact attribute - /// - /// Thrown when fails to make API call - /// Category of the attribute - /// Name of the attribute - /// Values to create an attribute - /// Task of void - public async System.Threading.Tasks.Task CreateAttributeAsync (string attributeCategory, string attributeName, CreateAttribute createAttribute) - { - await CreateAttributeAsyncWithHttpInfo(attributeCategory, attributeName, createAttribute); - - } - - /// - /// Create contact attribute - /// - /// Thrown when fails to make API call - /// Category of the attribute - /// Name of the attribute - /// Values to create an attribute - /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateAttributeAsyncWithHttpInfo (string attributeCategory, string attributeName, CreateAttribute createAttribute) - { - // verify the required parameter 'attributeCategory' is set - if (attributeCategory == null) - throw new ApiException(400, "Missing required parameter 'attributeCategory' when calling ContactsApi->CreateAttribute"); - // verify the required parameter 'attributeName' is set - if (attributeName == null) - throw new ApiException(400, "Missing required parameter 'attributeName' when calling ContactsApi->CreateAttribute"); - // verify the required parameter 'createAttribute' is set - if (createAttribute == null) - throw new ApiException(400, "Missing required parameter 'createAttribute' when calling ContactsApi->CreateAttribute"); - - var localVarPath = "./contacts/attributes/{attributeCategory}/{attributeName}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (attributeCategory != null) localVarPathParams.Add("attributeCategory", this.Configuration.ApiClient.ParameterToString(attributeCategory)); // path parameter - if (attributeName != null) localVarPathParams.Add("attributeName", this.Configuration.ApiClient.ParameterToString(attributeName)); // path parameter - if (createAttribute != null && createAttribute.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(createAttribute); // http body (model) parameter - } - else - { - localVarPostBody = createAttribute; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateAttribute", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Create a contact - /// - /// Thrown when fails to make API call - /// Values to create a contact - /// CreateUpdateContactModel - public CreateUpdateContactModel CreateContact (CreateContact createContact) - { - ApiResponse localVarResponse = CreateContactWithHttpInfo(createContact); - return localVarResponse.Data; - } - - /// - /// Create a contact - /// - /// Thrown when fails to make API call - /// Values to create a contact - /// ApiResponse of CreateUpdateContactModel - public ApiResponse< CreateUpdateContactModel > CreateContactWithHttpInfo (CreateContact createContact) - { - // verify the required parameter 'createContact' is set - if (createContact == null) - throw new ApiException(400, "Missing required parameter 'createContact' when calling ContactsApi->CreateContact"); - - var localVarPath = "./contacts"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (createContact != null && createContact.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(createContact); // http body (model) parameter - } - else - { - localVarPostBody = createContact; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateContact", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateUpdateContactModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateUpdateContactModel))); - } - - /// - /// Create a contact - /// - /// Thrown when fails to make API call - /// Values to create a contact - /// Task of CreateUpdateContactModel - public async System.Threading.Tasks.Task CreateContactAsync (CreateContact createContact) - { - ApiResponse localVarResponse = await CreateContactAsyncWithHttpInfo(createContact); - return localVarResponse.Data; - - } - - /// - /// Create a contact - /// - /// Thrown when fails to make API call - /// Values to create a contact - /// Task of ApiResponse (CreateUpdateContactModel) - public async System.Threading.Tasks.Task> CreateContactAsyncWithHttpInfo (CreateContact createContact) - { - // verify the required parameter 'createContact' is set - if (createContact == null) - throw new ApiException(400, "Missing required parameter 'createContact' when calling ContactsApi->CreateContact"); - - var localVarPath = "./contacts"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (createContact != null && createContact.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(createContact); // http body (model) parameter - } - else - { - localVarPostBody = createContact; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateContact", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateUpdateContactModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateUpdateContactModel))); - } - - /// - /// Create Contact via DOI (Double-Opt-In) Flow - /// - /// Thrown when fails to make API call - /// Values to create the Double opt-in (DOI) contact - /// - public void CreateDoiContact (CreateDoiContact createDoiContact) - { - CreateDoiContactWithHttpInfo(createDoiContact); - } - - /// - /// Create Contact via DOI (Double-Opt-In) Flow - /// - /// Thrown when fails to make API call - /// Values to create the Double opt-in (DOI) contact - /// ApiResponse of Object(void) - public ApiResponse CreateDoiContactWithHttpInfo (CreateDoiContact createDoiContact) - { - // verify the required parameter 'createDoiContact' is set - if (createDoiContact == null) - throw new ApiException(400, "Missing required parameter 'createDoiContact' when calling ContactsApi->CreateDoiContact"); - - var localVarPath = "./contacts/doubleOptinConfirmation"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (createDoiContact != null && createDoiContact.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(createDoiContact); // http body (model) parameter - } - else - { - localVarPostBody = createDoiContact; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateDoiContact", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Create Contact via DOI (Double-Opt-In) Flow - /// - /// Thrown when fails to make API call - /// Values to create the Double opt-in (DOI) contact - /// Task of void - public async System.Threading.Tasks.Task CreateDoiContactAsync (CreateDoiContact createDoiContact) - { - await CreateDoiContactAsyncWithHttpInfo(createDoiContact); - - } - - /// - /// Create Contact via DOI (Double-Opt-In) Flow - /// - /// Thrown when fails to make API call - /// Values to create the Double opt-in (DOI) contact - /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateDoiContactAsyncWithHttpInfo (CreateDoiContact createDoiContact) - { - // verify the required parameter 'createDoiContact' is set - if (createDoiContact == null) - throw new ApiException(400, "Missing required parameter 'createDoiContact' when calling ContactsApi->CreateDoiContact"); - - var localVarPath = "./contacts/doubleOptinConfirmation"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (createDoiContact != null && createDoiContact.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(createDoiContact); // http body (model) parameter - } - else - { - localVarPostBody = createDoiContact; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateDoiContact", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Create a folder - /// - /// Thrown when fails to make API call - /// Name of the folder - /// CreateModel - public CreateModel CreateFolder (CreateUpdateFolder createFolder) - { - ApiResponse localVarResponse = CreateFolderWithHttpInfo(createFolder); - return localVarResponse.Data; - } - - /// - /// Create a folder - /// - /// Thrown when fails to make API call - /// Name of the folder - /// ApiResponse of CreateModel - public ApiResponse< CreateModel > CreateFolderWithHttpInfo (CreateUpdateFolder createFolder) - { - // verify the required parameter 'createFolder' is set - if (createFolder == null) - throw new ApiException(400, "Missing required parameter 'createFolder' when calling ContactsApi->CreateFolder"); - - var localVarPath = "./contacts/folders"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (createFolder != null && createFolder.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(createFolder); // http body (model) parameter - } - else - { - localVarPostBody = createFolder; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateFolder", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateModel))); - } - - /// - /// Create a folder - /// - /// Thrown when fails to make API call - /// Name of the folder - /// Task of CreateModel - public async System.Threading.Tasks.Task CreateFolderAsync (CreateUpdateFolder createFolder) - { - ApiResponse localVarResponse = await CreateFolderAsyncWithHttpInfo(createFolder); - return localVarResponse.Data; - - } - - /// - /// Create a folder - /// - /// Thrown when fails to make API call - /// Name of the folder - /// Task of ApiResponse (CreateModel) - public async System.Threading.Tasks.Task> CreateFolderAsyncWithHttpInfo (CreateUpdateFolder createFolder) - { - // verify the required parameter 'createFolder' is set - if (createFolder == null) - throw new ApiException(400, "Missing required parameter 'createFolder' when calling ContactsApi->CreateFolder"); - - var localVarPath = "./contacts/folders"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (createFolder != null && createFolder.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(createFolder); // http body (model) parameter - } - else - { - localVarPostBody = createFolder; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateFolder", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateModel))); - } - - /// - /// Create a list - /// - /// Thrown when fails to make API call - /// Values to create a list - /// CreateModel - public CreateModel CreateList (CreateList createList) - { - ApiResponse localVarResponse = CreateListWithHttpInfo(createList); - return localVarResponse.Data; - } - - /// - /// Create a list - /// - /// Thrown when fails to make API call - /// Values to create a list - /// ApiResponse of CreateModel - public ApiResponse< CreateModel > CreateListWithHttpInfo (CreateList createList) - { - // verify the required parameter 'createList' is set - if (createList == null) - throw new ApiException(400, "Missing required parameter 'createList' when calling ContactsApi->CreateList"); - - var localVarPath = "./contacts/lists"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (createList != null && createList.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(createList); // http body (model) parameter - } - else - { - localVarPostBody = createList; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateList", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateModel))); - } - - /// - /// Create a list - /// - /// Thrown when fails to make API call - /// Values to create a list - /// Task of CreateModel - public async System.Threading.Tasks.Task CreateListAsync (CreateList createList) - { - ApiResponse localVarResponse = await CreateListAsyncWithHttpInfo(createList); - return localVarResponse.Data; - - } - - /// - /// Create a list - /// - /// Thrown when fails to make API call - /// Values to create a list - /// Task of ApiResponse (CreateModel) - public async System.Threading.Tasks.Task> CreateListAsyncWithHttpInfo (CreateList createList) - { - // verify the required parameter 'createList' is set - if (createList == null) - throw new ApiException(400, "Missing required parameter 'createList' when calling ContactsApi->CreateList"); - - var localVarPath = "./contacts/lists"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (createList != null && createList.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(createList); // http body (model) parameter - } - else - { - localVarPostBody = createList; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateList", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateModel))); - } - - /// - /// Delete an attribute - /// - /// Thrown when fails to make API call - /// Category of the attribute - /// Name of the existing attribute - /// - public void DeleteAttribute (string attributeCategory, string attributeName) - { - DeleteAttributeWithHttpInfo(attributeCategory, attributeName); - } - - /// - /// Delete an attribute - /// - /// Thrown when fails to make API call - /// Category of the attribute - /// Name of the existing attribute - /// ApiResponse of Object(void) - public ApiResponse DeleteAttributeWithHttpInfo (string attributeCategory, string attributeName) - { - // verify the required parameter 'attributeCategory' is set - if (attributeCategory == null) - throw new ApiException(400, "Missing required parameter 'attributeCategory' when calling ContactsApi->DeleteAttribute"); - // verify the required parameter 'attributeName' is set - if (attributeName == null) - throw new ApiException(400, "Missing required parameter 'attributeName' when calling ContactsApi->DeleteAttribute"); - - var localVarPath = "./contacts/attributes/{attributeCategory}/{attributeName}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (attributeCategory != null) localVarPathParams.Add("attributeCategory", this.Configuration.ApiClient.ParameterToString(attributeCategory)); // path parameter - if (attributeName != null) localVarPathParams.Add("attributeName", this.Configuration.ApiClient.ParameterToString(attributeName)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteAttribute", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete an attribute - /// - /// Thrown when fails to make API call - /// Category of the attribute - /// Name of the existing attribute - /// Task of void - public async System.Threading.Tasks.Task DeleteAttributeAsync (string attributeCategory, string attributeName) - { - await DeleteAttributeAsyncWithHttpInfo(attributeCategory, attributeName); - - } - - /// - /// Delete an attribute - /// - /// Thrown when fails to make API call - /// Category of the attribute - /// Name of the existing attribute - /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeleteAttributeAsyncWithHttpInfo (string attributeCategory, string attributeName) - { - // verify the required parameter 'attributeCategory' is set - if (attributeCategory == null) - throw new ApiException(400, "Missing required parameter 'attributeCategory' when calling ContactsApi->DeleteAttribute"); - // verify the required parameter 'attributeName' is set - if (attributeName == null) - throw new ApiException(400, "Missing required parameter 'attributeName' when calling ContactsApi->DeleteAttribute"); - - var localVarPath = "./contacts/attributes/{attributeCategory}/{attributeName}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (attributeCategory != null) localVarPathParams.Add("attributeCategory", this.Configuration.ApiClient.ParameterToString(attributeCategory)); // path parameter - if (attributeName != null) localVarPathParams.Add("attributeName", this.Configuration.ApiClient.ParameterToString(attributeName)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteAttribute", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete a contact - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact - /// - public void DeleteContact (string identifier) - { - DeleteContactWithHttpInfo(identifier); - } - - /// - /// Delete a contact - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact - /// ApiResponse of Object(void) - public ApiResponse DeleteContactWithHttpInfo (string identifier) - { - // verify the required parameter 'identifier' is set - if (identifier == null) - throw new ApiException(400, "Missing required parameter 'identifier' when calling ContactsApi->DeleteContact"); - - var localVarPath = "./contacts/{identifier}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (identifier != null) localVarPathParams.Add("identifier", this.Configuration.ApiClient.ParameterToString(identifier)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteContact", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete a contact - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact - /// Task of void - public async System.Threading.Tasks.Task DeleteContactAsync (string identifier) - { - await DeleteContactAsyncWithHttpInfo(identifier); - - } - - /// - /// Delete a contact - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact - /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeleteContactAsyncWithHttpInfo (string identifier) - { - // verify the required parameter 'identifier' is set - if (identifier == null) - throw new ApiException(400, "Missing required parameter 'identifier' when calling ContactsApi->DeleteContact"); - - var localVarPath = "./contacts/{identifier}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (identifier != null) localVarPathParams.Add("identifier", this.Configuration.ApiClient.ParameterToString(identifier)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteContact", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete a folder (and all its lists) - /// - /// Thrown when fails to make API call - /// Id of the folder - /// - public void DeleteFolder (long? folderId) - { - DeleteFolderWithHttpInfo(folderId); - } - - /// - /// Delete a folder (and all its lists) - /// - /// Thrown when fails to make API call - /// Id of the folder - /// ApiResponse of Object(void) - public ApiResponse DeleteFolderWithHttpInfo (long? folderId) - { - // verify the required parameter 'folderId' is set - if (folderId == null) - throw new ApiException(400, "Missing required parameter 'folderId' when calling ContactsApi->DeleteFolder"); - - var localVarPath = "./contacts/folders/{folderId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (folderId != null) localVarPathParams.Add("folderId", this.Configuration.ApiClient.ParameterToString(folderId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteFolder", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete a folder (and all its lists) - /// - /// Thrown when fails to make API call - /// Id of the folder - /// Task of void - public async System.Threading.Tasks.Task DeleteFolderAsync (long? folderId) - { - await DeleteFolderAsyncWithHttpInfo(folderId); - - } - - /// - /// Delete a folder (and all its lists) - /// - /// Thrown when fails to make API call - /// Id of the folder - /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeleteFolderAsyncWithHttpInfo (long? folderId) - { - // verify the required parameter 'folderId' is set - if (folderId == null) - throw new ApiException(400, "Missing required parameter 'folderId' when calling ContactsApi->DeleteFolder"); - - var localVarPath = "./contacts/folders/{folderId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (folderId != null) localVarPathParams.Add("folderId", this.Configuration.ApiClient.ParameterToString(folderId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteFolder", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete a list - /// - /// Thrown when fails to make API call - /// Id of the list - /// - public void DeleteList (long? listId) - { - DeleteListWithHttpInfo(listId); - } - - /// - /// Delete a list - /// - /// Thrown when fails to make API call - /// Id of the list - /// ApiResponse of Object(void) - public ApiResponse DeleteListWithHttpInfo (long? listId) - { - // verify the required parameter 'listId' is set - if (listId == null) - throw new ApiException(400, "Missing required parameter 'listId' when calling ContactsApi->DeleteList"); - - var localVarPath = "./contacts/lists/{listId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (listId != null) localVarPathParams.Add("listId", this.Configuration.ApiClient.ParameterToString(listId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteList", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete a list - /// - /// Thrown when fails to make API call - /// Id of the list - /// Task of void - public async System.Threading.Tasks.Task DeleteListAsync (long? listId) - { - await DeleteListAsyncWithHttpInfo(listId); - - } - - /// - /// Delete a list - /// - /// Thrown when fails to make API call - /// Id of the list - /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeleteListAsyncWithHttpInfo (long? listId) - { - // verify the required parameter 'listId' is set - if (listId == null) - throw new ApiException(400, "Missing required parameter 'listId' when calling ContactsApi->DeleteList"); - - var localVarPath = "./contacts/lists/{listId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (listId != null) localVarPathParams.Add("listId", this.Configuration.ApiClient.ParameterToString(listId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteList", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// List all attributes - /// - /// Thrown when fails to make API call - /// GetAttributes - public GetAttributes GetAttributes () - { - ApiResponse localVarResponse = GetAttributesWithHttpInfo(); - return localVarResponse.Data; - } - - /// - /// List all attributes - /// - /// Thrown when fails to make API call - /// ApiResponse of GetAttributes - public ApiResponse< GetAttributes > GetAttributesWithHttpInfo () - { - - var localVarPath = "./contacts/attributes"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetAttributes", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetAttributes) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetAttributes))); - } - - /// - /// List all attributes - /// - /// Thrown when fails to make API call - /// Task of GetAttributes - public async System.Threading.Tasks.Task GetAttributesAsync () - { - ApiResponse localVarResponse = await GetAttributesAsyncWithHttpInfo(); - return localVarResponse.Data; - - } - - /// - /// List all attributes - /// - /// Thrown when fails to make API call - /// Task of ApiResponse (GetAttributes) - public async System.Threading.Tasks.Task> GetAttributesAsyncWithHttpInfo () - { - - var localVarPath = "./contacts/attributes"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetAttributes", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetAttributes) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetAttributes))); - } - - /// - /// Get a contact's details Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats (https://developers.sendinblue.com/reference/contacts-7#getcontactstats) endpoint with the appropriate date ranges. - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact OR its SMS attribute value - /// **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional) - /// **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. (optional) - /// GetExtendedContactDetails - public GetExtendedContactDetails GetContactInfo (string identifier, Object startDate = null, Object endDate = null) - { - ApiResponse localVarResponse = GetContactInfoWithHttpInfo(identifier, startDate, endDate); - return localVarResponse.Data; - } - - /// - /// Get a contact's details Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats (https://developers.sendinblue.com/reference/contacts-7#getcontactstats) endpoint with the appropriate date ranges. - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact OR its SMS attribute value - /// **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional) - /// **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. (optional) - /// ApiResponse of GetExtendedContactDetails - public ApiResponse< GetExtendedContactDetails > GetContactInfoWithHttpInfo (string identifier, Object startDate = null, Object endDate = null) - { - // verify the required parameter 'identifier' is set - if (identifier == null) - throw new ApiException(400, "Missing required parameter 'identifier' when calling ContactsApi->GetContactInfo"); - - var localVarPath = "./contacts/{identifier}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (identifier != null) localVarPathParams.Add("identifier", this.Configuration.ApiClient.ParameterToString(identifier)); // path parameter - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetContactInfo", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetExtendedContactDetails) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetExtendedContactDetails))); - } - - /// - /// Get a contact's details Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats (https://developers.sendinblue.com/reference/contacts-7#getcontactstats) endpoint with the appropriate date ranges. - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact OR its SMS attribute value - /// **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional) - /// **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. (optional) - /// Task of GetExtendedContactDetails - public async System.Threading.Tasks.Task GetContactInfoAsync (string identifier, Object startDate = null, Object endDate = null) - { - ApiResponse localVarResponse = await GetContactInfoAsyncWithHttpInfo(identifier, startDate, endDate); - return localVarResponse.Data; - - } - - /// - /// Get a contact's details Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats (https://developers.sendinblue.com/reference/contacts-7#getcontactstats) endpoint with the appropriate date ranges. - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact OR its SMS attribute value - /// **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional) - /// **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. (optional) - /// Task of ApiResponse (GetExtendedContactDetails) - public async System.Threading.Tasks.Task> GetContactInfoAsyncWithHttpInfo (string identifier, Object startDate = null, Object endDate = null) - { - // verify the required parameter 'identifier' is set - if (identifier == null) - throw new ApiException(400, "Missing required parameter 'identifier' when calling ContactsApi->GetContactInfo"); - - var localVarPath = "./contacts/{identifier}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (identifier != null) localVarPathParams.Add("identifier", this.Configuration.ApiClient.ParameterToString(identifier)); // path parameter - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetContactInfo", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetExtendedContactDetails) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetExtendedContactDetails))); - } - - /// - /// Get email campaigns' statistics for a contact - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days (optional) - /// GetContactCampaignStats - public GetContactCampaignStats GetContactStats (string identifier, string startDate = null, string endDate = null) - { - ApiResponse localVarResponse = GetContactStatsWithHttpInfo(identifier, startDate, endDate); - return localVarResponse.Data; - } - - /// - /// Get email campaigns' statistics for a contact - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days (optional) - /// ApiResponse of GetContactCampaignStats - public ApiResponse< GetContactCampaignStats > GetContactStatsWithHttpInfo (string identifier, string startDate = null, string endDate = null) - { - // verify the required parameter 'identifier' is set - if (identifier == null) - throw new ApiException(400, "Missing required parameter 'identifier' when calling ContactsApi->GetContactStats"); - - var localVarPath = "./contacts/{identifier}/campaignStats"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (identifier != null) localVarPathParams.Add("identifier", this.Configuration.ApiClient.ParameterToString(identifier)); // path parameter - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetContactStats", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetContactCampaignStats) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetContactCampaignStats))); - } - - /// - /// Get email campaigns' statistics for a contact - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days (optional) - /// Task of GetContactCampaignStats - public async System.Threading.Tasks.Task GetContactStatsAsync (string identifier, string startDate = null, string endDate = null) - { - ApiResponse localVarResponse = await GetContactStatsAsyncWithHttpInfo(identifier, startDate, endDate); - return localVarResponse.Data; - - } - - /// - /// Get email campaigns' statistics for a contact - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days (optional) - /// Task of ApiResponse (GetContactCampaignStats) - public async System.Threading.Tasks.Task> GetContactStatsAsyncWithHttpInfo (string identifier, string startDate = null, string endDate = null) - { - // verify the required parameter 'identifier' is set - if (identifier == null) - throw new ApiException(400, "Missing required parameter 'identifier' when calling ContactsApi->GetContactStats"); - - var localVarPath = "./contacts/{identifier}/campaignStats"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (identifier != null) localVarPathParams.Add("identifier", this.Configuration.ApiClient.ParameterToString(identifier)); // path parameter - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetContactStats", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetContactCampaignStats) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetContactCampaignStats))); - } - - /// - /// Get all the contacts - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Index of the first document of the page (optional, default to 0) - /// Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// GetContacts - public GetContacts GetContacts (long? limit = null, long? offset = null, string modifiedSince = null, string sort = null) - { - ApiResponse localVarResponse = GetContactsWithHttpInfo(limit, offset, modifiedSince, sort); - return localVarResponse.Data; - } - - /// - /// Get all the contacts - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Index of the first document of the page (optional, default to 0) - /// Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// ApiResponse of GetContacts - public ApiResponse< GetContacts > GetContactsWithHttpInfo (long? limit = null, long? offset = null, string modifiedSince = null, string sort = null) - { - - var localVarPath = "./contacts"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (modifiedSince != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "modifiedSince", modifiedSince)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetContacts", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetContacts) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetContacts))); - } - - /// - /// Get all the contacts - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Index of the first document of the page (optional, default to 0) - /// Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of GetContacts - public async System.Threading.Tasks.Task GetContactsAsync (long? limit = null, long? offset = null, string modifiedSince = null, string sort = null) - { - ApiResponse localVarResponse = await GetContactsAsyncWithHttpInfo(limit, offset, modifiedSince, sort); - return localVarResponse.Data; - - } - - /// - /// Get all the contacts - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Index of the first document of the page (optional, default to 0) - /// Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of ApiResponse (GetContacts) - public async System.Threading.Tasks.Task> GetContactsAsyncWithHttpInfo (long? limit = null, long? offset = null, string modifiedSince = null, string sort = null) - { - - var localVarPath = "./contacts"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (modifiedSince != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "modifiedSince", modifiedSince)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetContacts", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetContacts) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetContacts))); - } - - /// - /// Get contacts in a list - /// - /// Thrown when fails to make API call - /// Id of the list - /// Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) - /// Number of documents per page (optional, default to 50) - /// Index of the first document of the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// GetContacts - public GetContacts GetContactsFromList (long? listId, string modifiedSince = null, long? limit = null, long? offset = null, string sort = null) - { - ApiResponse localVarResponse = GetContactsFromListWithHttpInfo(listId, modifiedSince, limit, offset, sort); - return localVarResponse.Data; - } - - /// - /// Get contacts in a list - /// - /// Thrown when fails to make API call - /// Id of the list - /// Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) - /// Number of documents per page (optional, default to 50) - /// Index of the first document of the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// ApiResponse of GetContacts - public ApiResponse< GetContacts > GetContactsFromListWithHttpInfo (long? listId, string modifiedSince = null, long? limit = null, long? offset = null, string sort = null) - { - // verify the required parameter 'listId' is set - if (listId == null) - throw new ApiException(400, "Missing required parameter 'listId' when calling ContactsApi->GetContactsFromList"); - - var localVarPath = "./contacts/lists/{listId}/contacts"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (listId != null) localVarPathParams.Add("listId", this.Configuration.ApiClient.ParameterToString(listId)); // path parameter - if (modifiedSince != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "modifiedSince", modifiedSince)); // query parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetContactsFromList", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetContacts) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetContacts))); - } - - /// - /// Get contacts in a list - /// - /// Thrown when fails to make API call - /// Id of the list - /// Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) - /// Number of documents per page (optional, default to 50) - /// Index of the first document of the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of GetContacts - public async System.Threading.Tasks.Task GetContactsFromListAsync (long? listId, string modifiedSince = null, long? limit = null, long? offset = null, string sort = null) - { - ApiResponse localVarResponse = await GetContactsFromListAsyncWithHttpInfo(listId, modifiedSince, limit, offset, sort); - return localVarResponse.Data; - - } - - /// - /// Get contacts in a list - /// - /// Thrown when fails to make API call - /// Id of the list - /// Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) - /// Number of documents per page (optional, default to 50) - /// Index of the first document of the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of ApiResponse (GetContacts) - public async System.Threading.Tasks.Task> GetContactsFromListAsyncWithHttpInfo (long? listId, string modifiedSince = null, long? limit = null, long? offset = null, string sort = null) - { - // verify the required parameter 'listId' is set - if (listId == null) - throw new ApiException(400, "Missing required parameter 'listId' when calling ContactsApi->GetContactsFromList"); - - var localVarPath = "./contacts/lists/{listId}/contacts"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (listId != null) localVarPathParams.Add("listId", this.Configuration.ApiClient.ParameterToString(listId)); // path parameter - if (modifiedSince != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "modifiedSince", modifiedSince)); // query parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetContactsFromList", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetContacts) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetContacts))); - } - - /// - /// Returns a folder's details - /// - /// Thrown when fails to make API call - /// id of the folder - /// GetFolder - public GetFolder GetFolder (long? folderId) - { - ApiResponse localVarResponse = GetFolderWithHttpInfo(folderId); - return localVarResponse.Data; - } - - /// - /// Returns a folder's details - /// - /// Thrown when fails to make API call - /// id of the folder - /// ApiResponse of GetFolder - public ApiResponse< GetFolder > GetFolderWithHttpInfo (long? folderId) - { - // verify the required parameter 'folderId' is set - if (folderId == null) - throw new ApiException(400, "Missing required parameter 'folderId' when calling ContactsApi->GetFolder"); - - var localVarPath = "./contacts/folders/{folderId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (folderId != null) localVarPathParams.Add("folderId", this.Configuration.ApiClient.ParameterToString(folderId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetFolder", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetFolder) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetFolder))); - } - - /// - /// Returns a folder's details - /// - /// Thrown when fails to make API call - /// id of the folder - /// Task of GetFolder - public async System.Threading.Tasks.Task GetFolderAsync (long? folderId) - { - ApiResponse localVarResponse = await GetFolderAsyncWithHttpInfo(folderId); - return localVarResponse.Data; - - } - - /// - /// Returns a folder's details - /// - /// Thrown when fails to make API call - /// id of the folder - /// Task of ApiResponse (GetFolder) - public async System.Threading.Tasks.Task> GetFolderAsyncWithHttpInfo (long? folderId) - { - // verify the required parameter 'folderId' is set - if (folderId == null) - throw new ApiException(400, "Missing required parameter 'folderId' when calling ContactsApi->GetFolder"); - - var localVarPath = "./contacts/folders/{folderId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (folderId != null) localVarPathParams.Add("folderId", this.Configuration.ApiClient.ParameterToString(folderId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetFolder", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetFolder) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetFolder))); - } - - /// - /// Get lists in a folder - /// - /// Thrown when fails to make API call - /// Id of the folder - /// Number of documents per page (optional, default to 10) - /// Index of the first document of the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// GetFolderLists - public GetFolderLists GetFolderLists (long? folderId, long? limit = null, long? offset = null, string sort = null) - { - ApiResponse localVarResponse = GetFolderListsWithHttpInfo(folderId, limit, offset, sort); - return localVarResponse.Data; - } - - /// - /// Get lists in a folder - /// - /// Thrown when fails to make API call - /// Id of the folder - /// Number of documents per page (optional, default to 10) - /// Index of the first document of the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// ApiResponse of GetFolderLists - public ApiResponse< GetFolderLists > GetFolderListsWithHttpInfo (long? folderId, long? limit = null, long? offset = null, string sort = null) - { - // verify the required parameter 'folderId' is set - if (folderId == null) - throw new ApiException(400, "Missing required parameter 'folderId' when calling ContactsApi->GetFolderLists"); - - var localVarPath = "./contacts/folders/{folderId}/lists"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (folderId != null) localVarPathParams.Add("folderId", this.Configuration.ApiClient.ParameterToString(folderId)); // path parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetFolderLists", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetFolderLists) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetFolderLists))); - } - - /// - /// Get lists in a folder - /// - /// Thrown when fails to make API call - /// Id of the folder - /// Number of documents per page (optional, default to 10) - /// Index of the first document of the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of GetFolderLists - public async System.Threading.Tasks.Task GetFolderListsAsync (long? folderId, long? limit = null, long? offset = null, string sort = null) - { - ApiResponse localVarResponse = await GetFolderListsAsyncWithHttpInfo(folderId, limit, offset, sort); - return localVarResponse.Data; - - } - - /// - /// Get lists in a folder - /// - /// Thrown when fails to make API call - /// Id of the folder - /// Number of documents per page (optional, default to 10) - /// Index of the first document of the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of ApiResponse (GetFolderLists) - public async System.Threading.Tasks.Task> GetFolderListsAsyncWithHttpInfo (long? folderId, long? limit = null, long? offset = null, string sort = null) - { - // verify the required parameter 'folderId' is set - if (folderId == null) - throw new ApiException(400, "Missing required parameter 'folderId' when calling ContactsApi->GetFolderLists"); - - var localVarPath = "./contacts/folders/{folderId}/lists"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (folderId != null) localVarPathParams.Add("folderId", this.Configuration.ApiClient.ParameterToString(folderId)); // path parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetFolderLists", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetFolderLists) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetFolderLists))); - } - - /// - /// Get all folders - /// - /// Thrown when fails to make API call - /// Number of documents per page - /// Index of the first document of the page - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// GetFolders - public GetFolders GetFolders (long? limit, long? offset, string sort = null) - { - ApiResponse localVarResponse = GetFoldersWithHttpInfo(limit, offset, sort); - return localVarResponse.Data; - } - - /// - /// Get all folders - /// - /// Thrown when fails to make API call - /// Number of documents per page - /// Index of the first document of the page - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// ApiResponse of GetFolders - public ApiResponse< GetFolders > GetFoldersWithHttpInfo (long? limit, long? offset, string sort = null) - { - // verify the required parameter 'limit' is set - if (limit == null) - throw new ApiException(400, "Missing required parameter 'limit' when calling ContactsApi->GetFolders"); - // verify the required parameter 'offset' is set - if (offset == null) - throw new ApiException(400, "Missing required parameter 'offset' when calling ContactsApi->GetFolders"); - - var localVarPath = "./contacts/folders"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetFolders", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetFolders) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetFolders))); - } - - /// - /// Get all folders - /// - /// Thrown when fails to make API call - /// Number of documents per page - /// Index of the first document of the page - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of GetFolders - public async System.Threading.Tasks.Task GetFoldersAsync (long? limit, long? offset, string sort = null) - { - ApiResponse localVarResponse = await GetFoldersAsyncWithHttpInfo(limit, offset, sort); - return localVarResponse.Data; - - } - - /// - /// Get all folders - /// - /// Thrown when fails to make API call - /// Number of documents per page - /// Index of the first document of the page - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of ApiResponse (GetFolders) - public async System.Threading.Tasks.Task> GetFoldersAsyncWithHttpInfo (long? limit, long? offset, string sort = null) - { - // verify the required parameter 'limit' is set - if (limit == null) - throw new ApiException(400, "Missing required parameter 'limit' when calling ContactsApi->GetFolders"); - // verify the required parameter 'offset' is set - if (offset == null) - throw new ApiException(400, "Missing required parameter 'offset' when calling ContactsApi->GetFolders"); - - var localVarPath = "./contacts/folders"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetFolders", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetFolders) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetFolders))); - } - - /// - /// Get a list's details - /// - /// Thrown when fails to make API call - /// Id of the list - /// GetExtendedList - public GetExtendedList GetList (long? listId) - { - ApiResponse localVarResponse = GetListWithHttpInfo(listId); - return localVarResponse.Data; - } - - /// - /// Get a list's details - /// - /// Thrown when fails to make API call - /// Id of the list - /// ApiResponse of GetExtendedList - public ApiResponse< GetExtendedList > GetListWithHttpInfo (long? listId) - { - // verify the required parameter 'listId' is set - if (listId == null) - throw new ApiException(400, "Missing required parameter 'listId' when calling ContactsApi->GetList"); - - var localVarPath = "./contacts/lists/{listId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (listId != null) localVarPathParams.Add("listId", this.Configuration.ApiClient.ParameterToString(listId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetList", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetExtendedList) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetExtendedList))); - } - - /// - /// Get a list's details - /// - /// Thrown when fails to make API call - /// Id of the list - /// Task of GetExtendedList - public async System.Threading.Tasks.Task GetListAsync (long? listId) - { - ApiResponse localVarResponse = await GetListAsyncWithHttpInfo(listId); - return localVarResponse.Data; - - } - - /// - /// Get a list's details - /// - /// Thrown when fails to make API call - /// Id of the list - /// Task of ApiResponse (GetExtendedList) - public async System.Threading.Tasks.Task> GetListAsyncWithHttpInfo (long? listId) - { - // verify the required parameter 'listId' is set - if (listId == null) - throw new ApiException(400, "Missing required parameter 'listId' when calling ContactsApi->GetList"); - - var localVarPath = "./contacts/lists/{listId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (listId != null) localVarPathParams.Add("listId", this.Configuration.ApiClient.ParameterToString(listId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetList", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetExtendedList) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetExtendedList))); - } - - /// - /// Get all the lists - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 10) - /// Index of the first document of the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// GetLists - public GetLists GetLists (long? limit = null, long? offset = null, string sort = null) - { - ApiResponse localVarResponse = GetListsWithHttpInfo(limit, offset, sort); - return localVarResponse.Data; - } - - /// - /// Get all the lists - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 10) - /// Index of the first document of the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// ApiResponse of GetLists - public ApiResponse< GetLists > GetListsWithHttpInfo (long? limit = null, long? offset = null, string sort = null) - { - - var localVarPath = "./contacts/lists"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetLists", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetLists) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetLists))); - } - - /// - /// Get all the lists - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 10) - /// Index of the first document of the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of GetLists - public async System.Threading.Tasks.Task GetListsAsync (long? limit = null, long? offset = null, string sort = null) - { - ApiResponse localVarResponse = await GetListsAsyncWithHttpInfo(limit, offset, sort); - return localVarResponse.Data; - - } - - /// - /// Get all the lists - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 10) - /// Index of the first document of the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of ApiResponse (GetLists) - public async System.Threading.Tasks.Task> GetListsAsyncWithHttpInfo (long? limit = null, long? offset = null, string sort = null) - { - - var localVarPath = "./contacts/lists"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetLists", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetLists) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetLists))); - } - - /// - /// Import contacts It returns the background process ID which on completion calls the notify URL that you have set in the input. - /// - /// Thrown when fails to make API call - /// Values to import contacts in Sendinblue. To know more about the expected format, please have a look at ``https://help.sendinblue.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` - /// CreatedProcessId - public CreatedProcessId ImportContacts (RequestContactImport requestContactImport) - { - ApiResponse localVarResponse = ImportContactsWithHttpInfo(requestContactImport); - return localVarResponse.Data; - } - - /// - /// Import contacts It returns the background process ID which on completion calls the notify URL that you have set in the input. - /// - /// Thrown when fails to make API call - /// Values to import contacts in Sendinblue. To know more about the expected format, please have a look at ``https://help.sendinblue.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` - /// ApiResponse of CreatedProcessId - public ApiResponse< CreatedProcessId > ImportContactsWithHttpInfo (RequestContactImport requestContactImport) - { - // verify the required parameter 'requestContactImport' is set - if (requestContactImport == null) - throw new ApiException(400, "Missing required parameter 'requestContactImport' when calling ContactsApi->ImportContacts"); - - var localVarPath = "./contacts/import"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (requestContactImport != null && requestContactImport.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(requestContactImport); // http body (model) parameter - } - else - { - localVarPostBody = requestContactImport; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("ImportContacts", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreatedProcessId) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreatedProcessId))); - } - - /// - /// Import contacts It returns the background process ID which on completion calls the notify URL that you have set in the input. - /// - /// Thrown when fails to make API call - /// Values to import contacts in Sendinblue. To know more about the expected format, please have a look at ``https://help.sendinblue.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` - /// Task of CreatedProcessId - public async System.Threading.Tasks.Task ImportContactsAsync (RequestContactImport requestContactImport) - { - ApiResponse localVarResponse = await ImportContactsAsyncWithHttpInfo(requestContactImport); - return localVarResponse.Data; - - } - - /// - /// Import contacts It returns the background process ID which on completion calls the notify URL that you have set in the input. - /// - /// Thrown when fails to make API call - /// Values to import contacts in Sendinblue. To know more about the expected format, please have a look at ``https://help.sendinblue.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` - /// Task of ApiResponse (CreatedProcessId) - public async System.Threading.Tasks.Task> ImportContactsAsyncWithHttpInfo (RequestContactImport requestContactImport) - { - // verify the required parameter 'requestContactImport' is set - if (requestContactImport == null) - throw new ApiException(400, "Missing required parameter 'requestContactImport' when calling ContactsApi->ImportContacts"); - - var localVarPath = "./contacts/import"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (requestContactImport != null && requestContactImport.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(requestContactImport); // http body (model) parameter - } - else - { - localVarPostBody = requestContactImport; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("ImportContacts", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreatedProcessId) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreatedProcessId))); - } - - /// - /// Delete a contact from a list - /// - /// Thrown when fails to make API call - /// Id of the list - /// Emails addresses OR IDs of the contacts - /// PostContactInfo - public PostContactInfo RemoveContactFromList (long? listId, RemoveContactFromList contactEmails) - { - ApiResponse localVarResponse = RemoveContactFromListWithHttpInfo(listId, contactEmails); - return localVarResponse.Data; - } - - /// - /// Delete a contact from a list - /// - /// Thrown when fails to make API call - /// Id of the list - /// Emails addresses OR IDs of the contacts - /// ApiResponse of PostContactInfo - public ApiResponse< PostContactInfo > RemoveContactFromListWithHttpInfo (long? listId, RemoveContactFromList contactEmails) - { - // verify the required parameter 'listId' is set - if (listId == null) - throw new ApiException(400, "Missing required parameter 'listId' when calling ContactsApi->RemoveContactFromList"); - // verify the required parameter 'contactEmails' is set - if (contactEmails == null) - throw new ApiException(400, "Missing required parameter 'contactEmails' when calling ContactsApi->RemoveContactFromList"); - - var localVarPath = "./contacts/lists/{listId}/contacts/remove"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (listId != null) localVarPathParams.Add("listId", this.Configuration.ApiClient.ParameterToString(listId)); // path parameter - if (contactEmails != null && contactEmails.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(contactEmails); // http body (model) parameter - } - else - { - localVarPostBody = contactEmails; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("RemoveContactFromList", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (PostContactInfo) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostContactInfo))); - } - - /// - /// Delete a contact from a list - /// - /// Thrown when fails to make API call - /// Id of the list - /// Emails addresses OR IDs of the contacts - /// Task of PostContactInfo - public async System.Threading.Tasks.Task RemoveContactFromListAsync (long? listId, RemoveContactFromList contactEmails) - { - ApiResponse localVarResponse = await RemoveContactFromListAsyncWithHttpInfo(listId, contactEmails); - return localVarResponse.Data; - - } - - /// - /// Delete a contact from a list - /// - /// Thrown when fails to make API call - /// Id of the list - /// Emails addresses OR IDs of the contacts - /// Task of ApiResponse (PostContactInfo) - public async System.Threading.Tasks.Task> RemoveContactFromListAsyncWithHttpInfo (long? listId, RemoveContactFromList contactEmails) - { - // verify the required parameter 'listId' is set - if (listId == null) - throw new ApiException(400, "Missing required parameter 'listId' when calling ContactsApi->RemoveContactFromList"); - // verify the required parameter 'contactEmails' is set - if (contactEmails == null) - throw new ApiException(400, "Missing required parameter 'contactEmails' when calling ContactsApi->RemoveContactFromList"); - - var localVarPath = "./contacts/lists/{listId}/contacts/remove"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (listId != null) localVarPathParams.Add("listId", this.Configuration.ApiClient.ParameterToString(listId)); // path parameter - if (contactEmails != null && contactEmails.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(contactEmails); // http body (model) parameter - } - else - { - localVarPostBody = contactEmails; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("RemoveContactFromList", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (PostContactInfo) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostContactInfo))); - } - - /// - /// Export contacts It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv. - /// - /// Thrown when fails to make API call - /// Values to request a contact export - /// CreatedProcessId - public CreatedProcessId RequestContactExport (RequestContactExport requestContactExport) - { - ApiResponse localVarResponse = RequestContactExportWithHttpInfo(requestContactExport); - return localVarResponse.Data; - } - - /// - /// Export contacts It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv. - /// - /// Thrown when fails to make API call - /// Values to request a contact export - /// ApiResponse of CreatedProcessId - public ApiResponse< CreatedProcessId > RequestContactExportWithHttpInfo (RequestContactExport requestContactExport) - { - // verify the required parameter 'requestContactExport' is set - if (requestContactExport == null) - throw new ApiException(400, "Missing required parameter 'requestContactExport' when calling ContactsApi->RequestContactExport"); - - var localVarPath = "./contacts/export"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (requestContactExport != null && requestContactExport.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(requestContactExport); // http body (model) parameter - } - else - { - localVarPostBody = requestContactExport; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("RequestContactExport", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreatedProcessId) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreatedProcessId))); - } - - /// - /// Export contacts It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv. - /// - /// Thrown when fails to make API call - /// Values to request a contact export - /// Task of CreatedProcessId - public async System.Threading.Tasks.Task RequestContactExportAsync (RequestContactExport requestContactExport) - { - ApiResponse localVarResponse = await RequestContactExportAsyncWithHttpInfo(requestContactExport); - return localVarResponse.Data; - - } - - /// - /// Export contacts It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv. - /// - /// Thrown when fails to make API call - /// Values to request a contact export - /// Task of ApiResponse (CreatedProcessId) - public async System.Threading.Tasks.Task> RequestContactExportAsyncWithHttpInfo (RequestContactExport requestContactExport) - { - // verify the required parameter 'requestContactExport' is set - if (requestContactExport == null) - throw new ApiException(400, "Missing required parameter 'requestContactExport' when calling ContactsApi->RequestContactExport"); - - var localVarPath = "./contacts/export"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (requestContactExport != null && requestContactExport.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(requestContactExport); // http body (model) parameter - } - else - { - localVarPostBody = requestContactExport; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("RequestContactExport", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreatedProcessId) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreatedProcessId))); - } - - /// - /// Update contact attribute - /// - /// Thrown when fails to make API call - /// Category of the attribute - /// Name of the existing attribute - /// Values to update an attribute - /// - public void UpdateAttribute (string attributeCategory, string attributeName, UpdateAttribute updateAttribute) - { - UpdateAttributeWithHttpInfo(attributeCategory, attributeName, updateAttribute); - } - - /// - /// Update contact attribute - /// - /// Thrown when fails to make API call - /// Category of the attribute - /// Name of the existing attribute - /// Values to update an attribute - /// ApiResponse of Object(void) - public ApiResponse UpdateAttributeWithHttpInfo (string attributeCategory, string attributeName, UpdateAttribute updateAttribute) - { - // verify the required parameter 'attributeCategory' is set - if (attributeCategory == null) - throw new ApiException(400, "Missing required parameter 'attributeCategory' when calling ContactsApi->UpdateAttribute"); - // verify the required parameter 'attributeName' is set - if (attributeName == null) - throw new ApiException(400, "Missing required parameter 'attributeName' when calling ContactsApi->UpdateAttribute"); - // verify the required parameter 'updateAttribute' is set - if (updateAttribute == null) - throw new ApiException(400, "Missing required parameter 'updateAttribute' when calling ContactsApi->UpdateAttribute"); - - var localVarPath = "./contacts/attributes/{attributeCategory}/{attributeName}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (attributeCategory != null) localVarPathParams.Add("attributeCategory", this.Configuration.ApiClient.ParameterToString(attributeCategory)); // path parameter - if (attributeName != null) localVarPathParams.Add("attributeName", this.Configuration.ApiClient.ParameterToString(attributeName)); // path parameter - if (updateAttribute != null && updateAttribute.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(updateAttribute); // http body (model) parameter - } - else - { - localVarPostBody = updateAttribute; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UpdateAttribute", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Update contact attribute - /// - /// Thrown when fails to make API call - /// Category of the attribute - /// Name of the existing attribute - /// Values to update an attribute - /// Task of void - public async System.Threading.Tasks.Task UpdateAttributeAsync (string attributeCategory, string attributeName, UpdateAttribute updateAttribute) - { - await UpdateAttributeAsyncWithHttpInfo(attributeCategory, attributeName, updateAttribute); - - } - - /// - /// Update contact attribute - /// - /// Thrown when fails to make API call - /// Category of the attribute - /// Name of the existing attribute - /// Values to update an attribute - /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdateAttributeAsyncWithHttpInfo (string attributeCategory, string attributeName, UpdateAttribute updateAttribute) - { - // verify the required parameter 'attributeCategory' is set - if (attributeCategory == null) - throw new ApiException(400, "Missing required parameter 'attributeCategory' when calling ContactsApi->UpdateAttribute"); - // verify the required parameter 'attributeName' is set - if (attributeName == null) - throw new ApiException(400, "Missing required parameter 'attributeName' when calling ContactsApi->UpdateAttribute"); - // verify the required parameter 'updateAttribute' is set - if (updateAttribute == null) - throw new ApiException(400, "Missing required parameter 'updateAttribute' when calling ContactsApi->UpdateAttribute"); - - var localVarPath = "./contacts/attributes/{attributeCategory}/{attributeName}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (attributeCategory != null) localVarPathParams.Add("attributeCategory", this.Configuration.ApiClient.ParameterToString(attributeCategory)); // path parameter - if (attributeName != null) localVarPathParams.Add("attributeName", this.Configuration.ApiClient.ParameterToString(attributeName)); // path parameter - if (updateAttribute != null && updateAttribute.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(updateAttribute); // http body (model) parameter - } - else - { - localVarPostBody = updateAttribute; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UpdateAttribute", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Update multiple contacts - /// - /// Thrown when fails to make API call - /// Values to update multiple contacts - /// - public void UpdateBatchContacts (UpdateBatchContacts updateBatchContacts) - { - UpdateBatchContactsWithHttpInfo(updateBatchContacts); - } - - /// - /// Update multiple contacts - /// - /// Thrown when fails to make API call - /// Values to update multiple contacts - /// ApiResponse of Object(void) - public ApiResponse UpdateBatchContactsWithHttpInfo (UpdateBatchContacts updateBatchContacts) - { - // verify the required parameter 'updateBatchContacts' is set - if (updateBatchContacts == null) - throw new ApiException(400, "Missing required parameter 'updateBatchContacts' when calling ContactsApi->UpdateBatchContacts"); - - var localVarPath = "./contacts/batch"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (updateBatchContacts != null && updateBatchContacts.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(updateBatchContacts); // http body (model) parameter - } - else - { - localVarPostBody = updateBatchContacts; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UpdateBatchContacts", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Update multiple contacts - /// - /// Thrown when fails to make API call - /// Values to update multiple contacts - /// Task of void - public async System.Threading.Tasks.Task UpdateBatchContactsAsync (UpdateBatchContacts updateBatchContacts) - { - await UpdateBatchContactsAsyncWithHttpInfo(updateBatchContacts); - - } - - /// - /// Update multiple contacts - /// - /// Thrown when fails to make API call - /// Values to update multiple contacts - /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdateBatchContactsAsyncWithHttpInfo (UpdateBatchContacts updateBatchContacts) - { - // verify the required parameter 'updateBatchContacts' is set - if (updateBatchContacts == null) - throw new ApiException(400, "Missing required parameter 'updateBatchContacts' when calling ContactsApi->UpdateBatchContacts"); - - var localVarPath = "./contacts/batch"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (updateBatchContacts != null && updateBatchContacts.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(updateBatchContacts); // http body (model) parameter - } - else - { - localVarPostBody = updateBatchContacts; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UpdateBatchContacts", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Update a contact - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact - /// Values to update a contact - /// - public void UpdateContact (string identifier, UpdateContact updateContact) - { - UpdateContactWithHttpInfo(identifier, updateContact); - } - - /// - /// Update a contact - /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact - /// Values to update a contact - /// ApiResponse of Object(void) - public ApiResponse UpdateContactWithHttpInfo (string identifier, UpdateContact updateContact) - { - // verify the required parameter 'identifier' is set - if (identifier == null) - throw new ApiException(400, "Missing required parameter 'identifier' when calling ContactsApi->UpdateContact"); - // verify the required parameter 'updateContact' is set - if (updateContact == null) - throw new ApiException(400, "Missing required parameter 'updateContact' when calling ContactsApi->UpdateContact"); - - var localVarPath = "./contacts/{identifier}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (identifier != null) localVarPathParams.Add("identifier", this.Configuration.ApiClient.ParameterToString(identifier)); // path parameter - if (updateContact != null && updateContact.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(updateContact); // http body (model) parameter - } - else - { - localVarPostBody = updateContact; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class ContactsApi : IContactsApi + { + private sib_api_v3_sdk.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UpdateContact", localVarResponse); - if (exception != null) throw exception; - } + /// + /// Initializes a new instance of the class. + /// + /// + public ContactsApi(String basePath) + { + this.Configuration = new sib_api_v3_sdk.Client.Configuration { BasePath = basePath }; - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); + ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; } /// - /// Update a contact + /// Initializes a new instance of the class + /// using Configuration object /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact - /// Values to update a contact - /// Task of void - public async System.Threading.Tasks.Task UpdateContactAsync (string identifier, UpdateContact updateContact) + /// An instance of Configuration + /// + public ContactsApi(sib_api_v3_sdk.Client.Configuration configuration = null) { - await UpdateContactAsyncWithHttpInfo(identifier, updateContact); + if (configuration == null) // use the default one in Configuration + this.Configuration = sib_api_v3_sdk.Client.Configuration.Default; + else + this.Configuration = configuration; + ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; } /// - /// Update a contact + /// Gets the base path of the API client. /// - /// Thrown when fails to make API call - /// Email (urlencoded) OR ID of the contact - /// Values to update a contact - /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdateContactAsyncWithHttpInfo (string identifier, UpdateContact updateContact) + /// The base path + public String GetBasePath() { - // verify the required parameter 'identifier' is set - if (identifier == null) - throw new ApiException(400, "Missing required parameter 'identifier' when calling ContactsApi->UpdateContact"); - // verify the required parameter 'updateContact' is set - if (updateContact == null) - throw new ApiException(400, "Missing required parameter 'updateContact' when calling ContactsApi->UpdateContact"); - - var localVarPath = "./contacts/{identifier}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + return this.Configuration.ApiClient.RestClient.BaseAddress.ToString(); + } - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + /// + /// Sets the base path of the API client. + /// + /// The base path + [Obsolete( + "SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] + public void SetBasePath(String basePath) + { + // do nothing + } - if (identifier != null) localVarPathParams.Add("identifier", this.Configuration.ApiClient.ParameterToString(identifier)); // path parameter - if (updateContact != null && updateContact.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(updateContact); // http body (model) parameter - } - else - { - localVarPostBody = updateContact; // byte array - } + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public sib_api_v3_sdk.Client.Configuration Configuration { get; set; } - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public sib_api_v3_sdk.Client.ExceptionFactory ExceptionFactory + { + get { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UpdateContact", localVarResponse); - if (exception != null) throw exception; + return _exceptionFactory; } + set { _exceptionFactory = value; } + } - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); + /// + /// Gets the default header. + /// + /// Dictionary of HTTP header + [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] + public IDictionary DefaultHeader() + { + return new ReadOnlyDictionary(this.Configuration.DefaultHeader); } /// - /// Update a folder + /// Add default header. /// - /// Thrown when fails to make API call - /// Id of the folder - /// Name of the folder + /// Header field name. + /// Header field value. /// - public void UpdateFolder (long? folderId, CreateUpdateFolder updateFolder) + [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] + public void AddDefaultHeader(string key, string value) { - UpdateFolderWithHttpInfo(folderId, updateFolder); + this.Configuration.AddDefaultHeader(key, value); } /// - /// Update a folder + /// Get a contact's details Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats (https://developers.sendinblue.com/reference/contacts-7#getcontactstats) endpoint with the appropriate date ranges. /// /// Thrown when fails to make API call - /// Id of the folder - /// Name of the folder - /// ApiResponse of Object(void) - public ApiResponse UpdateFolderWithHttpInfo (long? folderId, CreateUpdateFolder updateFolder) + /// Email (urlencoded) OR ID of the contact OR its SMS attribute value + /// **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional) + /// **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. (optional) + /// Task of GetExtendedContactDetails + public async System.Threading.Tasks.Task GetContactInfoAsync (string identifier) { - // verify the required parameter 'folderId' is set - if (folderId == null) - throw new ApiException(400, "Missing required parameter 'folderId' when calling ContactsApi->UpdateFolder"); - // verify the required parameter 'updateFolder' is set - if (updateFolder == null) - throw new ApiException(400, "Missing required parameter 'updateFolder' when calling ContactsApi->UpdateFolder"); - - var localVarPath = "./contacts/folders/{folderId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (folderId != null) localVarPathParams.Add("folderId", this.Configuration.ApiClient.ParameterToString(folderId)); // path parameter - if (updateFolder != null && updateFolder.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(updateFolder); // http body (model) parameter - } - else - { - localVarPostBody = updateFolder; // byte array - } + var localVarResponse = await GetContactInfoAsyncWithHttpInfo(identifier); + return localVarResponse.Data; - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } + } - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + /// + /// Get a contact's details Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats (https://developers.sendinblue.com/reference/contacts-7#getcontactstats) endpoint with the appropriate date ranges. + /// + /// Thrown when fails to make API call + /// Email (urlencoded) OR ID of the contact OR its SMS attribute value + /// **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional) + /// **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. (optional) + /// Task of ApiResponse (GetExtendedContactDetails) + public async System.Threading.Tasks.Task> GetContactInfoAsyncWithHttpInfo (string identifier) + { + // verify the required parameter 'identifier' is set + if (identifier == null) + throw new ApiException(400, "Missing required parameter 'identifier' when calling ContactsApi->GetContactInfo"); - int localVarStatusCode = (int) localVarResponse.StatusCode; + var localVarPath = $"./contacts/{identifier}"; + var request = this.Configuration.ApiClient.PrepareJsonGetRequest(localVarPath, "application/json"); + var response = await this.Configuration.ApiClient.RestClient.SendAsync(request); if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("UpdateFolder", localVarResponse); + var exception = ExceptionFactory("GetContactInfo", response); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); + var localVarStatusCode = (int) response.StatusCode; + return new ApiResponse(localVarStatusCode, + response.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (GetExtendedContactDetails) this.Configuration.ApiClient.Deserialize(response, typeof(GetExtendedContactDetails))); } /// - /// Update a folder + /// Add existing contacts to a list /// /// Thrown when fails to make API call - /// Id of the folder - /// Name of the folder - /// Task of void - public async System.Threading.Tasks.Task UpdateFolderAsync (long? folderId, CreateUpdateFolder updateFolder) + /// Id of the list + /// Emails addresses OR IDs of the contacts + /// Task of PostContactInfo + public async System.Threading.Tasks.Task AddContactToListAsync (long? listId, AddContactToList contactEmails) { - await UpdateFolderAsyncWithHttpInfo(folderId, updateFolder); + var localVarResponse = await AddContactToListAsyncWithHttpInfo(listId, contactEmails); + return localVarResponse.Data; } /// - /// Update a folder + /// Add existing contacts to a list /// /// Thrown when fails to make API call - /// Id of the folder - /// Name of the folder - /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdateFolderAsyncWithHttpInfo (long? folderId, CreateUpdateFolder updateFolder) + /// Id of the list + /// Emails addresses OR IDs of the contacts + /// Task of ApiResponse (PostContactInfo) + public async System.Threading.Tasks.Task> AddContactToListAsyncWithHttpInfo (long? listId, AddContactToList contactEmails) { - // verify the required parameter 'folderId' is set - if (folderId == null) - throw new ApiException(400, "Missing required parameter 'folderId' when calling ContactsApi->UpdateFolder"); - // verify the required parameter 'updateFolder' is set - if (updateFolder == null) - throw new ApiException(400, "Missing required parameter 'updateFolder' when calling ContactsApi->UpdateFolder"); - - var localVarPath = "./contacts/folders/{folderId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (folderId != null) localVarPathParams.Add("folderId", this.Configuration.ApiClient.ParameterToString(folderId)); // path parameter - if (updateFolder != null && updateFolder.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(updateFolder); // http body (model) parameter - } - else - { - localVarPostBody = updateFolder; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + // verify the required parameter 'listId' is set + if (listId == null) + throw new ApiException(400, "Missing required parameter 'listId' when calling ContactsApi->AddContactToList"); + // verify the required parameter 'contactEmails' is set + if (contactEmails == null) + throw new ApiException(400, "Missing required parameter 'contactEmails' when calling ContactsApi->AddContactToList"); - int localVarStatusCode = (int) localVarResponse.StatusCode; + var localVarPath = $"./contacts/lists/{listId}/contacts/add"; + var postBody = this.Configuration.ApiClient.Serialize(contactEmails); + var request = this.Configuration.ApiClient.PreparePostBodyRequest(localVarPath, "application/json", postBody); + var response = await this.Configuration.ApiClient.RestClient.SendAsync(request); if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("UpdateFolder", localVarResponse); + var exception = ExceptionFactory("AddContactToList", response); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); + var localVarStatusCode = (int) response.StatusCode; + return new ApiResponse(localVarStatusCode, + response.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (PostContactInfo) this.Configuration.ApiClient.Deserialize(response, typeof(PostContactInfo))); } /// - /// Update a list + /// Update a contact /// /// Thrown when fails to make API call - /// Id of the list - /// Values to update a list - /// - public void UpdateList (long? listId, UpdateList updateList) + /// Email (urlencoded) OR ID of the contact + /// Values to update a contact + /// Task of void + public async System.Threading.Tasks.Task UpdateContactAsync (string identifier, UpdateContact updateContact) { - UpdateListWithHttpInfo(listId, updateList); + await UpdateContactAsyncWithHttpInfo(identifier, updateContact); } /// - /// Update a list + /// Update a contact /// /// Thrown when fails to make API call - /// Id of the list - /// Values to update a list - /// ApiResponse of Object(void) - public ApiResponse UpdateListWithHttpInfo (long? listId, UpdateList updateList) + /// Email (urlencoded) OR ID of the contact + /// Values to update a contact + /// Task of ApiResponse + public async System.Threading.Tasks.Task> UpdateContactAsyncWithHttpInfo (string identifier, UpdateContact updateContact) { - // verify the required parameter 'listId' is set - if (listId == null) - throw new ApiException(400, "Missing required parameter 'listId' when calling ContactsApi->UpdateList"); - // verify the required parameter 'updateList' is set - if (updateList == null) - throw new ApiException(400, "Missing required parameter 'updateList' when calling ContactsApi->UpdateList"); - - var localVarPath = "./contacts/lists/{listId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (listId != null) localVarPathParams.Add("listId", this.Configuration.ApiClient.ParameterToString(listId)); // path parameter - if (updateList != null && updateList.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(updateList); // http body (model) parameter - } - else - { - localVarPostBody = updateList; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + // verify the required parameter 'identifier' is set + if (identifier == null) + throw new ApiException(400, "Missing required parameter 'identifier' when calling ContactsApi->UpdateContact"); + // verify the required parameter 'updateContact' is set + if (updateContact == null) + throw new ApiException(400, "Missing required parameter 'updateContact' when calling ContactsApi->UpdateContact"); - int localVarStatusCode = (int) localVarResponse.StatusCode; + var localVarPath = $"./contacts/{identifier}"; + var localVarPostBody = this.Configuration.ApiClient.Serialize(updateContact); + var request = this.Configuration.ApiClient.PreparePostBodyRequest(localVarPath, "applicaton/json", localVarPostBody); + var response = await this.Configuration.ApiClient.RestClient.SendAsync(request); if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("UpdateList", localVarResponse); + var exception = ExceptionFactory("UpdateContact", response); if (exception != null) throw exception; } + var localVarStatusCode = (int) response.StatusCode; return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + response.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); } /// - /// Update a list + /// Create a contact /// /// Thrown when fails to make API call - /// Id of the list - /// Values to update a list - /// Task of void - public async System.Threading.Tasks.Task UpdateListAsync (long? listId, UpdateList updateList) + /// Values to create a contact + /// Task of CreateUpdateContactModel + public async System.Threading.Tasks.Task CreateContactAsync (CreateContact createContact) { - await UpdateListAsyncWithHttpInfo(listId, updateList); - + var localVarResponse = await CreateContactAsyncWithHttpInfo(createContact); + return localVarResponse.Data; } /// - /// Update a list + /// Create a contact /// /// Thrown when fails to make API call - /// Id of the list - /// Values to update a list - /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdateListAsyncWithHttpInfo (long? listId, UpdateList updateList) + /// Values to create a contact + /// Task of ApiResponse (CreateUpdateContactModel) + public async System.Threading.Tasks.Task> CreateContactAsyncWithHttpInfo (CreateContact createContact) { - // verify the required parameter 'listId' is set - if (listId == null) - throw new ApiException(400, "Missing required parameter 'listId' when calling ContactsApi->UpdateList"); - // verify the required parameter 'updateList' is set - if (updateList == null) - throw new ApiException(400, "Missing required parameter 'updateList' when calling ContactsApi->UpdateList"); - - var localVarPath = "./contacts/lists/{listId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (listId != null) localVarPathParams.Add("listId", this.Configuration.ApiClient.ParameterToString(listId)); // path parameter - if (updateList != null && updateList.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(updateList); // http body (model) parameter - } - else - { - localVarPostBody = updateList; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + // verify the required parameter 'createContact' is set + if (createContact == null) + throw new ApiException(400, "Missing required parameter 'createContact' when calling ContactsApi->CreateContact"); - int localVarStatusCode = (int) localVarResponse.StatusCode; + var localVarPath = "./contacts"; + var localVarPostBody = this.Configuration.ApiClient.Serialize(createContact); + var request = this.Configuration.ApiClient.PreparePostBodyRequest(localVarPath, "application/json", localVarPostBody); + var response = await this.Configuration.ApiClient.RestClient.SendAsync(request); if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("UpdateList", localVarResponse); + var exception = ExceptionFactory("CreateContact", response); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); + var localVarStatusCode = (int) response.StatusCode; + return new ApiResponse(localVarStatusCode, + response.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (CreateUpdateContactModel) this.Configuration.ApiClient.Deserialize(response, typeof(CreateUpdateContactModel))); } - } } diff --git a/src/sib_api_v3_sdk/Api/ConversationsApi.cs b/src/sib_api_v3_sdk/Api/ConversationsApi.cs deleted file mode 100644 index cc2abef..0000000 --- a/src/sib_api_v3_sdk/Api/ConversationsApi.cs +++ /dev/null @@ -1,1993 +0,0 @@ -/* - * SendinBlue API - * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :- -- -- -- -- -- --: | - -- -- -- -- -- -- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | - * - * OpenAPI spec version: 3.0.0 - * Contact: contact@sendinblue.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using RestSharp.Portable; -using sib_api_v3_sdk.Client; -using sib_api_v3_sdk.Model; - -namespace sib_api_v3_sdk.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IConversationsApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Sets agent’s status to online for 2-3 minutes - /// - /// - /// We recommend pinging this endpoint every minute for as long as the agent has to be considered online. - /// - /// Thrown when fails to make API call - /// Agent fields. - /// - void ConversationsAgentOnlinePingPost (Body12 body); - - /// - /// Sets agent’s status to online for 2-3 minutes - /// - /// - /// We recommend pinging this endpoint every minute for as long as the agent has to be considered online. - /// - /// Thrown when fails to make API call - /// Agent fields. - /// ApiResponse of Object(void) - ApiResponse ConversationsAgentOnlinePingPostWithHttpInfo (Body12 body); - /// - /// Delete a message sent by an agent - /// - /// - /// Only agents’ messages can be deleted. - /// - /// Thrown when fails to make API call - /// ID of the message - /// - void ConversationsMessagesIdDelete (string id); - - /// - /// Delete a message sent by an agent - /// - /// - /// Only agents’ messages can be deleted. - /// - /// Thrown when fails to make API call - /// ID of the message - /// ApiResponse of Object(void) - ApiResponse ConversationsMessagesIdDeleteWithHttpInfo (string id); - /// - /// Get a message - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ID of the message - /// ConversationsMessage - ConversationsMessage ConversationsMessagesIdGet (string id); - - /// - /// Get a message - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ID of the message - /// ApiResponse of ConversationsMessage - ApiResponse ConversationsMessagesIdGetWithHttpInfo (string id); - /// - /// Update a message sent by an agent - /// - /// - /// Only agents’ messages can be edited. - /// - /// Thrown when fails to make API call - /// ID of the message - /// (optional) - /// ConversationsMessage - ConversationsMessage ConversationsMessagesIdPut (string id, Body9 body = null); - - /// - /// Update a message sent by an agent - /// - /// - /// Only agents’ messages can be edited. - /// - /// Thrown when fails to make API call - /// ID of the message - /// (optional) - /// ApiResponse of ConversationsMessage - ApiResponse ConversationsMessagesIdPutWithHttpInfo (string id, Body9 body = null); - /// - /// Send a message as an agent - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Message fields. - /// ConversationsMessage - ConversationsMessage ConversationsMessagesPost (Body8 body); - - /// - /// Send a message as an agent - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Message fields. - /// ApiResponse of ConversationsMessage - ApiResponse ConversationsMessagesPostWithHttpInfo (Body8 body); - /// - /// Delete an automated message - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ID of the message - /// - void ConversationsPushedMessagesIdDelete (string id); - - /// - /// Delete an automated message - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ID of the message - /// ApiResponse of Object(void) - ApiResponse ConversationsPushedMessagesIdDeleteWithHttpInfo (string id); - /// - /// Get an automated message - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ID of the message sent previously - /// ConversationsMessage - ConversationsMessage ConversationsPushedMessagesIdGet (string id); - - /// - /// Get an automated message - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ID of the message sent previously - /// ApiResponse of ConversationsMessage - ApiResponse ConversationsPushedMessagesIdGetWithHttpInfo (string id); - /// - /// Update an automated message - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ID of the message - /// - /// ConversationsMessage - ConversationsMessage ConversationsPushedMessagesIdPut (string id, Body11 body); - - /// - /// Update an automated message - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ID of the message - /// - /// ApiResponse of ConversationsMessage - ApiResponse ConversationsPushedMessagesIdPutWithHttpInfo (string id, Body11 body); - /// - /// Send an automated message to a visitor - /// - /// - /// Example of automated messages: order status, announce new features in your web app, etc. - /// - /// Thrown when fails to make API call - /// - /// ConversationsMessage - ConversationsMessage ConversationsPushedMessagesPost (Body10 body); - - /// - /// Send an automated message to a visitor - /// - /// - /// Example of automated messages: order status, announce new features in your web app, etc. - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of ConversationsMessage - ApiResponse ConversationsPushedMessagesPostWithHttpInfo (Body10 body); - #endregion Synchronous Operations - #region Asynchronous Operations - /// - /// Sets agent’s status to online for 2-3 minutes - /// - /// - /// We recommend pinging this endpoint every minute for as long as the agent has to be considered online. - /// - /// Thrown when fails to make API call - /// Agent fields. - /// Task of void - System.Threading.Tasks.Task ConversationsAgentOnlinePingPostAsync (Body12 body); - - /// - /// Sets agent’s status to online for 2-3 minutes - /// - /// - /// We recommend pinging this endpoint every minute for as long as the agent has to be considered online. - /// - /// Thrown when fails to make API call - /// Agent fields. - /// Task of ApiResponse - System.Threading.Tasks.Task> ConversationsAgentOnlinePingPostAsyncWithHttpInfo (Body12 body); - /// - /// Delete a message sent by an agent - /// - /// - /// Only agents’ messages can be deleted. - /// - /// Thrown when fails to make API call - /// ID of the message - /// Task of void - System.Threading.Tasks.Task ConversationsMessagesIdDeleteAsync (string id); - - /// - /// Delete a message sent by an agent - /// - /// - /// Only agents’ messages can be deleted. - /// - /// Thrown when fails to make API call - /// ID of the message - /// Task of ApiResponse - System.Threading.Tasks.Task> ConversationsMessagesIdDeleteAsyncWithHttpInfo (string id); - /// - /// Get a message - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ID of the message - /// Task of ConversationsMessage - System.Threading.Tasks.Task ConversationsMessagesIdGetAsync (string id); - - /// - /// Get a message - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ID of the message - /// Task of ApiResponse (ConversationsMessage) - System.Threading.Tasks.Task> ConversationsMessagesIdGetAsyncWithHttpInfo (string id); - /// - /// Update a message sent by an agent - /// - /// - /// Only agents’ messages can be edited. - /// - /// Thrown when fails to make API call - /// ID of the message - /// (optional) - /// Task of ConversationsMessage - System.Threading.Tasks.Task ConversationsMessagesIdPutAsync (string id, Body9 body = null); - - /// - /// Update a message sent by an agent - /// - /// - /// Only agents’ messages can be edited. - /// - /// Thrown when fails to make API call - /// ID of the message - /// (optional) - /// Task of ApiResponse (ConversationsMessage) - System.Threading.Tasks.Task> ConversationsMessagesIdPutAsyncWithHttpInfo (string id, Body9 body = null); - /// - /// Send a message as an agent - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Message fields. - /// Task of ConversationsMessage - System.Threading.Tasks.Task ConversationsMessagesPostAsync (Body8 body); - - /// - /// Send a message as an agent - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Message fields. - /// Task of ApiResponse (ConversationsMessage) - System.Threading.Tasks.Task> ConversationsMessagesPostAsyncWithHttpInfo (Body8 body); - /// - /// Delete an automated message - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ID of the message - /// Task of void - System.Threading.Tasks.Task ConversationsPushedMessagesIdDeleteAsync (string id); - - /// - /// Delete an automated message - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ID of the message - /// Task of ApiResponse - System.Threading.Tasks.Task> ConversationsPushedMessagesIdDeleteAsyncWithHttpInfo (string id); - /// - /// Get an automated message - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ID of the message sent previously - /// Task of ConversationsMessage - System.Threading.Tasks.Task ConversationsPushedMessagesIdGetAsync (string id); - - /// - /// Get an automated message - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ID of the message sent previously - /// Task of ApiResponse (ConversationsMessage) - System.Threading.Tasks.Task> ConversationsPushedMessagesIdGetAsyncWithHttpInfo (string id); - /// - /// Update an automated message - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ID of the message - /// - /// Task of ConversationsMessage - System.Threading.Tasks.Task ConversationsPushedMessagesIdPutAsync (string id, Body11 body); - - /// - /// Update an automated message - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ID of the message - /// - /// Task of ApiResponse (ConversationsMessage) - System.Threading.Tasks.Task> ConversationsPushedMessagesIdPutAsyncWithHttpInfo (string id, Body11 body); - /// - /// Send an automated message to a visitor - /// - /// - /// Example of automated messages: order status, announce new features in your web app, etc. - /// - /// Thrown when fails to make API call - /// - /// Task of ConversationsMessage - System.Threading.Tasks.Task ConversationsPushedMessagesPostAsync (Body10 body); - - /// - /// Send an automated message to a visitor - /// - /// - /// Example of automated messages: order status, announce new features in your web app, etc. - /// - /// Thrown when fails to make API call - /// - /// Task of ApiResponse (ConversationsMessage) - System.Threading.Tasks.Task> ConversationsPushedMessagesPostAsyncWithHttpInfo (Body10 body); - #endregion Asynchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public partial class ConversationsApi : IConversationsApi - { - private sib_api_v3_sdk.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// - /// - public ConversationsApi(String basePath) - { - this.Configuration = new sib_api_v3_sdk.Client.Configuration { BasePath = basePath }; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using Configuration object - /// - /// An instance of Configuration - /// - public ConversationsApi(sib_api_v3_sdk.Client.Configuration configuration = null) - { - if (configuration == null) // use the default one in Configuration - this.Configuration = sib_api_v3_sdk.Client.Configuration.Default; - else - this.Configuration = configuration; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] - public void SetBasePath(String basePath) - { - // do nothing - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public sib_api_v3_sdk.Client.Configuration Configuration {get; set;} - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public sib_api_v3_sdk.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - /// - /// Gets the default header. - /// - /// Dictionary of HTTP header - [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] - public IDictionary DefaultHeader() - { - return new ReadOnlyDictionary(this.Configuration.DefaultHeader); - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] - public void AddDefaultHeader(string key, string value) - { - this.Configuration.AddDefaultHeader(key, value); - } - - /// - /// Sets agent’s status to online for 2-3 minutes We recommend pinging this endpoint every minute for as long as the agent has to be considered online. - /// - /// Thrown when fails to make API call - /// Agent fields. - /// - public void ConversationsAgentOnlinePingPost (Body12 body) - { - ConversationsAgentOnlinePingPostWithHttpInfo(body); - } - - /// - /// Sets agent’s status to online for 2-3 minutes We recommend pinging this endpoint every minute for as long as the agent has to be considered online. - /// - /// Thrown when fails to make API call - /// Agent fields. - /// ApiResponse of Object(void) - public ApiResponse ConversationsAgentOnlinePingPostWithHttpInfo (Body12 body) - { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling ConversationsApi->ConversationsAgentOnlinePingPost"); - - var localVarPath = "./conversations/agentOnlinePing"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("ConversationsAgentOnlinePingPost", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Sets agent’s status to online for 2-3 minutes We recommend pinging this endpoint every minute for as long as the agent has to be considered online. - /// - /// Thrown when fails to make API call - /// Agent fields. - /// Task of void - public async System.Threading.Tasks.Task ConversationsAgentOnlinePingPostAsync (Body12 body) - { - await ConversationsAgentOnlinePingPostAsyncWithHttpInfo(body); - - } - - /// - /// Sets agent’s status to online for 2-3 minutes We recommend pinging this endpoint every minute for as long as the agent has to be considered online. - /// - /// Thrown when fails to make API call - /// Agent fields. - /// Task of ApiResponse - public async System.Threading.Tasks.Task> ConversationsAgentOnlinePingPostAsyncWithHttpInfo (Body12 body) - { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling ConversationsApi->ConversationsAgentOnlinePingPost"); - - var localVarPath = "./conversations/agentOnlinePing"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("ConversationsAgentOnlinePingPost", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete a message sent by an agent Only agents’ messages can be deleted. - /// - /// Thrown when fails to make API call - /// ID of the message - /// - public void ConversationsMessagesIdDelete (string id) - { - ConversationsMessagesIdDeleteWithHttpInfo(id); - } - - /// - /// Delete a message sent by an agent Only agents’ messages can be deleted. - /// - /// Thrown when fails to make API call - /// ID of the message - /// ApiResponse of Object(void) - public ApiResponse ConversationsMessagesIdDeleteWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling ConversationsApi->ConversationsMessagesIdDelete"); - - var localVarPath = "./conversations/messages/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("ConversationsMessagesIdDelete", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete a message sent by an agent Only agents’ messages can be deleted. - /// - /// Thrown when fails to make API call - /// ID of the message - /// Task of void - public async System.Threading.Tasks.Task ConversationsMessagesIdDeleteAsync (string id) - { - await ConversationsMessagesIdDeleteAsyncWithHttpInfo(id); - - } - - /// - /// Delete a message sent by an agent Only agents’ messages can be deleted. - /// - /// Thrown when fails to make API call - /// ID of the message - /// Task of ApiResponse - public async System.Threading.Tasks.Task> ConversationsMessagesIdDeleteAsyncWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling ConversationsApi->ConversationsMessagesIdDelete"); - - var localVarPath = "./conversations/messages/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("ConversationsMessagesIdDelete", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Get a message - /// - /// Thrown when fails to make API call - /// ID of the message - /// ConversationsMessage - public ConversationsMessage ConversationsMessagesIdGet (string id) - { - ApiResponse localVarResponse = ConversationsMessagesIdGetWithHttpInfo(id); - return localVarResponse.Data; - } - - /// - /// Get a message - /// - /// Thrown when fails to make API call - /// ID of the message - /// ApiResponse of ConversationsMessage - public ApiResponse< ConversationsMessage > ConversationsMessagesIdGetWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling ConversationsApi->ConversationsMessagesIdGet"); - - var localVarPath = "./conversations/messages/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("ConversationsMessagesIdGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (ConversationsMessage) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ConversationsMessage))); - } - - /// - /// Get a message - /// - /// Thrown when fails to make API call - /// ID of the message - /// Task of ConversationsMessage - public async System.Threading.Tasks.Task ConversationsMessagesIdGetAsync (string id) - { - ApiResponse localVarResponse = await ConversationsMessagesIdGetAsyncWithHttpInfo(id); - return localVarResponse.Data; - - } - - /// - /// Get a message - /// - /// Thrown when fails to make API call - /// ID of the message - /// Task of ApiResponse (ConversationsMessage) - public async System.Threading.Tasks.Task> ConversationsMessagesIdGetAsyncWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling ConversationsApi->ConversationsMessagesIdGet"); - - var localVarPath = "./conversations/messages/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("ConversationsMessagesIdGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (ConversationsMessage) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ConversationsMessage))); - } - - /// - /// Update a message sent by an agent Only agents’ messages can be edited. - /// - /// Thrown when fails to make API call - /// ID of the message - /// (optional) - /// ConversationsMessage - public ConversationsMessage ConversationsMessagesIdPut (string id, Body9 body = null) - { - ApiResponse localVarResponse = ConversationsMessagesIdPutWithHttpInfo(id, body); - return localVarResponse.Data; - } - - /// - /// Update a message sent by an agent Only agents’ messages can be edited. - /// - /// Thrown when fails to make API call - /// ID of the message - /// (optional) - /// ApiResponse of ConversationsMessage - public ApiResponse< ConversationsMessage > ConversationsMessagesIdPutWithHttpInfo (string id, Body9 body = null) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling ConversationsApi->ConversationsMessagesIdPut"); - - var localVarPath = "./conversations/messages/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("ConversationsMessagesIdPut", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (ConversationsMessage) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ConversationsMessage))); - } - - /// - /// Update a message sent by an agent Only agents’ messages can be edited. - /// - /// Thrown when fails to make API call - /// ID of the message - /// (optional) - /// Task of ConversationsMessage - public async System.Threading.Tasks.Task ConversationsMessagesIdPutAsync (string id, Body9 body = null) - { - ApiResponse localVarResponse = await ConversationsMessagesIdPutAsyncWithHttpInfo(id, body); - return localVarResponse.Data; - - } - - /// - /// Update a message sent by an agent Only agents’ messages can be edited. - /// - /// Thrown when fails to make API call - /// ID of the message - /// (optional) - /// Task of ApiResponse (ConversationsMessage) - public async System.Threading.Tasks.Task> ConversationsMessagesIdPutAsyncWithHttpInfo (string id, Body9 body = null) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling ConversationsApi->ConversationsMessagesIdPut"); - - var localVarPath = "./conversations/messages/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("ConversationsMessagesIdPut", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (ConversationsMessage) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ConversationsMessage))); - } - - /// - /// Send a message as an agent - /// - /// Thrown when fails to make API call - /// Message fields. - /// ConversationsMessage - public ConversationsMessage ConversationsMessagesPost (Body8 body) - { - ApiResponse localVarResponse = ConversationsMessagesPostWithHttpInfo(body); - return localVarResponse.Data; - } - - /// - /// Send a message as an agent - /// - /// Thrown when fails to make API call - /// Message fields. - /// ApiResponse of ConversationsMessage - public ApiResponse< ConversationsMessage > ConversationsMessagesPostWithHttpInfo (Body8 body) - { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling ConversationsApi->ConversationsMessagesPost"); - - var localVarPath = "./conversations/messages"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("ConversationsMessagesPost", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (ConversationsMessage) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ConversationsMessage))); - } - - /// - /// Send a message as an agent - /// - /// Thrown when fails to make API call - /// Message fields. - /// Task of ConversationsMessage - public async System.Threading.Tasks.Task ConversationsMessagesPostAsync (Body8 body) - { - ApiResponse localVarResponse = await ConversationsMessagesPostAsyncWithHttpInfo(body); - return localVarResponse.Data; - - } - - /// - /// Send a message as an agent - /// - /// Thrown when fails to make API call - /// Message fields. - /// Task of ApiResponse (ConversationsMessage) - public async System.Threading.Tasks.Task> ConversationsMessagesPostAsyncWithHttpInfo (Body8 body) - { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling ConversationsApi->ConversationsMessagesPost"); - - var localVarPath = "./conversations/messages"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("ConversationsMessagesPost", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (ConversationsMessage) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ConversationsMessage))); - } - - /// - /// Delete an automated message - /// - /// Thrown when fails to make API call - /// ID of the message - /// - public void ConversationsPushedMessagesIdDelete (string id) - { - ConversationsPushedMessagesIdDeleteWithHttpInfo(id); - } - - /// - /// Delete an automated message - /// - /// Thrown when fails to make API call - /// ID of the message - /// ApiResponse of Object(void) - public ApiResponse ConversationsPushedMessagesIdDeleteWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling ConversationsApi->ConversationsPushedMessagesIdDelete"); - - var localVarPath = "./conversations/pushedMessages/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("ConversationsPushedMessagesIdDelete", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete an automated message - /// - /// Thrown when fails to make API call - /// ID of the message - /// Task of void - public async System.Threading.Tasks.Task ConversationsPushedMessagesIdDeleteAsync (string id) - { - await ConversationsPushedMessagesIdDeleteAsyncWithHttpInfo(id); - - } - - /// - /// Delete an automated message - /// - /// Thrown when fails to make API call - /// ID of the message - /// Task of ApiResponse - public async System.Threading.Tasks.Task> ConversationsPushedMessagesIdDeleteAsyncWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling ConversationsApi->ConversationsPushedMessagesIdDelete"); - - var localVarPath = "./conversations/pushedMessages/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("ConversationsPushedMessagesIdDelete", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Get an automated message - /// - /// Thrown when fails to make API call - /// ID of the message sent previously - /// ConversationsMessage - public ConversationsMessage ConversationsPushedMessagesIdGet (string id) - { - ApiResponse localVarResponse = ConversationsPushedMessagesIdGetWithHttpInfo(id); - return localVarResponse.Data; - } - - /// - /// Get an automated message - /// - /// Thrown when fails to make API call - /// ID of the message sent previously - /// ApiResponse of ConversationsMessage - public ApiResponse< ConversationsMessage > ConversationsPushedMessagesIdGetWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling ConversationsApi->ConversationsPushedMessagesIdGet"); - - var localVarPath = "./conversations/pushedMessages/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("ConversationsPushedMessagesIdGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (ConversationsMessage) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ConversationsMessage))); - } - - /// - /// Get an automated message - /// - /// Thrown when fails to make API call - /// ID of the message sent previously - /// Task of ConversationsMessage - public async System.Threading.Tasks.Task ConversationsPushedMessagesIdGetAsync (string id) - { - ApiResponse localVarResponse = await ConversationsPushedMessagesIdGetAsyncWithHttpInfo(id); - return localVarResponse.Data; - - } - - /// - /// Get an automated message - /// - /// Thrown when fails to make API call - /// ID of the message sent previously - /// Task of ApiResponse (ConversationsMessage) - public async System.Threading.Tasks.Task> ConversationsPushedMessagesIdGetAsyncWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling ConversationsApi->ConversationsPushedMessagesIdGet"); - - var localVarPath = "./conversations/pushedMessages/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("ConversationsPushedMessagesIdGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (ConversationsMessage) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ConversationsMessage))); - } - - /// - /// Update an automated message - /// - /// Thrown when fails to make API call - /// ID of the message - /// - /// ConversationsMessage - public ConversationsMessage ConversationsPushedMessagesIdPut (string id, Body11 body) - { - ApiResponse localVarResponse = ConversationsPushedMessagesIdPutWithHttpInfo(id, body); - return localVarResponse.Data; - } - - /// - /// Update an automated message - /// - /// Thrown when fails to make API call - /// ID of the message - /// - /// ApiResponse of ConversationsMessage - public ApiResponse< ConversationsMessage > ConversationsPushedMessagesIdPutWithHttpInfo (string id, Body11 body) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling ConversationsApi->ConversationsPushedMessagesIdPut"); - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling ConversationsApi->ConversationsPushedMessagesIdPut"); - - var localVarPath = "./conversations/pushedMessages/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("ConversationsPushedMessagesIdPut", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (ConversationsMessage) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ConversationsMessage))); - } - - /// - /// Update an automated message - /// - /// Thrown when fails to make API call - /// ID of the message - /// - /// Task of ConversationsMessage - public async System.Threading.Tasks.Task ConversationsPushedMessagesIdPutAsync (string id, Body11 body) - { - ApiResponse localVarResponse = await ConversationsPushedMessagesIdPutAsyncWithHttpInfo(id, body); - return localVarResponse.Data; - - } - - /// - /// Update an automated message - /// - /// Thrown when fails to make API call - /// ID of the message - /// - /// Task of ApiResponse (ConversationsMessage) - public async System.Threading.Tasks.Task> ConversationsPushedMessagesIdPutAsyncWithHttpInfo (string id, Body11 body) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling ConversationsApi->ConversationsPushedMessagesIdPut"); - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling ConversationsApi->ConversationsPushedMessagesIdPut"); - - var localVarPath = "./conversations/pushedMessages/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("ConversationsPushedMessagesIdPut", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (ConversationsMessage) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ConversationsMessage))); - } - - /// - /// Send an automated message to a visitor Example of automated messages: order status, announce new features in your web app, etc. - /// - /// Thrown when fails to make API call - /// - /// ConversationsMessage - public ConversationsMessage ConversationsPushedMessagesPost (Body10 body) - { - ApiResponse localVarResponse = ConversationsPushedMessagesPostWithHttpInfo(body); - return localVarResponse.Data; - } - - /// - /// Send an automated message to a visitor Example of automated messages: order status, announce new features in your web app, etc. - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of ConversationsMessage - public ApiResponse< ConversationsMessage > ConversationsPushedMessagesPostWithHttpInfo (Body10 body) - { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling ConversationsApi->ConversationsPushedMessagesPost"); - - var localVarPath = "./conversations/pushedMessages"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("ConversationsPushedMessagesPost", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (ConversationsMessage) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ConversationsMessage))); - } - - /// - /// Send an automated message to a visitor Example of automated messages: order status, announce new features in your web app, etc. - /// - /// Thrown when fails to make API call - /// - /// Task of ConversationsMessage - public async System.Threading.Tasks.Task ConversationsPushedMessagesPostAsync (Body10 body) - { - ApiResponse localVarResponse = await ConversationsPushedMessagesPostAsyncWithHttpInfo(body); - return localVarResponse.Data; - - } - - /// - /// Send an automated message to a visitor Example of automated messages: order status, announce new features in your web app, etc. - /// - /// Thrown when fails to make API call - /// - /// Task of ApiResponse (ConversationsMessage) - public async System.Threading.Tasks.Task> ConversationsPushedMessagesPostAsyncWithHttpInfo (Body10 body) - { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling ConversationsApi->ConversationsPushedMessagesPost"); - - var localVarPath = "./conversations/pushedMessages"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("ConversationsPushedMessagesPost", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (ConversationsMessage) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ConversationsMessage))); - } - - } -} diff --git a/src/sib_api_v3_sdk/Api/DealsApi.cs b/src/sib_api_v3_sdk/Api/DealsApi.cs deleted file mode 100644 index 5af8683..0000000 --- a/src/sib_api_v3_sdk/Api/DealsApi.cs +++ /dev/null @@ -1,1796 +0,0 @@ -/* - * SendinBlue API - * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :- -- -- -- -- -- --: | - -- -- -- -- -- -- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | - * - * OpenAPI spec version: 3.0.0 - * Contact: contact@sendinblue.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using RestSharp.Portable; -using sib_api_v3_sdk.Client; -using sib_api_v3_sdk.Model; - -namespace sib_api_v3_sdk.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IDealsApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Get deal attributes - /// - /// - /// - /// - /// Thrown when fails to make API call - /// DealAttributes - DealAttributes CrmAttributesDealsGet (); - - /// - /// Get deal attributes - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ApiResponse of DealAttributes - ApiResponse CrmAttributesDealsGetWithHttpInfo (); - /// - /// Get all deals - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter by attrbutes. If you have filter for owner on your side please send it as `attributes.owner`." (optional) - /// Filter by linked companies ids (optional) - /// Filter by linked companies ids (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// The field used to sort field names. (optional) - /// DealsList - DealsList CrmDealsGet (string filtersAttributes = null, string filtersLinkedCompaniesIds = null, string filtersLinkedContactsIds = null, long? offset = null, long? limit = null, string sort = null, string sortBy = null); - - /// - /// Get all deals - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter by attrbutes. If you have filter for owner on your side please send it as `attributes.owner`." (optional) - /// Filter by linked companies ids (optional) - /// Filter by linked companies ids (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// The field used to sort field names. (optional) - /// ApiResponse of DealsList - ApiResponse CrmDealsGetWithHttpInfo (string filtersAttributes = null, string filtersLinkedCompaniesIds = null, string filtersLinkedContactsIds = null, long? offset = null, long? limit = null, string sort = null, string sortBy = null); - /// - /// Delete a deal - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - void CrmDealsIdDelete (string id); - - /// - /// Delete a deal - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object(void) - ApiResponse CrmDealsIdDeleteWithHttpInfo (string id); - /// - /// Get a deal - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Deal - Deal CrmDealsIdGet (string id); - - /// - /// Get a deal - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Deal - ApiResponse CrmDealsIdGetWithHttpInfo (string id); - /// - /// Update a deal - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Updated deal details. - /// - void CrmDealsIdPatch (string id, Body4 body); - - /// - /// Update a deal - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Updated deal details. - /// ApiResponse of Object(void) - ApiResponse CrmDealsIdPatchWithHttpInfo (string id, Body4 body); - /// - /// Link and Unlink a deal with contacts and companies - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Linked / Unlinked contacts and companies ids. - /// - void CrmDealsLinkUnlinkIdPatch (string id, Body5 body); - - /// - /// Link and Unlink a deal with contacts and companies - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Linked / Unlinked contacts and companies ids. - /// ApiResponse of Object(void) - ApiResponse CrmDealsLinkUnlinkIdPatchWithHttpInfo (string id, Body5 body); - /// - /// Create a deal - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Deal create data. - /// InlineResponse201 - InlineResponse201 CrmDealsPost (Body3 body); - - /// - /// Create a deal - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Deal create data. - /// ApiResponse of InlineResponse201 - ApiResponse CrmDealsPostWithHttpInfo (Body3 body); - /// - /// Get pipeline stages - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Pipeline - Pipeline CrmPipelineDetailsGet (); - - /// - /// Get pipeline stages - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ApiResponse of Pipeline - ApiResponse CrmPipelineDetailsGetWithHttpInfo (); - #endregion Synchronous Operations - #region Asynchronous Operations - /// - /// Get deal attributes - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Task of DealAttributes - System.Threading.Tasks.Task CrmAttributesDealsGetAsync (); - - /// - /// Get deal attributes - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Task of ApiResponse (DealAttributes) - System.Threading.Tasks.Task> CrmAttributesDealsGetAsyncWithHttpInfo (); - /// - /// Get all deals - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter by attrbutes. If you have filter for owner on your side please send it as `attributes.owner`." (optional) - /// Filter by linked companies ids (optional) - /// Filter by linked companies ids (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// The field used to sort field names. (optional) - /// Task of DealsList - System.Threading.Tasks.Task CrmDealsGetAsync (string filtersAttributes = null, string filtersLinkedCompaniesIds = null, string filtersLinkedContactsIds = null, long? offset = null, long? limit = null, string sort = null, string sortBy = null); - - /// - /// Get all deals - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter by attrbutes. If you have filter for owner on your side please send it as `attributes.owner`." (optional) - /// Filter by linked companies ids (optional) - /// Filter by linked companies ids (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// The field used to sort field names. (optional) - /// Task of ApiResponse (DealsList) - System.Threading.Tasks.Task> CrmDealsGetAsyncWithHttpInfo (string filtersAttributes = null, string filtersLinkedCompaniesIds = null, string filtersLinkedContactsIds = null, long? offset = null, long? limit = null, string sort = null, string sortBy = null); - /// - /// Delete a deal - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Task of void - System.Threading.Tasks.Task CrmDealsIdDeleteAsync (string id); - - /// - /// Delete a deal - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Task of ApiResponse - System.Threading.Tasks.Task> CrmDealsIdDeleteAsyncWithHttpInfo (string id); - /// - /// Get a deal - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Task of Deal - System.Threading.Tasks.Task CrmDealsIdGetAsync (string id); - - /// - /// Get a deal - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Task of ApiResponse (Deal) - System.Threading.Tasks.Task> CrmDealsIdGetAsyncWithHttpInfo (string id); - /// - /// Update a deal - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Updated deal details. - /// Task of void - System.Threading.Tasks.Task CrmDealsIdPatchAsync (string id, Body4 body); - - /// - /// Update a deal - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Updated deal details. - /// Task of ApiResponse - System.Threading.Tasks.Task> CrmDealsIdPatchAsyncWithHttpInfo (string id, Body4 body); - /// - /// Link and Unlink a deal with contacts and companies - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Linked / Unlinked contacts and companies ids. - /// Task of void - System.Threading.Tasks.Task CrmDealsLinkUnlinkIdPatchAsync (string id, Body5 body); - - /// - /// Link and Unlink a deal with contacts and companies - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Linked / Unlinked contacts and companies ids. - /// Task of ApiResponse - System.Threading.Tasks.Task> CrmDealsLinkUnlinkIdPatchAsyncWithHttpInfo (string id, Body5 body); - /// - /// Create a deal - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Deal create data. - /// Task of InlineResponse201 - System.Threading.Tasks.Task CrmDealsPostAsync (Body3 body); - - /// - /// Create a deal - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Deal create data. - /// Task of ApiResponse (InlineResponse201) - System.Threading.Tasks.Task> CrmDealsPostAsyncWithHttpInfo (Body3 body); - /// - /// Get pipeline stages - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Task of Pipeline - System.Threading.Tasks.Task CrmPipelineDetailsGetAsync (); - - /// - /// Get pipeline stages - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Task of ApiResponse (Pipeline) - System.Threading.Tasks.Task> CrmPipelineDetailsGetAsyncWithHttpInfo (); - #endregion Asynchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public partial class DealsApi : IDealsApi - { - private sib_api_v3_sdk.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// - /// - public DealsApi(String basePath) - { - this.Configuration = new sib_api_v3_sdk.Client.Configuration { BasePath = basePath }; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using Configuration object - /// - /// An instance of Configuration - /// - public DealsApi(sib_api_v3_sdk.Client.Configuration configuration = null) - { - if (configuration == null) // use the default one in Configuration - this.Configuration = sib_api_v3_sdk.Client.Configuration.Default; - else - this.Configuration = configuration; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] - public void SetBasePath(String basePath) - { - // do nothing - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public sib_api_v3_sdk.Client.Configuration Configuration {get; set;} - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public sib_api_v3_sdk.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - /// - /// Gets the default header. - /// - /// Dictionary of HTTP header - [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] - public IDictionary DefaultHeader() - { - return new ReadOnlyDictionary(this.Configuration.DefaultHeader); - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] - public void AddDefaultHeader(string key, string value) - { - this.Configuration.AddDefaultHeader(key, value); - } - - /// - /// Get deal attributes - /// - /// Thrown when fails to make API call - /// DealAttributes - public DealAttributes CrmAttributesDealsGet () - { - ApiResponse localVarResponse = CrmAttributesDealsGetWithHttpInfo(); - return localVarResponse.Data; - } - - /// - /// Get deal attributes - /// - /// Thrown when fails to make API call - /// ApiResponse of DealAttributes - public ApiResponse< DealAttributes > CrmAttributesDealsGetWithHttpInfo () - { - - var localVarPath = "./crm/attributes/deals"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmAttributesDealsGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (DealAttributes) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(DealAttributes))); - } - - /// - /// Get deal attributes - /// - /// Thrown when fails to make API call - /// Task of DealAttributes - public async System.Threading.Tasks.Task CrmAttributesDealsGetAsync () - { - ApiResponse localVarResponse = await CrmAttributesDealsGetAsyncWithHttpInfo(); - return localVarResponse.Data; - - } - - /// - /// Get deal attributes - /// - /// Thrown when fails to make API call - /// Task of ApiResponse (DealAttributes) - public async System.Threading.Tasks.Task> CrmAttributesDealsGetAsyncWithHttpInfo () - { - - var localVarPath = "./crm/attributes/deals"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmAttributesDealsGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (DealAttributes) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(DealAttributes))); - } - - /// - /// Get all deals - /// - /// Thrown when fails to make API call - /// Filter by attrbutes. If you have filter for owner on your side please send it as `attributes.owner`." (optional) - /// Filter by linked companies ids (optional) - /// Filter by linked companies ids (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// The field used to sort field names. (optional) - /// DealsList - public DealsList CrmDealsGet (string filtersAttributes = null, string filtersLinkedCompaniesIds = null, string filtersLinkedContactsIds = null, long? offset = null, long? limit = null, string sort = null, string sortBy = null) - { - ApiResponse localVarResponse = CrmDealsGetWithHttpInfo(filtersAttributes, filtersLinkedCompaniesIds, filtersLinkedContactsIds, offset, limit, sort, sortBy); - return localVarResponse.Data; - } - - /// - /// Get all deals - /// - /// Thrown when fails to make API call - /// Filter by attrbutes. If you have filter for owner on your side please send it as `attributes.owner`." (optional) - /// Filter by linked companies ids (optional) - /// Filter by linked companies ids (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// The field used to sort field names. (optional) - /// ApiResponse of DealsList - public ApiResponse< DealsList > CrmDealsGetWithHttpInfo (string filtersAttributes = null, string filtersLinkedCompaniesIds = null, string filtersLinkedContactsIds = null, long? offset = null, long? limit = null, string sort = null, string sortBy = null) - { - - var localVarPath = "./crm/deals"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (filtersAttributes != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "filters[attributes]", filtersAttributes)); // query parameter - if (filtersLinkedCompaniesIds != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "filters[linkedCompaniesIds]", filtersLinkedCompaniesIds)); // query parameter - if (filtersLinkedContactsIds != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "filters[linkedContactsIds]", filtersLinkedContactsIds)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - if (sortBy != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sortBy", sortBy)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmDealsGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (DealsList) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(DealsList))); - } - - /// - /// Get all deals - /// - /// Thrown when fails to make API call - /// Filter by attrbutes. If you have filter for owner on your side please send it as `attributes.owner`." (optional) - /// Filter by linked companies ids (optional) - /// Filter by linked companies ids (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// The field used to sort field names. (optional) - /// Task of DealsList - public async System.Threading.Tasks.Task CrmDealsGetAsync (string filtersAttributes = null, string filtersLinkedCompaniesIds = null, string filtersLinkedContactsIds = null, long? offset = null, long? limit = null, string sort = null, string sortBy = null) - { - ApiResponse localVarResponse = await CrmDealsGetAsyncWithHttpInfo(filtersAttributes, filtersLinkedCompaniesIds, filtersLinkedContactsIds, offset, limit, sort, sortBy); - return localVarResponse.Data; - - } - - /// - /// Get all deals - /// - /// Thrown when fails to make API call - /// Filter by attrbutes. If you have filter for owner on your side please send it as `attributes.owner`." (optional) - /// Filter by linked companies ids (optional) - /// Filter by linked companies ids (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// The field used to sort field names. (optional) - /// Task of ApiResponse (DealsList) - public async System.Threading.Tasks.Task> CrmDealsGetAsyncWithHttpInfo (string filtersAttributes = null, string filtersLinkedCompaniesIds = null, string filtersLinkedContactsIds = null, long? offset = null, long? limit = null, string sort = null, string sortBy = null) - { - - var localVarPath = "./crm/deals"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (filtersAttributes != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "filters[attributes]", filtersAttributes)); // query parameter - if (filtersLinkedCompaniesIds != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "filters[linkedCompaniesIds]", filtersLinkedCompaniesIds)); // query parameter - if (filtersLinkedContactsIds != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "filters[linkedContactsIds]", filtersLinkedContactsIds)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - if (sortBy != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sortBy", sortBy)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmDealsGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (DealsList) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(DealsList))); - } - - /// - /// Delete a deal - /// - /// Thrown when fails to make API call - /// - /// - public void CrmDealsIdDelete (string id) - { - CrmDealsIdDeleteWithHttpInfo(id); - } - - /// - /// Delete a deal - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object(void) - public ApiResponse CrmDealsIdDeleteWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling DealsApi->CrmDealsIdDelete"); - - var localVarPath = "./crm/deals/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmDealsIdDelete", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete a deal - /// - /// Thrown when fails to make API call - /// - /// Task of void - public async System.Threading.Tasks.Task CrmDealsIdDeleteAsync (string id) - { - await CrmDealsIdDeleteAsyncWithHttpInfo(id); - - } - - /// - /// Delete a deal - /// - /// Thrown when fails to make API call - /// - /// Task of ApiResponse - public async System.Threading.Tasks.Task> CrmDealsIdDeleteAsyncWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling DealsApi->CrmDealsIdDelete"); - - var localVarPath = "./crm/deals/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmDealsIdDelete", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Get a deal - /// - /// Thrown when fails to make API call - /// - /// Deal - public Deal CrmDealsIdGet (string id) - { - ApiResponse localVarResponse = CrmDealsIdGetWithHttpInfo(id); - return localVarResponse.Data; - } - - /// - /// Get a deal - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Deal - public ApiResponse< Deal > CrmDealsIdGetWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling DealsApi->CrmDealsIdGet"); - - var localVarPath = "./crm/deals/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmDealsIdGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (Deal) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Deal))); - } - - /// - /// Get a deal - /// - /// Thrown when fails to make API call - /// - /// Task of Deal - public async System.Threading.Tasks.Task CrmDealsIdGetAsync (string id) - { - ApiResponse localVarResponse = await CrmDealsIdGetAsyncWithHttpInfo(id); - return localVarResponse.Data; - - } - - /// - /// Get a deal - /// - /// Thrown when fails to make API call - /// - /// Task of ApiResponse (Deal) - public async System.Threading.Tasks.Task> CrmDealsIdGetAsyncWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling DealsApi->CrmDealsIdGet"); - - var localVarPath = "./crm/deals/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmDealsIdGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (Deal) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Deal))); - } - - /// - /// Update a deal - /// - /// Thrown when fails to make API call - /// - /// Updated deal details. - /// - public void CrmDealsIdPatch (string id, Body4 body) - { - CrmDealsIdPatchWithHttpInfo(id, body); - } - - /// - /// Update a deal - /// - /// Thrown when fails to make API call - /// - /// Updated deal details. - /// ApiResponse of Object(void) - public ApiResponse CrmDealsIdPatchWithHttpInfo (string id, Body4 body) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling DealsApi->CrmDealsIdPatch"); - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling DealsApi->CrmDealsIdPatch"); - - var localVarPath = "./crm/deals/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmDealsIdPatch", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Update a deal - /// - /// Thrown when fails to make API call - /// - /// Updated deal details. - /// Task of void - public async System.Threading.Tasks.Task CrmDealsIdPatchAsync (string id, Body4 body) - { - await CrmDealsIdPatchAsyncWithHttpInfo(id, body); - - } - - /// - /// Update a deal - /// - /// Thrown when fails to make API call - /// - /// Updated deal details. - /// Task of ApiResponse - public async System.Threading.Tasks.Task> CrmDealsIdPatchAsyncWithHttpInfo (string id, Body4 body) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling DealsApi->CrmDealsIdPatch"); - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling DealsApi->CrmDealsIdPatch"); - - var localVarPath = "./crm/deals/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmDealsIdPatch", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Link and Unlink a deal with contacts and companies - /// - /// Thrown when fails to make API call - /// - /// Linked / Unlinked contacts and companies ids. - /// - public void CrmDealsLinkUnlinkIdPatch (string id, Body5 body) - { - CrmDealsLinkUnlinkIdPatchWithHttpInfo(id, body); - } - - /// - /// Link and Unlink a deal with contacts and companies - /// - /// Thrown when fails to make API call - /// - /// Linked / Unlinked contacts and companies ids. - /// ApiResponse of Object(void) - public ApiResponse CrmDealsLinkUnlinkIdPatchWithHttpInfo (string id, Body5 body) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling DealsApi->CrmDealsLinkUnlinkIdPatch"); - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling DealsApi->CrmDealsLinkUnlinkIdPatch"); - - var localVarPath = "./crm/deals/link-unlink/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmDealsLinkUnlinkIdPatch", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Link and Unlink a deal with contacts and companies - /// - /// Thrown when fails to make API call - /// - /// Linked / Unlinked contacts and companies ids. - /// Task of void - public async System.Threading.Tasks.Task CrmDealsLinkUnlinkIdPatchAsync (string id, Body5 body) - { - await CrmDealsLinkUnlinkIdPatchAsyncWithHttpInfo(id, body); - - } - - /// - /// Link and Unlink a deal with contacts and companies - /// - /// Thrown when fails to make API call - /// - /// Linked / Unlinked contacts and companies ids. - /// Task of ApiResponse - public async System.Threading.Tasks.Task> CrmDealsLinkUnlinkIdPatchAsyncWithHttpInfo (string id, Body5 body) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling DealsApi->CrmDealsLinkUnlinkIdPatch"); - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling DealsApi->CrmDealsLinkUnlinkIdPatch"); - - var localVarPath = "./crm/deals/link-unlink/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmDealsLinkUnlinkIdPatch", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Create a deal - /// - /// Thrown when fails to make API call - /// Deal create data. - /// InlineResponse201 - public InlineResponse201 CrmDealsPost (Body3 body) - { - ApiResponse localVarResponse = CrmDealsPostWithHttpInfo(body); - return localVarResponse.Data; - } - - /// - /// Create a deal - /// - /// Thrown when fails to make API call - /// Deal create data. - /// ApiResponse of InlineResponse201 - public ApiResponse< InlineResponse201 > CrmDealsPostWithHttpInfo (Body3 body) - { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling DealsApi->CrmDealsPost"); - - var localVarPath = "./crm/deals"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmDealsPost", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (InlineResponse201) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse201))); - } - - /// - /// Create a deal - /// - /// Thrown when fails to make API call - /// Deal create data. - /// Task of InlineResponse201 - public async System.Threading.Tasks.Task CrmDealsPostAsync (Body3 body) - { - ApiResponse localVarResponse = await CrmDealsPostAsyncWithHttpInfo(body); - return localVarResponse.Data; - - } - - /// - /// Create a deal - /// - /// Thrown when fails to make API call - /// Deal create data. - /// Task of ApiResponse (InlineResponse201) - public async System.Threading.Tasks.Task> CrmDealsPostAsyncWithHttpInfo (Body3 body) - { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling DealsApi->CrmDealsPost"); - - var localVarPath = "./crm/deals"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmDealsPost", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (InlineResponse201) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse201))); - } - - /// - /// Get pipeline stages - /// - /// Thrown when fails to make API call - /// Pipeline - public Pipeline CrmPipelineDetailsGet () - { - ApiResponse localVarResponse = CrmPipelineDetailsGetWithHttpInfo(); - return localVarResponse.Data; - } - - /// - /// Get pipeline stages - /// - /// Thrown when fails to make API call - /// ApiResponse of Pipeline - public ApiResponse< Pipeline > CrmPipelineDetailsGetWithHttpInfo () - { - - var localVarPath = "./crm/pipeline/details"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmPipelineDetailsGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (Pipeline) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Pipeline))); - } - - /// - /// Get pipeline stages - /// - /// Thrown when fails to make API call - /// Task of Pipeline - public async System.Threading.Tasks.Task CrmPipelineDetailsGetAsync () - { - ApiResponse localVarResponse = await CrmPipelineDetailsGetAsyncWithHttpInfo(); - return localVarResponse.Data; - - } - - /// - /// Get pipeline stages - /// - /// Thrown when fails to make API call - /// Task of ApiResponse (Pipeline) - public async System.Threading.Tasks.Task> CrmPipelineDetailsGetAsyncWithHttpInfo () - { - - var localVarPath = "./crm/pipeline/details"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmPipelineDetailsGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (Pipeline) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Pipeline))); - } - - } -} diff --git a/src/sib_api_v3_sdk/Api/EcommerceApi.cs b/src/sib_api_v3_sdk/Api/EcommerceApi.cs deleted file mode 100644 index 9a9c2fa..0000000 --- a/src/sib_api_v3_sdk/Api/EcommerceApi.cs +++ /dev/null @@ -1,2407 +0,0 @@ -/* - * SendinBlue API - * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :- -- -- -- -- -- --: | - -- -- -- -- -- -- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | - * - * OpenAPI spec version: 3.0.0 - * Contact: contact@sendinblue.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using RestSharp.Portable; -using sib_api_v3_sdk.Client; -using sib_api_v3_sdk.Model; - -namespace sib_api_v3_sdk.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IEcommerceApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Maintains a batch of orders - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - void CreateBatchOrder (OrderBatch orderBatch); - - /// - /// Maintains a batch of orders - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object(void) - ApiResponse CreateBatchOrderWithHttpInfo (OrderBatch orderBatch); - /// - /// Maintains every transactional status of the order - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - void CreateOrder (Order order); - - /// - /// Maintains every transactional status of the order - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object(void) - ApiResponse CreateOrderWithHttpInfo (Order order); - /// - /// Create the categories in a batch - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create a batch of categories - /// CreateUpdateBatchCategoryModel - CreateUpdateBatchCategoryModel CreateUpdateBatchCategory (CreateUpdateBatchCategory createUpdateBatchCategory); - - /// - /// Create the categories in a batch - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create a batch of categories - /// ApiResponse of CreateUpdateBatchCategoryModel - ApiResponse CreateUpdateBatchCategoryWithHttpInfo (CreateUpdateBatchCategory createUpdateBatchCategory); - /// - /// Creates the products in a batch - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create a batch of products - /// CreateUpdateBatchProductsModel - CreateUpdateBatchProductsModel CreateUpdateBatchProducts (CreateUpdateBatchProducts createUpdateBatchProducts); - - /// - /// Creates the products in a batch - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create a batch of products - /// ApiResponse of CreateUpdateBatchProductsModel - ApiResponse CreateUpdateBatchProductsWithHttpInfo (CreateUpdateBatchProducts createUpdateBatchProducts); - /// - /// Create/Update a category - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create/update a category - /// CreateCategoryModel - CreateCategoryModel CreateUpdateCategory (CreateUpdateCategory createUpdateCategory); - - /// - /// Create/Update a category - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create/update a category - /// ApiResponse of CreateCategoryModel - ApiResponse CreateUpdateCategoryWithHttpInfo (CreateUpdateCategory createUpdateCategory); - /// - /// Create/Update a product - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create/update a product - /// CreateProductModel - CreateProductModel CreateUpdateProduct (CreateUpdateProduct createUpdateProduct); - - /// - /// Create/Update a product - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create/update a product - /// ApiResponse of CreateProductModel - ApiResponse CreateUpdateProductWithHttpInfo (CreateUpdateProduct createUpdateProduct); - /// - /// **Fulfills the eCommerce pre-requisites** - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - void EcommerceActivatePost (); - - /// - /// **Fulfills the eCommerce pre-requisites** - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ApiResponse of Object(void) - ApiResponse EcommerceActivatePostWithHttpInfo (); - /// - /// Return all your categories - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Filter by category ids (optional) - /// GetCategories - GetCategories GetCategories (long? limit = null, long? offset = null, string sort = null, List ids = null); - - /// - /// Return all your categories - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Filter by category ids (optional) - /// ApiResponse of GetCategories - ApiResponse GetCategoriesWithHttpInfo (long? limit = null, long? offset = null, string sort = null, List ids = null); - /// - /// Get a category details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Category ID - /// GetCategoryDetails - GetCategoryDetails GetCategoryInfo (string id); - - /// - /// Get a category details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Category ID - /// ApiResponse of GetCategoryDetails - ApiResponse GetCategoryInfoWithHttpInfo (string id); - /// - /// Get a product's details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Product ID - /// GetProductDetails - GetProductDetails GetProductInfo (string id); - - /// - /// Get a product's details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Product ID - /// ApiResponse of GetProductDetails - ApiResponse GetProductInfoWithHttpInfo (string id); - /// - /// Return all your products - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Filter by product ids (optional) - /// GetProducts - GetProducts GetProducts (long? limit = null, long? offset = null, string sort = null, List ids = null); - - /// - /// Return all your products - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Filter by product ids (optional) - /// ApiResponse of GetProducts - ApiResponse GetProductsWithHttpInfo (long? limit = null, long? offset = null, string sort = null, List ids = null); - #endregion Synchronous Operations - #region Asynchronous Operations - /// - /// Maintains a batch of orders - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Task of void - System.Threading.Tasks.Task CreateBatchOrderAsync (OrderBatch orderBatch); - - /// - /// Maintains a batch of orders - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Task of ApiResponse - System.Threading.Tasks.Task> CreateBatchOrderAsyncWithHttpInfo (OrderBatch orderBatch); - /// - /// Maintains every transactional status of the order - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Task of void - System.Threading.Tasks.Task CreateOrderAsync (Order order); - - /// - /// Maintains every transactional status of the order - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Task of ApiResponse - System.Threading.Tasks.Task> CreateOrderAsyncWithHttpInfo (Order order); - /// - /// Create the categories in a batch - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create a batch of categories - /// Task of CreateUpdateBatchCategoryModel - System.Threading.Tasks.Task CreateUpdateBatchCategoryAsync (CreateUpdateBatchCategory createUpdateBatchCategory); - - /// - /// Create the categories in a batch - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create a batch of categories - /// Task of ApiResponse (CreateUpdateBatchCategoryModel) - System.Threading.Tasks.Task> CreateUpdateBatchCategoryAsyncWithHttpInfo (CreateUpdateBatchCategory createUpdateBatchCategory); - /// - /// Creates the products in a batch - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create a batch of products - /// Task of CreateUpdateBatchProductsModel - System.Threading.Tasks.Task CreateUpdateBatchProductsAsync (CreateUpdateBatchProducts createUpdateBatchProducts); - - /// - /// Creates the products in a batch - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create a batch of products - /// Task of ApiResponse (CreateUpdateBatchProductsModel) - System.Threading.Tasks.Task> CreateUpdateBatchProductsAsyncWithHttpInfo (CreateUpdateBatchProducts createUpdateBatchProducts); - /// - /// Create/Update a category - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create/update a category - /// Task of CreateCategoryModel - System.Threading.Tasks.Task CreateUpdateCategoryAsync (CreateUpdateCategory createUpdateCategory); - - /// - /// Create/Update a category - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create/update a category - /// Task of ApiResponse (CreateCategoryModel) - System.Threading.Tasks.Task> CreateUpdateCategoryAsyncWithHttpInfo (CreateUpdateCategory createUpdateCategory); - /// - /// Create/Update a product - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create/update a product - /// Task of CreateProductModel - System.Threading.Tasks.Task CreateUpdateProductAsync (CreateUpdateProduct createUpdateProduct); - - /// - /// Create/Update a product - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create/update a product - /// Task of ApiResponse (CreateProductModel) - System.Threading.Tasks.Task> CreateUpdateProductAsyncWithHttpInfo (CreateUpdateProduct createUpdateProduct); - /// - /// **Fulfills the eCommerce pre-requisites** - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Task of void - System.Threading.Tasks.Task EcommerceActivatePostAsync (); - - /// - /// **Fulfills the eCommerce pre-requisites** - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Task of ApiResponse - System.Threading.Tasks.Task> EcommerceActivatePostAsyncWithHttpInfo (); - /// - /// Return all your categories - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Filter by category ids (optional) - /// Task of GetCategories - System.Threading.Tasks.Task GetCategoriesAsync (long? limit = null, long? offset = null, string sort = null, List ids = null); - - /// - /// Return all your categories - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Filter by category ids (optional) - /// Task of ApiResponse (GetCategories) - System.Threading.Tasks.Task> GetCategoriesAsyncWithHttpInfo (long? limit = null, long? offset = null, string sort = null, List ids = null); - /// - /// Get a category details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Category ID - /// Task of GetCategoryDetails - System.Threading.Tasks.Task GetCategoryInfoAsync (string id); - - /// - /// Get a category details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Category ID - /// Task of ApiResponse (GetCategoryDetails) - System.Threading.Tasks.Task> GetCategoryInfoAsyncWithHttpInfo (string id); - /// - /// Get a product's details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Product ID - /// Task of GetProductDetails - System.Threading.Tasks.Task GetProductInfoAsync (string id); - - /// - /// Get a product's details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Product ID - /// Task of ApiResponse (GetProductDetails) - System.Threading.Tasks.Task> GetProductInfoAsyncWithHttpInfo (string id); - /// - /// Return all your products - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Filter by product ids (optional) - /// Task of GetProducts - System.Threading.Tasks.Task GetProductsAsync (long? limit = null, long? offset = null, string sort = null, List ids = null); - - /// - /// Return all your products - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Filter by product ids (optional) - /// Task of ApiResponse (GetProducts) - System.Threading.Tasks.Task> GetProductsAsyncWithHttpInfo (long? limit = null, long? offset = null, string sort = null, List ids = null); - #endregion Asynchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public partial class EcommerceApi : IEcommerceApi - { - private sib_api_v3_sdk.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// - /// - public EcommerceApi(String basePath) - { - this.Configuration = new sib_api_v3_sdk.Client.Configuration { BasePath = basePath }; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using Configuration object - /// - /// An instance of Configuration - /// - public EcommerceApi(sib_api_v3_sdk.Client.Configuration configuration = null) - { - if (configuration == null) // use the default one in Configuration - this.Configuration = sib_api_v3_sdk.Client.Configuration.Default; - else - this.Configuration = configuration; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] - public void SetBasePath(String basePath) - { - // do nothing - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public sib_api_v3_sdk.Client.Configuration Configuration {get; set;} - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public sib_api_v3_sdk.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - /// - /// Gets the default header. - /// - /// Dictionary of HTTP header - [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] - public IDictionary DefaultHeader() - { - return new ReadOnlyDictionary(this.Configuration.DefaultHeader); - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] - public void AddDefaultHeader(string key, string value) - { - this.Configuration.AddDefaultHeader(key, value); - } - - /// - /// Maintains a batch of orders - /// - /// Thrown when fails to make API call - /// - /// - public void CreateBatchOrder (OrderBatch orderBatch) - { - CreateBatchOrderWithHttpInfo(orderBatch); - } - - /// - /// Maintains a batch of orders - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object(void) - public ApiResponse CreateBatchOrderWithHttpInfo (OrderBatch orderBatch) - { - // verify the required parameter 'orderBatch' is set - if (orderBatch == null) - throw new ApiException(400, "Missing required parameter 'orderBatch' when calling EcommerceApi->CreateBatchOrder"); - - var localVarPath = "./orders/status/batch"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (orderBatch != null && orderBatch.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(orderBatch); // http body (model) parameter - } - else - { - localVarPostBody = orderBatch; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateBatchOrder", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Maintains a batch of orders - /// - /// Thrown when fails to make API call - /// - /// Task of void - public async System.Threading.Tasks.Task CreateBatchOrderAsync (OrderBatch orderBatch) - { - await CreateBatchOrderAsyncWithHttpInfo(orderBatch); - - } - - /// - /// Maintains a batch of orders - /// - /// Thrown when fails to make API call - /// - /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateBatchOrderAsyncWithHttpInfo (OrderBatch orderBatch) - { - // verify the required parameter 'orderBatch' is set - if (orderBatch == null) - throw new ApiException(400, "Missing required parameter 'orderBatch' when calling EcommerceApi->CreateBatchOrder"); - - var localVarPath = "./orders/status/batch"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (orderBatch != null && orderBatch.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(orderBatch); // http body (model) parameter - } - else - { - localVarPostBody = orderBatch; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateBatchOrder", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Maintains every transactional status of the order - /// - /// Thrown when fails to make API call - /// - /// - public void CreateOrder (Order order) - { - CreateOrderWithHttpInfo(order); - } - - /// - /// Maintains every transactional status of the order - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object(void) - public ApiResponse CreateOrderWithHttpInfo (Order order) - { - // verify the required parameter 'order' is set - if (order == null) - throw new ApiException(400, "Missing required parameter 'order' when calling EcommerceApi->CreateOrder"); - - var localVarPath = "./orders/status"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (order != null && order.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(order); // http body (model) parameter - } - else - { - localVarPostBody = order; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateOrder", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Maintains every transactional status of the order - /// - /// Thrown when fails to make API call - /// - /// Task of void - public async System.Threading.Tasks.Task CreateOrderAsync (Order order) - { - await CreateOrderAsyncWithHttpInfo(order); - - } - - /// - /// Maintains every transactional status of the order - /// - /// Thrown when fails to make API call - /// - /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateOrderAsyncWithHttpInfo (Order order) - { - // verify the required parameter 'order' is set - if (order == null) - throw new ApiException(400, "Missing required parameter 'order' when calling EcommerceApi->CreateOrder"); - - var localVarPath = "./orders/status"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (order != null && order.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(order); // http body (model) parameter - } - else - { - localVarPostBody = order; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateOrder", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Create the categories in a batch - /// - /// Thrown when fails to make API call - /// Values to create a batch of categories - /// CreateUpdateBatchCategoryModel - public CreateUpdateBatchCategoryModel CreateUpdateBatchCategory (CreateUpdateBatchCategory createUpdateBatchCategory) - { - ApiResponse localVarResponse = CreateUpdateBatchCategoryWithHttpInfo(createUpdateBatchCategory); - return localVarResponse.Data; - } - - /// - /// Create the categories in a batch - /// - /// Thrown when fails to make API call - /// Values to create a batch of categories - /// ApiResponse of CreateUpdateBatchCategoryModel - public ApiResponse< CreateUpdateBatchCategoryModel > CreateUpdateBatchCategoryWithHttpInfo (CreateUpdateBatchCategory createUpdateBatchCategory) - { - // verify the required parameter 'createUpdateBatchCategory' is set - if (createUpdateBatchCategory == null) - throw new ApiException(400, "Missing required parameter 'createUpdateBatchCategory' when calling EcommerceApi->CreateUpdateBatchCategory"); - - var localVarPath = "./categories/batch"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (createUpdateBatchCategory != null && createUpdateBatchCategory.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(createUpdateBatchCategory); // http body (model) parameter - } - else - { - localVarPostBody = createUpdateBatchCategory; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateUpdateBatchCategory", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateUpdateBatchCategoryModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateUpdateBatchCategoryModel))); - } - - /// - /// Create the categories in a batch - /// - /// Thrown when fails to make API call - /// Values to create a batch of categories - /// Task of CreateUpdateBatchCategoryModel - public async System.Threading.Tasks.Task CreateUpdateBatchCategoryAsync (CreateUpdateBatchCategory createUpdateBatchCategory) - { - ApiResponse localVarResponse = await CreateUpdateBatchCategoryAsyncWithHttpInfo(createUpdateBatchCategory); - return localVarResponse.Data; - - } - - /// - /// Create the categories in a batch - /// - /// Thrown when fails to make API call - /// Values to create a batch of categories - /// Task of ApiResponse (CreateUpdateBatchCategoryModel) - public async System.Threading.Tasks.Task> CreateUpdateBatchCategoryAsyncWithHttpInfo (CreateUpdateBatchCategory createUpdateBatchCategory) - { - // verify the required parameter 'createUpdateBatchCategory' is set - if (createUpdateBatchCategory == null) - throw new ApiException(400, "Missing required parameter 'createUpdateBatchCategory' when calling EcommerceApi->CreateUpdateBatchCategory"); - - var localVarPath = "./categories/batch"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (createUpdateBatchCategory != null && createUpdateBatchCategory.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(createUpdateBatchCategory); // http body (model) parameter - } - else - { - localVarPostBody = createUpdateBatchCategory; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateUpdateBatchCategory", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateUpdateBatchCategoryModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateUpdateBatchCategoryModel))); - } - - /// - /// Creates the products in a batch - /// - /// Thrown when fails to make API call - /// Values to create a batch of products - /// CreateUpdateBatchProductsModel - public CreateUpdateBatchProductsModel CreateUpdateBatchProducts (CreateUpdateBatchProducts createUpdateBatchProducts) - { - ApiResponse localVarResponse = CreateUpdateBatchProductsWithHttpInfo(createUpdateBatchProducts); - return localVarResponse.Data; - } - - /// - /// Creates the products in a batch - /// - /// Thrown when fails to make API call - /// Values to create a batch of products - /// ApiResponse of CreateUpdateBatchProductsModel - public ApiResponse< CreateUpdateBatchProductsModel > CreateUpdateBatchProductsWithHttpInfo (CreateUpdateBatchProducts createUpdateBatchProducts) - { - // verify the required parameter 'createUpdateBatchProducts' is set - if (createUpdateBatchProducts == null) - throw new ApiException(400, "Missing required parameter 'createUpdateBatchProducts' when calling EcommerceApi->CreateUpdateBatchProducts"); - - var localVarPath = "./products/batch"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (createUpdateBatchProducts != null && createUpdateBatchProducts.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(createUpdateBatchProducts); // http body (model) parameter - } - else - { - localVarPostBody = createUpdateBatchProducts; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateUpdateBatchProducts", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateUpdateBatchProductsModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateUpdateBatchProductsModel))); - } - - /// - /// Creates the products in a batch - /// - /// Thrown when fails to make API call - /// Values to create a batch of products - /// Task of CreateUpdateBatchProductsModel - public async System.Threading.Tasks.Task CreateUpdateBatchProductsAsync (CreateUpdateBatchProducts createUpdateBatchProducts) - { - ApiResponse localVarResponse = await CreateUpdateBatchProductsAsyncWithHttpInfo(createUpdateBatchProducts); - return localVarResponse.Data; - - } - - /// - /// Creates the products in a batch - /// - /// Thrown when fails to make API call - /// Values to create a batch of products - /// Task of ApiResponse (CreateUpdateBatchProductsModel) - public async System.Threading.Tasks.Task> CreateUpdateBatchProductsAsyncWithHttpInfo (CreateUpdateBatchProducts createUpdateBatchProducts) - { - // verify the required parameter 'createUpdateBatchProducts' is set - if (createUpdateBatchProducts == null) - throw new ApiException(400, "Missing required parameter 'createUpdateBatchProducts' when calling EcommerceApi->CreateUpdateBatchProducts"); - - var localVarPath = "./products/batch"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (createUpdateBatchProducts != null && createUpdateBatchProducts.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(createUpdateBatchProducts); // http body (model) parameter - } - else - { - localVarPostBody = createUpdateBatchProducts; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateUpdateBatchProducts", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateUpdateBatchProductsModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateUpdateBatchProductsModel))); - } - - /// - /// Create/Update a category - /// - /// Thrown when fails to make API call - /// Values to create/update a category - /// CreateCategoryModel - public CreateCategoryModel CreateUpdateCategory (CreateUpdateCategory createUpdateCategory) - { - ApiResponse localVarResponse = CreateUpdateCategoryWithHttpInfo(createUpdateCategory); - return localVarResponse.Data; - } - - /// - /// Create/Update a category - /// - /// Thrown when fails to make API call - /// Values to create/update a category - /// ApiResponse of CreateCategoryModel - public ApiResponse< CreateCategoryModel > CreateUpdateCategoryWithHttpInfo (CreateUpdateCategory createUpdateCategory) - { - // verify the required parameter 'createUpdateCategory' is set - if (createUpdateCategory == null) - throw new ApiException(400, "Missing required parameter 'createUpdateCategory' when calling EcommerceApi->CreateUpdateCategory"); - - var localVarPath = "./categories"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (createUpdateCategory != null && createUpdateCategory.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(createUpdateCategory); // http body (model) parameter - } - else - { - localVarPostBody = createUpdateCategory; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateUpdateCategory", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateCategoryModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateCategoryModel))); - } - - /// - /// Create/Update a category - /// - /// Thrown when fails to make API call - /// Values to create/update a category - /// Task of CreateCategoryModel - public async System.Threading.Tasks.Task CreateUpdateCategoryAsync (CreateUpdateCategory createUpdateCategory) - { - ApiResponse localVarResponse = await CreateUpdateCategoryAsyncWithHttpInfo(createUpdateCategory); - return localVarResponse.Data; - - } - - /// - /// Create/Update a category - /// - /// Thrown when fails to make API call - /// Values to create/update a category - /// Task of ApiResponse (CreateCategoryModel) - public async System.Threading.Tasks.Task> CreateUpdateCategoryAsyncWithHttpInfo (CreateUpdateCategory createUpdateCategory) - { - // verify the required parameter 'createUpdateCategory' is set - if (createUpdateCategory == null) - throw new ApiException(400, "Missing required parameter 'createUpdateCategory' when calling EcommerceApi->CreateUpdateCategory"); - - var localVarPath = "./categories"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (createUpdateCategory != null && createUpdateCategory.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(createUpdateCategory); // http body (model) parameter - } - else - { - localVarPostBody = createUpdateCategory; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateUpdateCategory", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateCategoryModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateCategoryModel))); - } - - /// - /// Create/Update a product - /// - /// Thrown when fails to make API call - /// Values to create/update a product - /// CreateProductModel - public CreateProductModel CreateUpdateProduct (CreateUpdateProduct createUpdateProduct) - { - ApiResponse localVarResponse = CreateUpdateProductWithHttpInfo(createUpdateProduct); - return localVarResponse.Data; - } - - /// - /// Create/Update a product - /// - /// Thrown when fails to make API call - /// Values to create/update a product - /// ApiResponse of CreateProductModel - public ApiResponse< CreateProductModel > CreateUpdateProductWithHttpInfo (CreateUpdateProduct createUpdateProduct) - { - // verify the required parameter 'createUpdateProduct' is set - if (createUpdateProduct == null) - throw new ApiException(400, "Missing required parameter 'createUpdateProduct' when calling EcommerceApi->CreateUpdateProduct"); - - var localVarPath = "./products"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (createUpdateProduct != null && createUpdateProduct.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(createUpdateProduct); // http body (model) parameter - } - else - { - localVarPostBody = createUpdateProduct; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateUpdateProduct", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateProductModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateProductModel))); - } - - /// - /// Create/Update a product - /// - /// Thrown when fails to make API call - /// Values to create/update a product - /// Task of CreateProductModel - public async System.Threading.Tasks.Task CreateUpdateProductAsync (CreateUpdateProduct createUpdateProduct) - { - ApiResponse localVarResponse = await CreateUpdateProductAsyncWithHttpInfo(createUpdateProduct); - return localVarResponse.Data; - - } - - /// - /// Create/Update a product - /// - /// Thrown when fails to make API call - /// Values to create/update a product - /// Task of ApiResponse (CreateProductModel) - public async System.Threading.Tasks.Task> CreateUpdateProductAsyncWithHttpInfo (CreateUpdateProduct createUpdateProduct) - { - // verify the required parameter 'createUpdateProduct' is set - if (createUpdateProduct == null) - throw new ApiException(400, "Missing required parameter 'createUpdateProduct' when calling EcommerceApi->CreateUpdateProduct"); - - var localVarPath = "./products"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (createUpdateProduct != null && createUpdateProduct.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(createUpdateProduct); // http body (model) parameter - } - else - { - localVarPostBody = createUpdateProduct; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateUpdateProduct", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateProductModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateProductModel))); - } - - /// - /// **Fulfills the eCommerce pre-requisites** - /// - /// Thrown when fails to make API call - /// - public void EcommerceActivatePost () - { - EcommerceActivatePostWithHttpInfo(); - } - - /// - /// **Fulfills the eCommerce pre-requisites** - /// - /// Thrown when fails to make API call - /// ApiResponse of Object(void) - public ApiResponse EcommerceActivatePostWithHttpInfo () - { - - var localVarPath = "./ecommerce/activate"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("EcommerceActivatePost", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// **Fulfills the eCommerce pre-requisites** - /// - /// Thrown when fails to make API call - /// Task of void - public async System.Threading.Tasks.Task EcommerceActivatePostAsync () - { - await EcommerceActivatePostAsyncWithHttpInfo(); - - } - - /// - /// **Fulfills the eCommerce pre-requisites** - /// - /// Thrown when fails to make API call - /// Task of ApiResponse - public async System.Threading.Tasks.Task> EcommerceActivatePostAsyncWithHttpInfo () - { - - var localVarPath = "./ecommerce/activate"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("EcommerceActivatePost", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Return all your categories - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Filter by category ids (optional) - /// GetCategories - public GetCategories GetCategories (long? limit = null, long? offset = null, string sort = null, List ids = null) - { - ApiResponse localVarResponse = GetCategoriesWithHttpInfo(limit, offset, sort, ids); - return localVarResponse.Data; - } - - /// - /// Return all your categories - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Filter by category ids (optional) - /// ApiResponse of GetCategories - public ApiResponse< GetCategories > GetCategoriesWithHttpInfo (long? limit = null, long? offset = null, string sort = null, List ids = null) - { - - var localVarPath = "./categories"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - if (ids != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ids", ids)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetCategories", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetCategories) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetCategories))); - } - - /// - /// Return all your categories - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Filter by category ids (optional) - /// Task of GetCategories - public async System.Threading.Tasks.Task GetCategoriesAsync (long? limit = null, long? offset = null, string sort = null, List ids = null) - { - ApiResponse localVarResponse = await GetCategoriesAsyncWithHttpInfo(limit, offset, sort, ids); - return localVarResponse.Data; - - } - - /// - /// Return all your categories - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Filter by category ids (optional) - /// Task of ApiResponse (GetCategories) - public async System.Threading.Tasks.Task> GetCategoriesAsyncWithHttpInfo (long? limit = null, long? offset = null, string sort = null, List ids = null) - { - - var localVarPath = "./categories"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - if (ids != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ids", ids)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetCategories", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetCategories) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetCategories))); - } - - /// - /// Get a category details - /// - /// Thrown when fails to make API call - /// Category ID - /// GetCategoryDetails - public GetCategoryDetails GetCategoryInfo (string id) - { - ApiResponse localVarResponse = GetCategoryInfoWithHttpInfo(id); - return localVarResponse.Data; - } - - /// - /// Get a category details - /// - /// Thrown when fails to make API call - /// Category ID - /// ApiResponse of GetCategoryDetails - public ApiResponse< GetCategoryDetails > GetCategoryInfoWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling EcommerceApi->GetCategoryInfo"); - - var localVarPath = "./categories/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetCategoryInfo", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetCategoryDetails) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetCategoryDetails))); - } - - /// - /// Get a category details - /// - /// Thrown when fails to make API call - /// Category ID - /// Task of GetCategoryDetails - public async System.Threading.Tasks.Task GetCategoryInfoAsync (string id) - { - ApiResponse localVarResponse = await GetCategoryInfoAsyncWithHttpInfo(id); - return localVarResponse.Data; - - } - - /// - /// Get a category details - /// - /// Thrown when fails to make API call - /// Category ID - /// Task of ApiResponse (GetCategoryDetails) - public async System.Threading.Tasks.Task> GetCategoryInfoAsyncWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling EcommerceApi->GetCategoryInfo"); - - var localVarPath = "./categories/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetCategoryInfo", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetCategoryDetails) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetCategoryDetails))); - } - - /// - /// Get a product's details - /// - /// Thrown when fails to make API call - /// Product ID - /// GetProductDetails - public GetProductDetails GetProductInfo (string id) - { - ApiResponse localVarResponse = GetProductInfoWithHttpInfo(id); - return localVarResponse.Data; - } - - /// - /// Get a product's details - /// - /// Thrown when fails to make API call - /// Product ID - /// ApiResponse of GetProductDetails - public ApiResponse< GetProductDetails > GetProductInfoWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling EcommerceApi->GetProductInfo"); - - var localVarPath = "./products/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetProductInfo", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetProductDetails) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetProductDetails))); - } - - /// - /// Get a product's details - /// - /// Thrown when fails to make API call - /// Product ID - /// Task of GetProductDetails - public async System.Threading.Tasks.Task GetProductInfoAsync (string id) - { - ApiResponse localVarResponse = await GetProductInfoAsyncWithHttpInfo(id); - return localVarResponse.Data; - - } - - /// - /// Get a product's details - /// - /// Thrown when fails to make API call - /// Product ID - /// Task of ApiResponse (GetProductDetails) - public async System.Threading.Tasks.Task> GetProductInfoAsyncWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling EcommerceApi->GetProductInfo"); - - var localVarPath = "./products/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetProductInfo", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetProductDetails) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetProductDetails))); - } - - /// - /// Return all your products - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Filter by product ids (optional) - /// GetProducts - public GetProducts GetProducts (long? limit = null, long? offset = null, string sort = null, List ids = null) - { - ApiResponse localVarResponse = GetProductsWithHttpInfo(limit, offset, sort, ids); - return localVarResponse.Data; - } - - /// - /// Return all your products - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Filter by product ids (optional) - /// ApiResponse of GetProducts - public ApiResponse< GetProducts > GetProductsWithHttpInfo (long? limit = null, long? offset = null, string sort = null, List ids = null) - { - - var localVarPath = "./products"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - if (ids != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ids", ids)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetProducts", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetProducts) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetProducts))); - } - - /// - /// Return all your products - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Filter by product ids (optional) - /// Task of GetProducts - public async System.Threading.Tasks.Task GetProductsAsync (long? limit = null, long? offset = null, string sort = null, List ids = null) - { - ApiResponse localVarResponse = await GetProductsAsyncWithHttpInfo(limit, offset, sort, ids); - return localVarResponse.Data; - - } - - /// - /// Return all your products - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Filter by product ids (optional) - /// Task of ApiResponse (GetProducts) - public async System.Threading.Tasks.Task> GetProductsAsyncWithHttpInfo (long? limit = null, long? offset = null, string sort = null, List ids = null) - { - - var localVarPath = "./products"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - if (ids != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ids", ids)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetProducts", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetProducts) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetProducts))); - } - - } -} diff --git a/src/sib_api_v3_sdk/Api/EmailCampaignsApi.cs b/src/sib_api_v3_sdk/Api/EmailCampaignsApi.cs deleted file mode 100644 index 192c1c4..0000000 --- a/src/sib_api_v3_sdk/Api/EmailCampaignsApi.cs +++ /dev/null @@ -1,2925 +0,0 @@ -/* - * SendinBlue API - * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :- -- -- -- -- -- --: | - -- -- -- -- -- -- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | - * - * OpenAPI spec version: 3.0.0 - * Contact: contact@sendinblue.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using RestSharp.Portable; -using sib_api_v3_sdk.Client; -using sib_api_v3_sdk.Model; - -namespace sib_api_v3_sdk.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IEmailCampaignsApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Create an email campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create a campaign - /// CreateModel - CreateModel CreateEmailCampaign (CreateEmailCampaign emailCampaigns); - - /// - /// Create an email campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create a campaign - /// ApiResponse of CreateModel - ApiResponse CreateEmailCampaignWithHttpInfo (CreateEmailCampaign emailCampaigns); - /// - /// Delete an email campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the campaign - /// - void DeleteEmailCampaign (long? campaignId); - - /// - /// Delete an email campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the campaign - /// ApiResponse of Object(void) - ApiResponse DeleteEmailCampaignWithHttpInfo (long? campaignId); - /// - /// Export the recipients of an email campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Values to send for a recipient export request (optional) - /// CreatedProcessId - CreatedProcessId EmailExportRecipients (long? campaignId, EmailExportRecipients recipientExport = null); - - /// - /// Export the recipients of an email campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Values to send for a recipient export request (optional) - /// ApiResponse of CreatedProcessId - ApiResponse EmailExportRecipientsWithHttpInfo (long? campaignId, EmailExportRecipients recipientExport = null); - /// - /// Get an A/B test email campaign results - /// - /// - /// Obtain winning version of an A/B test email campaign - /// - /// Thrown when fails to make API call - /// Id of the A/B test campaign - /// AbTestCampaignResult - AbTestCampaignResult GetAbTestCampaignResult (long? campaignId); - - /// - /// Get an A/B test email campaign results - /// - /// - /// Obtain winning version of an A/B test email campaign - /// - /// Thrown when fails to make API call - /// Id of the A/B test campaign - /// ApiResponse of AbTestCampaignResult - ApiResponse GetAbTestCampaignResultWithHttpInfo (long? campaignId); - /// - /// Get an email campaign report - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional) - /// GetEmailCampaign - GetEmailCampaign GetEmailCampaign (long? campaignId, string statistics = null); - - /// - /// Get an email campaign report - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional) - /// ApiResponse of GetEmailCampaign - ApiResponse GetEmailCampaignWithHttpInfo (long? campaignId, string statistics = null); - /// - /// Return all your created email campaigns - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter on the type of the campaigns (optional) - /// Filter on the status of the campaign (optional) - /// Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional) - /// Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Number of documents per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// GetEmailCampaigns - GetEmailCampaigns GetEmailCampaigns (string type = null, string status = null, string statistics = null, string startDate = null, string endDate = null, long? limit = null, long? offset = null, string sort = null); - - /// - /// Return all your created email campaigns - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter on the type of the campaigns (optional) - /// Filter on the status of the campaign (optional) - /// Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional) - /// Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Number of documents per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// ApiResponse of GetEmailCampaigns - ApiResponse GetEmailCampaignsWithHttpInfo (string type = null, string status = null, string statistics = null, string startDate = null, string endDate = null, long? limit = null, long? offset = null, string sort = null); - /// - /// Get a shared template url - /// - /// - /// Get a unique URL to share & import an email template from one Sendinblue account to another. - /// - /// Thrown when fails to make API call - /// Id of the campaign or template - /// GetSharedTemplateUrl - GetSharedTemplateUrl GetSharedTemplateUrl (long? campaignId); - - /// - /// Get a shared template url - /// - /// - /// Get a unique URL to share & import an email template from one Sendinblue account to another. - /// - /// Thrown when fails to make API call - /// Id of the campaign or template - /// ApiResponse of GetSharedTemplateUrl - ApiResponse GetSharedTemplateUrlWithHttpInfo (long? campaignId); - /// - /// Send an email campaign immediately, based on campaignId - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// - void SendEmailCampaignNow (long? campaignId); - - /// - /// Send an email campaign immediately, based on campaignId - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// ApiResponse of Object(void) - ApiResponse SendEmailCampaignNowWithHttpInfo (long? campaignId); - /// - /// Send the report of a campaign - /// - /// - /// A PDF will be sent to the specified email addresses - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Values for send a report - /// - void SendReport (long? campaignId, SendReport sendReport); - - /// - /// Send the report of a campaign - /// - /// - /// A PDF will be sent to the specified email addresses - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Values for send a report - /// ApiResponse of Object(void) - ApiResponse SendReportWithHttpInfo (long? campaignId, SendReport sendReport); - /// - /// Send an email campaign to your test list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// - /// - void SendTestEmail (long? campaignId, SendTestEmail emailTo); - - /// - /// Send an email campaign to your test list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// - /// ApiResponse of Object(void) - ApiResponse SendTestEmailWithHttpInfo (long? campaignId, SendTestEmail emailTo); - /// - /// Update an email campaign status - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Status of the campaign - /// - void UpdateCampaignStatus (long? campaignId, UpdateCampaignStatus status); - - /// - /// Update an email campaign status - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Status of the campaign - /// ApiResponse of Object(void) - ApiResponse UpdateCampaignStatusWithHttpInfo (long? campaignId, UpdateCampaignStatus status); - /// - /// Update an email campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Values to update a campaign - /// - void UpdateEmailCampaign (long? campaignId, UpdateEmailCampaign emailCampaign); - - /// - /// Update an email campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Values to update a campaign - /// ApiResponse of Object(void) - ApiResponse UpdateEmailCampaignWithHttpInfo (long? campaignId, UpdateEmailCampaign emailCampaign); - /// - /// Upload an image to your account's image gallery - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Parameters to upload an image - /// UploadImageModel - UploadImageModel UploadImageToGallery (UploadImageToGallery uploadImage); - - /// - /// Upload an image to your account's image gallery - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Parameters to upload an image - /// ApiResponse of UploadImageModel - ApiResponse UploadImageToGalleryWithHttpInfo (UploadImageToGallery uploadImage); - #endregion Synchronous Operations - #region Asynchronous Operations - /// - /// Create an email campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create a campaign - /// Task of CreateModel - System.Threading.Tasks.Task CreateEmailCampaignAsync (CreateEmailCampaign emailCampaigns); - - /// - /// Create an email campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create a campaign - /// Task of ApiResponse (CreateModel) - System.Threading.Tasks.Task> CreateEmailCampaignAsyncWithHttpInfo (CreateEmailCampaign emailCampaigns); - /// - /// Delete an email campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Task of void - System.Threading.Tasks.Task DeleteEmailCampaignAsync (long? campaignId); - - /// - /// Delete an email campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Task of ApiResponse - System.Threading.Tasks.Task> DeleteEmailCampaignAsyncWithHttpInfo (long? campaignId); - /// - /// Export the recipients of an email campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Values to send for a recipient export request (optional) - /// Task of CreatedProcessId - System.Threading.Tasks.Task EmailExportRecipientsAsync (long? campaignId, EmailExportRecipients recipientExport = null); - - /// - /// Export the recipients of an email campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Values to send for a recipient export request (optional) - /// Task of ApiResponse (CreatedProcessId) - System.Threading.Tasks.Task> EmailExportRecipientsAsyncWithHttpInfo (long? campaignId, EmailExportRecipients recipientExport = null); - /// - /// Get an A/B test email campaign results - /// - /// - /// Obtain winning version of an A/B test email campaign - /// - /// Thrown when fails to make API call - /// Id of the A/B test campaign - /// Task of AbTestCampaignResult - System.Threading.Tasks.Task GetAbTestCampaignResultAsync (long? campaignId); - - /// - /// Get an A/B test email campaign results - /// - /// - /// Obtain winning version of an A/B test email campaign - /// - /// Thrown when fails to make API call - /// Id of the A/B test campaign - /// Task of ApiResponse (AbTestCampaignResult) - System.Threading.Tasks.Task> GetAbTestCampaignResultAsyncWithHttpInfo (long? campaignId); - /// - /// Get an email campaign report - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional) - /// Task of GetEmailCampaign - System.Threading.Tasks.Task GetEmailCampaignAsync (long? campaignId, string statistics = null); - - /// - /// Get an email campaign report - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional) - /// Task of ApiResponse (GetEmailCampaign) - System.Threading.Tasks.Task> GetEmailCampaignAsyncWithHttpInfo (long? campaignId, string statistics = null); - /// - /// Return all your created email campaigns - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter on the type of the campaigns (optional) - /// Filter on the status of the campaign (optional) - /// Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional) - /// Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Number of documents per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of GetEmailCampaigns - System.Threading.Tasks.Task GetEmailCampaignsAsync (string type = null, string status = null, string statistics = null, string startDate = null, string endDate = null, long? limit = null, long? offset = null, string sort = null); - - /// - /// Return all your created email campaigns - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter on the type of the campaigns (optional) - /// Filter on the status of the campaign (optional) - /// Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional) - /// Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Number of documents per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of ApiResponse (GetEmailCampaigns) - System.Threading.Tasks.Task> GetEmailCampaignsAsyncWithHttpInfo (string type = null, string status = null, string statistics = null, string startDate = null, string endDate = null, long? limit = null, long? offset = null, string sort = null); - /// - /// Get a shared template url - /// - /// - /// Get a unique URL to share & import an email template from one Sendinblue account to another. - /// - /// Thrown when fails to make API call - /// Id of the campaign or template - /// Task of GetSharedTemplateUrl - System.Threading.Tasks.Task GetSharedTemplateUrlAsync (long? campaignId); - - /// - /// Get a shared template url - /// - /// - /// Get a unique URL to share & import an email template from one Sendinblue account to another. - /// - /// Thrown when fails to make API call - /// Id of the campaign or template - /// Task of ApiResponse (GetSharedTemplateUrl) - System.Threading.Tasks.Task> GetSharedTemplateUrlAsyncWithHttpInfo (long? campaignId); - /// - /// Send an email campaign immediately, based on campaignId - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Task of void - System.Threading.Tasks.Task SendEmailCampaignNowAsync (long? campaignId); - - /// - /// Send an email campaign immediately, based on campaignId - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Task of ApiResponse - System.Threading.Tasks.Task> SendEmailCampaignNowAsyncWithHttpInfo (long? campaignId); - /// - /// Send the report of a campaign - /// - /// - /// A PDF will be sent to the specified email addresses - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Values for send a report - /// Task of void - System.Threading.Tasks.Task SendReportAsync (long? campaignId, SendReport sendReport); - - /// - /// Send the report of a campaign - /// - /// - /// A PDF will be sent to the specified email addresses - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Values for send a report - /// Task of ApiResponse - System.Threading.Tasks.Task> SendReportAsyncWithHttpInfo (long? campaignId, SendReport sendReport); - /// - /// Send an email campaign to your test list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// - /// Task of void - System.Threading.Tasks.Task SendTestEmailAsync (long? campaignId, SendTestEmail emailTo); - - /// - /// Send an email campaign to your test list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// - /// Task of ApiResponse - System.Threading.Tasks.Task> SendTestEmailAsyncWithHttpInfo (long? campaignId, SendTestEmail emailTo); - /// - /// Update an email campaign status - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Status of the campaign - /// Task of void - System.Threading.Tasks.Task UpdateCampaignStatusAsync (long? campaignId, UpdateCampaignStatus status); - - /// - /// Update an email campaign status - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Status of the campaign - /// Task of ApiResponse - System.Threading.Tasks.Task> UpdateCampaignStatusAsyncWithHttpInfo (long? campaignId, UpdateCampaignStatus status); - /// - /// Update an email campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Values to update a campaign - /// Task of void - System.Threading.Tasks.Task UpdateEmailCampaignAsync (long? campaignId, UpdateEmailCampaign emailCampaign); - - /// - /// Update an email campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Values to update a campaign - /// Task of ApiResponse - System.Threading.Tasks.Task> UpdateEmailCampaignAsyncWithHttpInfo (long? campaignId, UpdateEmailCampaign emailCampaign); - /// - /// Upload an image to your account's image gallery - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Parameters to upload an image - /// Task of UploadImageModel - System.Threading.Tasks.Task UploadImageToGalleryAsync (UploadImageToGallery uploadImage); - - /// - /// Upload an image to your account's image gallery - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Parameters to upload an image - /// Task of ApiResponse (UploadImageModel) - System.Threading.Tasks.Task> UploadImageToGalleryAsyncWithHttpInfo (UploadImageToGallery uploadImage); - #endregion Asynchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public partial class EmailCampaignsApi : IEmailCampaignsApi - { - private sib_api_v3_sdk.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// - /// - public EmailCampaignsApi(String basePath) - { - this.Configuration = new sib_api_v3_sdk.Client.Configuration { BasePath = basePath }; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using Configuration object - /// - /// An instance of Configuration - /// - public EmailCampaignsApi(sib_api_v3_sdk.Client.Configuration configuration = null) - { - if (configuration == null) // use the default one in Configuration - this.Configuration = sib_api_v3_sdk.Client.Configuration.Default; - else - this.Configuration = configuration; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] - public void SetBasePath(String basePath) - { - // do nothing - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public sib_api_v3_sdk.Client.Configuration Configuration {get; set;} - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public sib_api_v3_sdk.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - /// - /// Gets the default header. - /// - /// Dictionary of HTTP header - [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] - public IDictionary DefaultHeader() - { - return new ReadOnlyDictionary(this.Configuration.DefaultHeader); - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] - public void AddDefaultHeader(string key, string value) - { - this.Configuration.AddDefaultHeader(key, value); - } - - /// - /// Create an email campaign - /// - /// Thrown when fails to make API call - /// Values to create a campaign - /// CreateModel - public CreateModel CreateEmailCampaign (CreateEmailCampaign emailCampaigns) - { - ApiResponse localVarResponse = CreateEmailCampaignWithHttpInfo(emailCampaigns); - return localVarResponse.Data; - } - - /// - /// Create an email campaign - /// - /// Thrown when fails to make API call - /// Values to create a campaign - /// ApiResponse of CreateModel - public ApiResponse< CreateModel > CreateEmailCampaignWithHttpInfo (CreateEmailCampaign emailCampaigns) - { - // verify the required parameter 'emailCampaigns' is set - if (emailCampaigns == null) - throw new ApiException(400, "Missing required parameter 'emailCampaigns' when calling EmailCampaignsApi->CreateEmailCampaign"); - - var localVarPath = "./emailCampaigns"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (emailCampaigns != null && emailCampaigns.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(emailCampaigns); // http body (model) parameter - } - else - { - localVarPostBody = emailCampaigns; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateEmailCampaign", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateModel))); - } - - /// - /// Create an email campaign - /// - /// Thrown when fails to make API call - /// Values to create a campaign - /// Task of CreateModel - public async System.Threading.Tasks.Task CreateEmailCampaignAsync (CreateEmailCampaign emailCampaigns) - { - ApiResponse localVarResponse = await CreateEmailCampaignAsyncWithHttpInfo(emailCampaigns); - return localVarResponse.Data; - - } - - /// - /// Create an email campaign - /// - /// Thrown when fails to make API call - /// Values to create a campaign - /// Task of ApiResponse (CreateModel) - public async System.Threading.Tasks.Task> CreateEmailCampaignAsyncWithHttpInfo (CreateEmailCampaign emailCampaigns) - { - // verify the required parameter 'emailCampaigns' is set - if (emailCampaigns == null) - throw new ApiException(400, "Missing required parameter 'emailCampaigns' when calling EmailCampaignsApi->CreateEmailCampaign"); - - var localVarPath = "./emailCampaigns"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (emailCampaigns != null && emailCampaigns.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(emailCampaigns); // http body (model) parameter - } - else - { - localVarPostBody = emailCampaigns; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateEmailCampaign", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateModel))); - } - - /// - /// Delete an email campaign - /// - /// Thrown when fails to make API call - /// id of the campaign - /// - public void DeleteEmailCampaign (long? campaignId) - { - DeleteEmailCampaignWithHttpInfo(campaignId); - } - - /// - /// Delete an email campaign - /// - /// Thrown when fails to make API call - /// id of the campaign - /// ApiResponse of Object(void) - public ApiResponse DeleteEmailCampaignWithHttpInfo (long? campaignId) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling EmailCampaignsApi->DeleteEmailCampaign"); - - var localVarPath = "./emailCampaigns/{campaignId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteEmailCampaign", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete an email campaign - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Task of void - public async System.Threading.Tasks.Task DeleteEmailCampaignAsync (long? campaignId) - { - await DeleteEmailCampaignAsyncWithHttpInfo(campaignId); - - } - - /// - /// Delete an email campaign - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeleteEmailCampaignAsyncWithHttpInfo (long? campaignId) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling EmailCampaignsApi->DeleteEmailCampaign"); - - var localVarPath = "./emailCampaigns/{campaignId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteEmailCampaign", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Export the recipients of an email campaign - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Values to send for a recipient export request (optional) - /// CreatedProcessId - public CreatedProcessId EmailExportRecipients (long? campaignId, EmailExportRecipients recipientExport = null) - { - ApiResponse localVarResponse = EmailExportRecipientsWithHttpInfo(campaignId, recipientExport); - return localVarResponse.Data; - } - - /// - /// Export the recipients of an email campaign - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Values to send for a recipient export request (optional) - /// ApiResponse of CreatedProcessId - public ApiResponse< CreatedProcessId > EmailExportRecipientsWithHttpInfo (long? campaignId, EmailExportRecipients recipientExport = null) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling EmailCampaignsApi->EmailExportRecipients"); - - var localVarPath = "./emailCampaigns/{campaignId}/exportRecipients"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - if (recipientExport != null && recipientExport.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(recipientExport); // http body (model) parameter - } - else - { - localVarPostBody = recipientExport; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("EmailExportRecipients", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreatedProcessId) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreatedProcessId))); - } - - /// - /// Export the recipients of an email campaign - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Values to send for a recipient export request (optional) - /// Task of CreatedProcessId - public async System.Threading.Tasks.Task EmailExportRecipientsAsync (long? campaignId, EmailExportRecipients recipientExport = null) - { - ApiResponse localVarResponse = await EmailExportRecipientsAsyncWithHttpInfo(campaignId, recipientExport); - return localVarResponse.Data; - - } - - /// - /// Export the recipients of an email campaign - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Values to send for a recipient export request (optional) - /// Task of ApiResponse (CreatedProcessId) - public async System.Threading.Tasks.Task> EmailExportRecipientsAsyncWithHttpInfo (long? campaignId, EmailExportRecipients recipientExport = null) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling EmailCampaignsApi->EmailExportRecipients"); - - var localVarPath = "./emailCampaigns/{campaignId}/exportRecipients"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - if (recipientExport != null && recipientExport.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(recipientExport); // http body (model) parameter - } - else - { - localVarPostBody = recipientExport; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("EmailExportRecipients", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreatedProcessId) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreatedProcessId))); - } - - /// - /// Get an A/B test email campaign results Obtain winning version of an A/B test email campaign - /// - /// Thrown when fails to make API call - /// Id of the A/B test campaign - /// AbTestCampaignResult - public AbTestCampaignResult GetAbTestCampaignResult (long? campaignId) - { - ApiResponse localVarResponse = GetAbTestCampaignResultWithHttpInfo(campaignId); - return localVarResponse.Data; - } - - /// - /// Get an A/B test email campaign results Obtain winning version of an A/B test email campaign - /// - /// Thrown when fails to make API call - /// Id of the A/B test campaign - /// ApiResponse of AbTestCampaignResult - public ApiResponse< AbTestCampaignResult > GetAbTestCampaignResultWithHttpInfo (long? campaignId) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling EmailCampaignsApi->GetAbTestCampaignResult"); - - var localVarPath = "./emailCampaigns/{campaignId}/abTestCampaignResult"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetAbTestCampaignResult", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (AbTestCampaignResult) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(AbTestCampaignResult))); - } - - /// - /// Get an A/B test email campaign results Obtain winning version of an A/B test email campaign - /// - /// Thrown when fails to make API call - /// Id of the A/B test campaign - /// Task of AbTestCampaignResult - public async System.Threading.Tasks.Task GetAbTestCampaignResultAsync (long? campaignId) - { - ApiResponse localVarResponse = await GetAbTestCampaignResultAsyncWithHttpInfo(campaignId); - return localVarResponse.Data; - - } - - /// - /// Get an A/B test email campaign results Obtain winning version of an A/B test email campaign - /// - /// Thrown when fails to make API call - /// Id of the A/B test campaign - /// Task of ApiResponse (AbTestCampaignResult) - public async System.Threading.Tasks.Task> GetAbTestCampaignResultAsyncWithHttpInfo (long? campaignId) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling EmailCampaignsApi->GetAbTestCampaignResult"); - - var localVarPath = "./emailCampaigns/{campaignId}/abTestCampaignResult"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetAbTestCampaignResult", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (AbTestCampaignResult) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(AbTestCampaignResult))); - } - - /// - /// Get an email campaign report - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional) - /// GetEmailCampaign - public GetEmailCampaign GetEmailCampaign (long? campaignId, string statistics = null) - { - ApiResponse localVarResponse = GetEmailCampaignWithHttpInfo(campaignId, statistics); - return localVarResponse.Data; - } - - /// - /// Get an email campaign report - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional) - /// ApiResponse of GetEmailCampaign - public ApiResponse< GetEmailCampaign > GetEmailCampaignWithHttpInfo (long? campaignId, string statistics = null) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling EmailCampaignsApi->GetEmailCampaign"); - - var localVarPath = "./emailCampaigns/{campaignId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - if (statistics != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "statistics", statistics)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetEmailCampaign", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetEmailCampaign) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetEmailCampaign))); - } - - /// - /// Get an email campaign report - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional) - /// Task of GetEmailCampaign - public async System.Threading.Tasks.Task GetEmailCampaignAsync (long? campaignId, string statistics = null) - { - ApiResponse localVarResponse = await GetEmailCampaignAsyncWithHttpInfo(campaignId, statistics); - return localVarResponse.Data; - - } - - /// - /// Get an email campaign report - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional) - /// Task of ApiResponse (GetEmailCampaign) - public async System.Threading.Tasks.Task> GetEmailCampaignAsyncWithHttpInfo (long? campaignId, string statistics = null) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling EmailCampaignsApi->GetEmailCampaign"); - - var localVarPath = "./emailCampaigns/{campaignId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - if (statistics != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "statistics", statistics)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetEmailCampaign", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetEmailCampaign) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetEmailCampaign))); - } - - /// - /// Return all your created email campaigns - /// - /// Thrown when fails to make API call - /// Filter on the type of the campaigns (optional) - /// Filter on the status of the campaign (optional) - /// Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional) - /// Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Number of documents per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// GetEmailCampaigns - public GetEmailCampaigns GetEmailCampaigns (string type = null, string status = null, string statistics = null, string startDate = null, string endDate = null, long? limit = null, long? offset = null, string sort = null) - { - ApiResponse localVarResponse = GetEmailCampaignsWithHttpInfo(type, status, statistics, startDate, endDate, limit, offset, sort); - return localVarResponse.Data; - } - - /// - /// Return all your created email campaigns - /// - /// Thrown when fails to make API call - /// Filter on the type of the campaigns (optional) - /// Filter on the status of the campaign (optional) - /// Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional) - /// Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Number of documents per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// ApiResponse of GetEmailCampaigns - public ApiResponse< GetEmailCampaigns > GetEmailCampaignsWithHttpInfo (string type = null, string status = null, string statistics = null, string startDate = null, string endDate = null, long? limit = null, long? offset = null, string sort = null) - { - - var localVarPath = "./emailCampaigns"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (type != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "type", type)); // query parameter - if (status != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "status", status)); // query parameter - if (statistics != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "statistics", statistics)); // query parameter - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetEmailCampaigns", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetEmailCampaigns) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetEmailCampaigns))); - } - - /// - /// Return all your created email campaigns - /// - /// Thrown when fails to make API call - /// Filter on the type of the campaigns (optional) - /// Filter on the status of the campaign (optional) - /// Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional) - /// Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Number of documents per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of GetEmailCampaigns - public async System.Threading.Tasks.Task GetEmailCampaignsAsync (string type = null, string status = null, string statistics = null, string startDate = null, string endDate = null, long? limit = null, long? offset = null, string sort = null) - { - ApiResponse localVarResponse = await GetEmailCampaignsAsyncWithHttpInfo(type, status, statistics, startDate, endDate, limit, offset, sort); - return localVarResponse.Data; - - } - - /// - /// Return all your created email campaigns - /// - /// Thrown when fails to make API call - /// Filter on the type of the campaigns (optional) - /// Filter on the status of the campaign (optional) - /// Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional) - /// Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Number of documents per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of ApiResponse (GetEmailCampaigns) - public async System.Threading.Tasks.Task> GetEmailCampaignsAsyncWithHttpInfo (string type = null, string status = null, string statistics = null, string startDate = null, string endDate = null, long? limit = null, long? offset = null, string sort = null) - { - - var localVarPath = "./emailCampaigns"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (type != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "type", type)); // query parameter - if (status != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "status", status)); // query parameter - if (statistics != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "statistics", statistics)); // query parameter - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetEmailCampaigns", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetEmailCampaigns) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetEmailCampaigns))); - } - - /// - /// Get a shared template url Get a unique URL to share & import an email template from one Sendinblue account to another. - /// - /// Thrown when fails to make API call - /// Id of the campaign or template - /// GetSharedTemplateUrl - public GetSharedTemplateUrl GetSharedTemplateUrl (long? campaignId) - { - ApiResponse localVarResponse = GetSharedTemplateUrlWithHttpInfo(campaignId); - return localVarResponse.Data; - } - - /// - /// Get a shared template url Get a unique URL to share & import an email template from one Sendinblue account to another. - /// - /// Thrown when fails to make API call - /// Id of the campaign or template - /// ApiResponse of GetSharedTemplateUrl - public ApiResponse< GetSharedTemplateUrl > GetSharedTemplateUrlWithHttpInfo (long? campaignId) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling EmailCampaignsApi->GetSharedTemplateUrl"); - - var localVarPath = "./emailCampaigns/{campaignId}/sharedUrl"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetSharedTemplateUrl", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetSharedTemplateUrl) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSharedTemplateUrl))); - } - - /// - /// Get a shared template url Get a unique URL to share & import an email template from one Sendinblue account to another. - /// - /// Thrown when fails to make API call - /// Id of the campaign or template - /// Task of GetSharedTemplateUrl - public async System.Threading.Tasks.Task GetSharedTemplateUrlAsync (long? campaignId) - { - ApiResponse localVarResponse = await GetSharedTemplateUrlAsyncWithHttpInfo(campaignId); - return localVarResponse.Data; - - } - - /// - /// Get a shared template url Get a unique URL to share & import an email template from one Sendinblue account to another. - /// - /// Thrown when fails to make API call - /// Id of the campaign or template - /// Task of ApiResponse (GetSharedTemplateUrl) - public async System.Threading.Tasks.Task> GetSharedTemplateUrlAsyncWithHttpInfo (long? campaignId) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling EmailCampaignsApi->GetSharedTemplateUrl"); - - var localVarPath = "./emailCampaigns/{campaignId}/sharedUrl"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetSharedTemplateUrl", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetSharedTemplateUrl) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSharedTemplateUrl))); - } - - /// - /// Send an email campaign immediately, based on campaignId - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// - public void SendEmailCampaignNow (long? campaignId) - { - SendEmailCampaignNowWithHttpInfo(campaignId); - } - - /// - /// Send an email campaign immediately, based on campaignId - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// ApiResponse of Object(void) - public ApiResponse SendEmailCampaignNowWithHttpInfo (long? campaignId) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling EmailCampaignsApi->SendEmailCampaignNow"); - - var localVarPath = "./emailCampaigns/{campaignId}/sendNow"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("SendEmailCampaignNow", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Send an email campaign immediately, based on campaignId - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Task of void - public async System.Threading.Tasks.Task SendEmailCampaignNowAsync (long? campaignId) - { - await SendEmailCampaignNowAsyncWithHttpInfo(campaignId); - - } - - /// - /// Send an email campaign immediately, based on campaignId - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Task of ApiResponse - public async System.Threading.Tasks.Task> SendEmailCampaignNowAsyncWithHttpInfo (long? campaignId) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling EmailCampaignsApi->SendEmailCampaignNow"); - - var localVarPath = "./emailCampaigns/{campaignId}/sendNow"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("SendEmailCampaignNow", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Send the report of a campaign A PDF will be sent to the specified email addresses - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Values for send a report - /// - public void SendReport (long? campaignId, SendReport sendReport) - { - SendReportWithHttpInfo(campaignId, sendReport); - } - - /// - /// Send the report of a campaign A PDF will be sent to the specified email addresses - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Values for send a report - /// ApiResponse of Object(void) - public ApiResponse SendReportWithHttpInfo (long? campaignId, SendReport sendReport) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling EmailCampaignsApi->SendReport"); - // verify the required parameter 'sendReport' is set - if (sendReport == null) - throw new ApiException(400, "Missing required parameter 'sendReport' when calling EmailCampaignsApi->SendReport"); - - var localVarPath = "./emailCampaigns/{campaignId}/sendReport"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - if (sendReport != null && sendReport.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(sendReport); // http body (model) parameter - } - else - { - localVarPostBody = sendReport; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("SendReport", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Send the report of a campaign A PDF will be sent to the specified email addresses - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Values for send a report - /// Task of void - public async System.Threading.Tasks.Task SendReportAsync (long? campaignId, SendReport sendReport) - { - await SendReportAsyncWithHttpInfo(campaignId, sendReport); - - } - - /// - /// Send the report of a campaign A PDF will be sent to the specified email addresses - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Values for send a report - /// Task of ApiResponse - public async System.Threading.Tasks.Task> SendReportAsyncWithHttpInfo (long? campaignId, SendReport sendReport) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling EmailCampaignsApi->SendReport"); - // verify the required parameter 'sendReport' is set - if (sendReport == null) - throw new ApiException(400, "Missing required parameter 'sendReport' when calling EmailCampaignsApi->SendReport"); - - var localVarPath = "./emailCampaigns/{campaignId}/sendReport"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - if (sendReport != null && sendReport.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(sendReport); // http body (model) parameter - } - else - { - localVarPostBody = sendReport; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("SendReport", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Send an email campaign to your test list - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// - /// - public void SendTestEmail (long? campaignId, SendTestEmail emailTo) - { - SendTestEmailWithHttpInfo(campaignId, emailTo); - } - - /// - /// Send an email campaign to your test list - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// - /// ApiResponse of Object(void) - public ApiResponse SendTestEmailWithHttpInfo (long? campaignId, SendTestEmail emailTo) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling EmailCampaignsApi->SendTestEmail"); - // verify the required parameter 'emailTo' is set - if (emailTo == null) - throw new ApiException(400, "Missing required parameter 'emailTo' when calling EmailCampaignsApi->SendTestEmail"); - - var localVarPath = "./emailCampaigns/{campaignId}/sendTest"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - if (emailTo != null && emailTo.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(emailTo); // http body (model) parameter - } - else - { - localVarPostBody = emailTo; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("SendTestEmail", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Send an email campaign to your test list - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// - /// Task of void - public async System.Threading.Tasks.Task SendTestEmailAsync (long? campaignId, SendTestEmail emailTo) - { - await SendTestEmailAsyncWithHttpInfo(campaignId, emailTo); - - } - - /// - /// Send an email campaign to your test list - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// - /// Task of ApiResponse - public async System.Threading.Tasks.Task> SendTestEmailAsyncWithHttpInfo (long? campaignId, SendTestEmail emailTo) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling EmailCampaignsApi->SendTestEmail"); - // verify the required parameter 'emailTo' is set - if (emailTo == null) - throw new ApiException(400, "Missing required parameter 'emailTo' when calling EmailCampaignsApi->SendTestEmail"); - - var localVarPath = "./emailCampaigns/{campaignId}/sendTest"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - if (emailTo != null && emailTo.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(emailTo); // http body (model) parameter - } - else - { - localVarPostBody = emailTo; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("SendTestEmail", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Update an email campaign status - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Status of the campaign - /// - public void UpdateCampaignStatus (long? campaignId, UpdateCampaignStatus status) - { - UpdateCampaignStatusWithHttpInfo(campaignId, status); - } - - /// - /// Update an email campaign status - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Status of the campaign - /// ApiResponse of Object(void) - public ApiResponse UpdateCampaignStatusWithHttpInfo (long? campaignId, UpdateCampaignStatus status) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling EmailCampaignsApi->UpdateCampaignStatus"); - // verify the required parameter 'status' is set - if (status == null) - throw new ApiException(400, "Missing required parameter 'status' when calling EmailCampaignsApi->UpdateCampaignStatus"); - - var localVarPath = "./emailCampaigns/{campaignId}/status"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - if (status != null && status.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(status); // http body (model) parameter - } - else - { - localVarPostBody = status; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UpdateCampaignStatus", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Update an email campaign status - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Status of the campaign - /// Task of void - public async System.Threading.Tasks.Task UpdateCampaignStatusAsync (long? campaignId, UpdateCampaignStatus status) - { - await UpdateCampaignStatusAsyncWithHttpInfo(campaignId, status); - - } - - /// - /// Update an email campaign status - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Status of the campaign - /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdateCampaignStatusAsyncWithHttpInfo (long? campaignId, UpdateCampaignStatus status) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling EmailCampaignsApi->UpdateCampaignStatus"); - // verify the required parameter 'status' is set - if (status == null) - throw new ApiException(400, "Missing required parameter 'status' when calling EmailCampaignsApi->UpdateCampaignStatus"); - - var localVarPath = "./emailCampaigns/{campaignId}/status"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - if (status != null && status.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(status); // http body (model) parameter - } - else - { - localVarPostBody = status; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UpdateCampaignStatus", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Update an email campaign - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Values to update a campaign - /// - public void UpdateEmailCampaign (long? campaignId, UpdateEmailCampaign emailCampaign) - { - UpdateEmailCampaignWithHttpInfo(campaignId, emailCampaign); - } - - /// - /// Update an email campaign - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Values to update a campaign - /// ApiResponse of Object(void) - public ApiResponse UpdateEmailCampaignWithHttpInfo (long? campaignId, UpdateEmailCampaign emailCampaign) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling EmailCampaignsApi->UpdateEmailCampaign"); - // verify the required parameter 'emailCampaign' is set - if (emailCampaign == null) - throw new ApiException(400, "Missing required parameter 'emailCampaign' when calling EmailCampaignsApi->UpdateEmailCampaign"); - - var localVarPath = "./emailCampaigns/{campaignId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - if (emailCampaign != null && emailCampaign.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(emailCampaign); // http body (model) parameter - } - else - { - localVarPostBody = emailCampaign; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UpdateEmailCampaign", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Update an email campaign - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Values to update a campaign - /// Task of void - public async System.Threading.Tasks.Task UpdateEmailCampaignAsync (long? campaignId, UpdateEmailCampaign emailCampaign) - { - await UpdateEmailCampaignAsyncWithHttpInfo(campaignId, emailCampaign); - - } - - /// - /// Update an email campaign - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Values to update a campaign - /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdateEmailCampaignAsyncWithHttpInfo (long? campaignId, UpdateEmailCampaign emailCampaign) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling EmailCampaignsApi->UpdateEmailCampaign"); - // verify the required parameter 'emailCampaign' is set - if (emailCampaign == null) - throw new ApiException(400, "Missing required parameter 'emailCampaign' when calling EmailCampaignsApi->UpdateEmailCampaign"); - - var localVarPath = "./emailCampaigns/{campaignId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - if (emailCampaign != null && emailCampaign.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(emailCampaign); // http body (model) parameter - } - else - { - localVarPostBody = emailCampaign; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UpdateEmailCampaign", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Upload an image to your account's image gallery - /// - /// Thrown when fails to make API call - /// Parameters to upload an image - /// UploadImageModel - public UploadImageModel UploadImageToGallery (UploadImageToGallery uploadImage) - { - ApiResponse localVarResponse = UploadImageToGalleryWithHttpInfo(uploadImage); - return localVarResponse.Data; - } - - /// - /// Upload an image to your account's image gallery - /// - /// Thrown when fails to make API call - /// Parameters to upload an image - /// ApiResponse of UploadImageModel - public ApiResponse< UploadImageModel > UploadImageToGalleryWithHttpInfo (UploadImageToGallery uploadImage) - { - // verify the required parameter 'uploadImage' is set - if (uploadImage == null) - throw new ApiException(400, "Missing required parameter 'uploadImage' when calling EmailCampaignsApi->UploadImageToGallery"); - - var localVarPath = "./emailCampaigns/images"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (uploadImage != null && uploadImage.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(uploadImage); // http body (model) parameter - } - else - { - localVarPostBody = uploadImage; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UploadImageToGallery", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (UploadImageModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(UploadImageModel))); - } - - /// - /// Upload an image to your account's image gallery - /// - /// Thrown when fails to make API call - /// Parameters to upload an image - /// Task of UploadImageModel - public async System.Threading.Tasks.Task UploadImageToGalleryAsync (UploadImageToGallery uploadImage) - { - ApiResponse localVarResponse = await UploadImageToGalleryAsyncWithHttpInfo(uploadImage); - return localVarResponse.Data; - - } - - /// - /// Upload an image to your account's image gallery - /// - /// Thrown when fails to make API call - /// Parameters to upload an image - /// Task of ApiResponse (UploadImageModel) - public async System.Threading.Tasks.Task> UploadImageToGalleryAsyncWithHttpInfo (UploadImageToGallery uploadImage) - { - // verify the required parameter 'uploadImage' is set - if (uploadImage == null) - throw new ApiException(400, "Missing required parameter 'uploadImage' when calling EmailCampaignsApi->UploadImageToGallery"); - - var localVarPath = "./emailCampaigns/images"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (uploadImage != null && uploadImage.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(uploadImage); // http body (model) parameter - } - else - { - localVarPostBody = uploadImage; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UploadImageToGallery", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (UploadImageModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(UploadImageModel))); - } - - } -} diff --git a/src/sib_api_v3_sdk/Api/FilesApi.cs b/src/sib_api_v3_sdk/Api/FilesApi.cs deleted file mode 100644 index 97fb2f5..0000000 --- a/src/sib_api_v3_sdk/Api/FilesApi.cs +++ /dev/null @@ -1,1197 +0,0 @@ -/* - * SendinBlue API - * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :- -- -- -- -- -- --: | - -- -- -- -- -- -- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | - * - * OpenAPI spec version: 3.0.0 - * Contact: contact@sendinblue.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using RestSharp.Portable; -using sib_api_v3_sdk.Client; -using sib_api_v3_sdk.Model; - -namespace sib_api_v3_sdk.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IFilesApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Get all files - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter by file entity type (optional) - /// Filter by file entity IDs (optional) - /// dateFrom to date range filter type (timestamp in milliseconds) (optional) - /// dateTo to date range filter type (timestamp in milliseconds) (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// FileList - FileList CrmFilesGet (string entity = null, string entityIds = null, int? dateFrom = null, int? dateTo = null, long? offset = null, long? limit = null, string sort = null); - - /// - /// Get all files - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter by file entity type (optional) - /// Filter by file entity IDs (optional) - /// dateFrom to date range filter type (timestamp in milliseconds) (optional) - /// dateTo to date range filter type (timestamp in milliseconds) (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// ApiResponse of FileList - ApiResponse CrmFilesGetWithHttpInfo (string entity = null, string entityIds = null, int? dateFrom = null, int? dateTo = null, long? offset = null, long? limit = null, string sort = null); - /// - /// Get file details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// File id to get file data. - /// FileData - FileData CrmFilesIdDataGet (string id); - - /// - /// Get file details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// File id to get file data. - /// ApiResponse of FileData - ApiResponse CrmFilesIdDataGetWithHttpInfo (string id); - /// - /// Delete a file - /// - /// - /// - /// - /// Thrown when fails to make API call - /// File id to delete. - /// - void CrmFilesIdDelete (string id); - - /// - /// Delete a file - /// - /// - /// - /// - /// Thrown when fails to make API call - /// File id to delete. - /// ApiResponse of Object(void) - ApiResponse CrmFilesIdDeleteWithHttpInfo (string id); - /// - /// Download a file - /// - /// - /// - /// - /// Thrown when fails to make API call - /// File id to download. - /// FileDownloadableLink - FileDownloadableLink CrmFilesIdGet (string id); - - /// - /// Download a file - /// - /// - /// - /// - /// Thrown when fails to make API call - /// File id to download. - /// ApiResponse of FileDownloadableLink - ApiResponse CrmFilesIdGetWithHttpInfo (string id); - /// - /// Upload a file - /// - /// - /// - /// - /// Thrown when fails to make API call - /// File data to create a file. - /// Deal id linked to a file (optional) - /// Contact id linked to a file (optional) - /// Company id linked to a file (optional) - /// FileData - FileData CrmFilesPost (System.IO.Stream file, string dealId = null, long? contactId = null, string companyId = null); - - /// - /// Upload a file - /// - /// - /// - /// - /// Thrown when fails to make API call - /// File data to create a file. - /// Deal id linked to a file (optional) - /// Contact id linked to a file (optional) - /// Company id linked to a file (optional) - /// ApiResponse of FileData - ApiResponse CrmFilesPostWithHttpInfo (System.IO.Stream file, string dealId = null, long? contactId = null, string companyId = null); - #endregion Synchronous Operations - #region Asynchronous Operations - /// - /// Get all files - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter by file entity type (optional) - /// Filter by file entity IDs (optional) - /// dateFrom to date range filter type (timestamp in milliseconds) (optional) - /// dateTo to date range filter type (timestamp in milliseconds) (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// Task of FileList - System.Threading.Tasks.Task CrmFilesGetAsync (string entity = null, string entityIds = null, int? dateFrom = null, int? dateTo = null, long? offset = null, long? limit = null, string sort = null); - - /// - /// Get all files - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter by file entity type (optional) - /// Filter by file entity IDs (optional) - /// dateFrom to date range filter type (timestamp in milliseconds) (optional) - /// dateTo to date range filter type (timestamp in milliseconds) (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// Task of ApiResponse (FileList) - System.Threading.Tasks.Task> CrmFilesGetAsyncWithHttpInfo (string entity = null, string entityIds = null, int? dateFrom = null, int? dateTo = null, long? offset = null, long? limit = null, string sort = null); - /// - /// Get file details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// File id to get file data. - /// Task of FileData - System.Threading.Tasks.Task CrmFilesIdDataGetAsync (string id); - - /// - /// Get file details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// File id to get file data. - /// Task of ApiResponse (FileData) - System.Threading.Tasks.Task> CrmFilesIdDataGetAsyncWithHttpInfo (string id); - /// - /// Delete a file - /// - /// - /// - /// - /// Thrown when fails to make API call - /// File id to delete. - /// Task of void - System.Threading.Tasks.Task CrmFilesIdDeleteAsync (string id); - - /// - /// Delete a file - /// - /// - /// - /// - /// Thrown when fails to make API call - /// File id to delete. - /// Task of ApiResponse - System.Threading.Tasks.Task> CrmFilesIdDeleteAsyncWithHttpInfo (string id); - /// - /// Download a file - /// - /// - /// - /// - /// Thrown when fails to make API call - /// File id to download. - /// Task of FileDownloadableLink - System.Threading.Tasks.Task CrmFilesIdGetAsync (string id); - - /// - /// Download a file - /// - /// - /// - /// - /// Thrown when fails to make API call - /// File id to download. - /// Task of ApiResponse (FileDownloadableLink) - System.Threading.Tasks.Task> CrmFilesIdGetAsyncWithHttpInfo (string id); - /// - /// Upload a file - /// - /// - /// - /// - /// Thrown when fails to make API call - /// File data to create a file. - /// Deal id linked to a file (optional) - /// Contact id linked to a file (optional) - /// Company id linked to a file (optional) - /// Task of FileData - System.Threading.Tasks.Task CrmFilesPostAsync (System.IO.Stream file, string dealId = null, long? contactId = null, string companyId = null); - - /// - /// Upload a file - /// - /// - /// - /// - /// Thrown when fails to make API call - /// File data to create a file. - /// Deal id linked to a file (optional) - /// Contact id linked to a file (optional) - /// Company id linked to a file (optional) - /// Task of ApiResponse (FileData) - System.Threading.Tasks.Task> CrmFilesPostAsyncWithHttpInfo (System.IO.Stream file, string dealId = null, long? contactId = null, string companyId = null); - #endregion Asynchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public partial class FilesApi : IFilesApi - { - private sib_api_v3_sdk.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// - /// - public FilesApi(String basePath) - { - this.Configuration = new sib_api_v3_sdk.Client.Configuration { BasePath = basePath }; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using Configuration object - /// - /// An instance of Configuration - /// - public FilesApi(sib_api_v3_sdk.Client.Configuration configuration = null) - { - if (configuration == null) // use the default one in Configuration - this.Configuration = sib_api_v3_sdk.Client.Configuration.Default; - else - this.Configuration = configuration; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] - public void SetBasePath(String basePath) - { - // do nothing - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public sib_api_v3_sdk.Client.Configuration Configuration {get; set;} - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public sib_api_v3_sdk.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - /// - /// Gets the default header. - /// - /// Dictionary of HTTP header - [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] - public IDictionary DefaultHeader() - { - return new ReadOnlyDictionary(this.Configuration.DefaultHeader); - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] - public void AddDefaultHeader(string key, string value) - { - this.Configuration.AddDefaultHeader(key, value); - } - - /// - /// Get all files - /// - /// Thrown when fails to make API call - /// Filter by file entity type (optional) - /// Filter by file entity IDs (optional) - /// dateFrom to date range filter type (timestamp in milliseconds) (optional) - /// dateTo to date range filter type (timestamp in milliseconds) (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// FileList - public FileList CrmFilesGet (string entity = null, string entityIds = null, int? dateFrom = null, int? dateTo = null, long? offset = null, long? limit = null, string sort = null) - { - ApiResponse localVarResponse = CrmFilesGetWithHttpInfo(entity, entityIds, dateFrom, dateTo, offset, limit, sort); - return localVarResponse.Data; - } - - /// - /// Get all files - /// - /// Thrown when fails to make API call - /// Filter by file entity type (optional) - /// Filter by file entity IDs (optional) - /// dateFrom to date range filter type (timestamp in milliseconds) (optional) - /// dateTo to date range filter type (timestamp in milliseconds) (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// ApiResponse of FileList - public ApiResponse< FileList > CrmFilesGetWithHttpInfo (string entity = null, string entityIds = null, int? dateFrom = null, int? dateTo = null, long? offset = null, long? limit = null, string sort = null) - { - - var localVarPath = "./crm/files"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (entity != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "entity", entity)); // query parameter - if (entityIds != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "entityIds", entityIds)); // query parameter - if (dateFrom != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "dateFrom", dateFrom)); // query parameter - if (dateTo != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "dateTo", dateTo)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmFilesGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (FileList) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(FileList))); - } - - /// - /// Get all files - /// - /// Thrown when fails to make API call - /// Filter by file entity type (optional) - /// Filter by file entity IDs (optional) - /// dateFrom to date range filter type (timestamp in milliseconds) (optional) - /// dateTo to date range filter type (timestamp in milliseconds) (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// Task of FileList - public async System.Threading.Tasks.Task CrmFilesGetAsync (string entity = null, string entityIds = null, int? dateFrom = null, int? dateTo = null, long? offset = null, long? limit = null, string sort = null) - { - ApiResponse localVarResponse = await CrmFilesGetAsyncWithHttpInfo(entity, entityIds, dateFrom, dateTo, offset, limit, sort); - return localVarResponse.Data; - - } - - /// - /// Get all files - /// - /// Thrown when fails to make API call - /// Filter by file entity type (optional) - /// Filter by file entity IDs (optional) - /// dateFrom to date range filter type (timestamp in milliseconds) (optional) - /// dateTo to date range filter type (timestamp in milliseconds) (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// Task of ApiResponse (FileList) - public async System.Threading.Tasks.Task> CrmFilesGetAsyncWithHttpInfo (string entity = null, string entityIds = null, int? dateFrom = null, int? dateTo = null, long? offset = null, long? limit = null, string sort = null) - { - - var localVarPath = "./crm/files"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (entity != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "entity", entity)); // query parameter - if (entityIds != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "entityIds", entityIds)); // query parameter - if (dateFrom != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "dateFrom", dateFrom)); // query parameter - if (dateTo != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "dateTo", dateTo)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmFilesGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (FileList) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(FileList))); - } - - /// - /// Get file details - /// - /// Thrown when fails to make API call - /// File id to get file data. - /// FileData - public FileData CrmFilesIdDataGet (string id) - { - ApiResponse localVarResponse = CrmFilesIdDataGetWithHttpInfo(id); - return localVarResponse.Data; - } - - /// - /// Get file details - /// - /// Thrown when fails to make API call - /// File id to get file data. - /// ApiResponse of FileData - public ApiResponse< FileData > CrmFilesIdDataGetWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling FilesApi->CrmFilesIdDataGet"); - - var localVarPath = "./crm/files/{id}/data"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmFilesIdDataGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (FileData) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(FileData))); - } - - /// - /// Get file details - /// - /// Thrown when fails to make API call - /// File id to get file data. - /// Task of FileData - public async System.Threading.Tasks.Task CrmFilesIdDataGetAsync (string id) - { - ApiResponse localVarResponse = await CrmFilesIdDataGetAsyncWithHttpInfo(id); - return localVarResponse.Data; - - } - - /// - /// Get file details - /// - /// Thrown when fails to make API call - /// File id to get file data. - /// Task of ApiResponse (FileData) - public async System.Threading.Tasks.Task> CrmFilesIdDataGetAsyncWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling FilesApi->CrmFilesIdDataGet"); - - var localVarPath = "./crm/files/{id}/data"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmFilesIdDataGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (FileData) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(FileData))); - } - - /// - /// Delete a file - /// - /// Thrown when fails to make API call - /// File id to delete. - /// - public void CrmFilesIdDelete (string id) - { - CrmFilesIdDeleteWithHttpInfo(id); - } - - /// - /// Delete a file - /// - /// Thrown when fails to make API call - /// File id to delete. - /// ApiResponse of Object(void) - public ApiResponse CrmFilesIdDeleteWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling FilesApi->CrmFilesIdDelete"); - - var localVarPath = "./crm/files/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmFilesIdDelete", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete a file - /// - /// Thrown when fails to make API call - /// File id to delete. - /// Task of void - public async System.Threading.Tasks.Task CrmFilesIdDeleteAsync (string id) - { - await CrmFilesIdDeleteAsyncWithHttpInfo(id); - - } - - /// - /// Delete a file - /// - /// Thrown when fails to make API call - /// File id to delete. - /// Task of ApiResponse - public async System.Threading.Tasks.Task> CrmFilesIdDeleteAsyncWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling FilesApi->CrmFilesIdDelete"); - - var localVarPath = "./crm/files/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmFilesIdDelete", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Download a file - /// - /// Thrown when fails to make API call - /// File id to download. - /// FileDownloadableLink - public FileDownloadableLink CrmFilesIdGet (string id) - { - ApiResponse localVarResponse = CrmFilesIdGetWithHttpInfo(id); - return localVarResponse.Data; - } - - /// - /// Download a file - /// - /// Thrown when fails to make API call - /// File id to download. - /// ApiResponse of FileDownloadableLink - public ApiResponse< FileDownloadableLink > CrmFilesIdGetWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling FilesApi->CrmFilesIdGet"); - - var localVarPath = "./crm/files/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmFilesIdGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (FileDownloadableLink) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(FileDownloadableLink))); - } - - /// - /// Download a file - /// - /// Thrown when fails to make API call - /// File id to download. - /// Task of FileDownloadableLink - public async System.Threading.Tasks.Task CrmFilesIdGetAsync (string id) - { - ApiResponse localVarResponse = await CrmFilesIdGetAsyncWithHttpInfo(id); - return localVarResponse.Data; - - } - - /// - /// Download a file - /// - /// Thrown when fails to make API call - /// File id to download. - /// Task of ApiResponse (FileDownloadableLink) - public async System.Threading.Tasks.Task> CrmFilesIdGetAsyncWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling FilesApi->CrmFilesIdGet"); - - var localVarPath = "./crm/files/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmFilesIdGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (FileDownloadableLink) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(FileDownloadableLink))); - } - - /// - /// Upload a file - /// - /// Thrown when fails to make API call - /// File data to create a file. - /// Deal id linked to a file (optional) - /// Contact id linked to a file (optional) - /// Company id linked to a file (optional) - /// FileData - public FileData CrmFilesPost (System.IO.Stream file, string dealId = null, long? contactId = null, string companyId = null) - { - ApiResponse localVarResponse = CrmFilesPostWithHttpInfo(file, dealId, contactId, companyId); - return localVarResponse.Data; - } - - /// - /// Upload a file - /// - /// Thrown when fails to make API call - /// File data to create a file. - /// Deal id linked to a file (optional) - /// Contact id linked to a file (optional) - /// Company id linked to a file (optional) - /// ApiResponse of FileData - public ApiResponse< FileData > CrmFilesPostWithHttpInfo (System.IO.Stream file, string dealId = null, long? contactId = null, string companyId = null) - { - // verify the required parameter 'file' is set - if (file == null) - throw new ApiException(400, "Missing required parameter 'file' when calling FilesApi->CrmFilesPost"); - - var localVarPath = "./crm/files"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "multipart/form-data" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (file != null) localVarFileParams.Add("file", this.Configuration.ApiClient.ParameterToFile("file", file)); - if (dealId != null) localVarFormParams.Add("dealId", this.Configuration.ApiClient.ParameterToString(dealId)); // form parameter - if (contactId != null) localVarFormParams.Add("contactId", this.Configuration.ApiClient.ParameterToString(contactId)); // form parameter - if (companyId != null) localVarFormParams.Add("companyId", this.Configuration.ApiClient.ParameterToString(companyId)); // form parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmFilesPost", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (FileData) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(FileData))); - } - - /// - /// Upload a file - /// - /// Thrown when fails to make API call - /// File data to create a file. - /// Deal id linked to a file (optional) - /// Contact id linked to a file (optional) - /// Company id linked to a file (optional) - /// Task of FileData - public async System.Threading.Tasks.Task CrmFilesPostAsync (System.IO.Stream file, string dealId = null, long? contactId = null, string companyId = null) - { - ApiResponse localVarResponse = await CrmFilesPostAsyncWithHttpInfo(file, dealId, contactId, companyId); - return localVarResponse.Data; - - } - - /// - /// Upload a file - /// - /// Thrown when fails to make API call - /// File data to create a file. - /// Deal id linked to a file (optional) - /// Contact id linked to a file (optional) - /// Company id linked to a file (optional) - /// Task of ApiResponse (FileData) - public async System.Threading.Tasks.Task> CrmFilesPostAsyncWithHttpInfo (System.IO.Stream file, string dealId = null, long? contactId = null, string companyId = null) - { - // verify the required parameter 'file' is set - if (file == null) - throw new ApiException(400, "Missing required parameter 'file' when calling FilesApi->CrmFilesPost"); - - var localVarPath = "./crm/files"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "multipart/form-data" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (file != null) localVarFileParams.Add("file", this.Configuration.ApiClient.ParameterToFile("file", file)); - if (dealId != null) localVarFormParams.Add("dealId", this.Configuration.ApiClient.ParameterToString(dealId)); // form parameter - if (contactId != null) localVarFormParams.Add("contactId", this.Configuration.ApiClient.ParameterToString(contactId)); // form parameter - if (companyId != null) localVarFormParams.Add("companyId", this.Configuration.ApiClient.ParameterToString(companyId)); // form parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmFilesPost", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (FileData) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(FileData))); - } - - } -} diff --git a/src/sib_api_v3_sdk/Api/InboundParsingApi.cs b/src/sib_api_v3_sdk/Api/InboundParsingApi.cs deleted file mode 100644 index a1ca2be..0000000 --- a/src/sib_api_v3_sdk/Api/InboundParsingApi.cs +++ /dev/null @@ -1,765 +0,0 @@ -/* - * SendinBlue API - * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :- -- -- -- -- -- --: | - -- -- -- -- -- -- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | - * - * OpenAPI spec version: 3.0.0 - * Contact: contact@sendinblue.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using RestSharp.Portable; -using sib_api_v3_sdk.Client; -using sib_api_v3_sdk.Model; - -namespace sib_api_v3_sdk.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IInboundParsingApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Retrieve inbound attachment with download token. - /// - /// - /// This endpoint will retrieve inbound attachment with download token. - /// - /// Thrown when fails to make API call - /// Token to fetch a particular attachment - /// System.IO.Stream - System.IO.Stream GetInboundEmailAttachment (string downloadToken); - - /// - /// Retrieve inbound attachment with download token. - /// - /// - /// This endpoint will retrieve inbound attachment with download token. - /// - /// Thrown when fails to make API call - /// Token to fetch a particular attachment - /// ApiResponse of System.IO.Stream - ApiResponse GetInboundEmailAttachmentWithHttpInfo (string downloadToken); - /// - /// Get the list of all the events for the received emails. - /// - /// - /// This endpoint will show the list of all the events for the received emails. - /// - /// Thrown when fails to make API call - /// Email address of the sender. (optional) - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Number of documents returned per page (optional, default to 100) - /// Index of the first document on the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation (optional, default to desc) - /// GetInboundEmailEvents - GetInboundEmailEvents GetInboundEmailEvents (string sender = null, DateTime? startDate = null, DateTime? endDate = null, long? limit = null, long? offset = null, string sort = null); - - /// - /// Get the list of all the events for the received emails. - /// - /// - /// This endpoint will show the list of all the events for the received emails. - /// - /// Thrown when fails to make API call - /// Email address of the sender. (optional) - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Number of documents returned per page (optional, default to 100) - /// Index of the first document on the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation (optional, default to desc) - /// ApiResponse of GetInboundEmailEvents - ApiResponse GetInboundEmailEventsWithHttpInfo (string sender = null, DateTime? startDate = null, DateTime? endDate = null, long? limit = null, long? offset = null, string sort = null); - /// - /// Fetch all events history for one particular received email. - /// - /// - /// This endpoint will show the list of all events history for one particular received email. - /// - /// Thrown when fails to make API call - /// UUID to fetch events specific to recieved email - /// GetInboundEmailEventsByUuid - GetInboundEmailEventsByUuid GetInboundEmailEventsByUuid (string uuid); - - /// - /// Fetch all events history for one particular received email. - /// - /// - /// This endpoint will show the list of all events history for one particular received email. - /// - /// Thrown when fails to make API call - /// UUID to fetch events specific to recieved email - /// ApiResponse of GetInboundEmailEventsByUuid - ApiResponse GetInboundEmailEventsByUuidWithHttpInfo (string uuid); - #endregion Synchronous Operations - #region Asynchronous Operations - /// - /// Retrieve inbound attachment with download token. - /// - /// - /// This endpoint will retrieve inbound attachment with download token. - /// - /// Thrown when fails to make API call - /// Token to fetch a particular attachment - /// Task of System.IO.Stream - System.Threading.Tasks.Task GetInboundEmailAttachmentAsync (string downloadToken); - - /// - /// Retrieve inbound attachment with download token. - /// - /// - /// This endpoint will retrieve inbound attachment with download token. - /// - /// Thrown when fails to make API call - /// Token to fetch a particular attachment - /// Task of ApiResponse (System.IO.Stream) - System.Threading.Tasks.Task> GetInboundEmailAttachmentAsyncWithHttpInfo (string downloadToken); - /// - /// Get the list of all the events for the received emails. - /// - /// - /// This endpoint will show the list of all the events for the received emails. - /// - /// Thrown when fails to make API call - /// Email address of the sender. (optional) - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Number of documents returned per page (optional, default to 100) - /// Index of the first document on the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation (optional, default to desc) - /// Task of GetInboundEmailEvents - System.Threading.Tasks.Task GetInboundEmailEventsAsync (string sender = null, DateTime? startDate = null, DateTime? endDate = null, long? limit = null, long? offset = null, string sort = null); - - /// - /// Get the list of all the events for the received emails. - /// - /// - /// This endpoint will show the list of all the events for the received emails. - /// - /// Thrown when fails to make API call - /// Email address of the sender. (optional) - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Number of documents returned per page (optional, default to 100) - /// Index of the first document on the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation (optional, default to desc) - /// Task of ApiResponse (GetInboundEmailEvents) - System.Threading.Tasks.Task> GetInboundEmailEventsAsyncWithHttpInfo (string sender = null, DateTime? startDate = null, DateTime? endDate = null, long? limit = null, long? offset = null, string sort = null); - /// - /// Fetch all events history for one particular received email. - /// - /// - /// This endpoint will show the list of all events history for one particular received email. - /// - /// Thrown when fails to make API call - /// UUID to fetch events specific to recieved email - /// Task of GetInboundEmailEventsByUuid - System.Threading.Tasks.Task GetInboundEmailEventsByUuidAsync (string uuid); - - /// - /// Fetch all events history for one particular received email. - /// - /// - /// This endpoint will show the list of all events history for one particular received email. - /// - /// Thrown when fails to make API call - /// UUID to fetch events specific to recieved email - /// Task of ApiResponse (GetInboundEmailEventsByUuid) - System.Threading.Tasks.Task> GetInboundEmailEventsByUuidAsyncWithHttpInfo (string uuid); - #endregion Asynchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public partial class InboundParsingApi : IInboundParsingApi - { - private sib_api_v3_sdk.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// - /// - public InboundParsingApi(String basePath) - { - this.Configuration = new sib_api_v3_sdk.Client.Configuration { BasePath = basePath }; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using Configuration object - /// - /// An instance of Configuration - /// - public InboundParsingApi(sib_api_v3_sdk.Client.Configuration configuration = null) - { - if (configuration == null) // use the default one in Configuration - this.Configuration = sib_api_v3_sdk.Client.Configuration.Default; - else - this.Configuration = configuration; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] - public void SetBasePath(String basePath) - { - // do nothing - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public sib_api_v3_sdk.Client.Configuration Configuration {get; set;} - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public sib_api_v3_sdk.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - /// - /// Gets the default header. - /// - /// Dictionary of HTTP header - [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] - public IDictionary DefaultHeader() - { - return new ReadOnlyDictionary(this.Configuration.DefaultHeader); - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] - public void AddDefaultHeader(string key, string value) - { - this.Configuration.AddDefaultHeader(key, value); - } - - /// - /// Retrieve inbound attachment with download token. This endpoint will retrieve inbound attachment with download token. - /// - /// Thrown when fails to make API call - /// Token to fetch a particular attachment - /// System.IO.Stream - public System.IO.Stream GetInboundEmailAttachment (string downloadToken) - { - ApiResponse localVarResponse = GetInboundEmailAttachmentWithHttpInfo(downloadToken); - return localVarResponse.Data; - } - - /// - /// Retrieve inbound attachment with download token. This endpoint will retrieve inbound attachment with download token. - /// - /// Thrown when fails to make API call - /// Token to fetch a particular attachment - /// ApiResponse of System.IO.Stream - public ApiResponse< System.IO.Stream > GetInboundEmailAttachmentWithHttpInfo (string downloadToken) - { - // verify the required parameter 'downloadToken' is set - if (downloadToken == null) - throw new ApiException(400, "Missing required parameter 'downloadToken' when calling InboundParsingApi->GetInboundEmailAttachment"); - - var localVarPath = "./inbound/attachments/{downloadToken}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (downloadToken != null) localVarPathParams.Add("downloadToken", this.Configuration.ApiClient.ParameterToString(downloadToken)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetInboundEmailAttachment", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (System.IO.Stream) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(System.IO.Stream))); - } - - /// - /// Retrieve inbound attachment with download token. This endpoint will retrieve inbound attachment with download token. - /// - /// Thrown when fails to make API call - /// Token to fetch a particular attachment - /// Task of System.IO.Stream - public async System.Threading.Tasks.Task GetInboundEmailAttachmentAsync (string downloadToken) - { - ApiResponse localVarResponse = await GetInboundEmailAttachmentAsyncWithHttpInfo(downloadToken); - return localVarResponse.Data; - - } - - /// - /// Retrieve inbound attachment with download token. This endpoint will retrieve inbound attachment with download token. - /// - /// Thrown when fails to make API call - /// Token to fetch a particular attachment - /// Task of ApiResponse (System.IO.Stream) - public async System.Threading.Tasks.Task> GetInboundEmailAttachmentAsyncWithHttpInfo (string downloadToken) - { - // verify the required parameter 'downloadToken' is set - if (downloadToken == null) - throw new ApiException(400, "Missing required parameter 'downloadToken' when calling InboundParsingApi->GetInboundEmailAttachment"); - - var localVarPath = "./inbound/attachments/{downloadToken}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (downloadToken != null) localVarPathParams.Add("downloadToken", this.Configuration.ApiClient.ParameterToString(downloadToken)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetInboundEmailAttachment", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (System.IO.Stream) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(System.IO.Stream))); - } - - /// - /// Get the list of all the events for the received emails. This endpoint will show the list of all the events for the received emails. - /// - /// Thrown when fails to make API call - /// Email address of the sender. (optional) - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Number of documents returned per page (optional, default to 100) - /// Index of the first document on the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation (optional, default to desc) - /// GetInboundEmailEvents - public GetInboundEmailEvents GetInboundEmailEvents (string sender = null, DateTime? startDate = null, DateTime? endDate = null, long? limit = null, long? offset = null, string sort = null) - { - ApiResponse localVarResponse = GetInboundEmailEventsWithHttpInfo(sender, startDate, endDate, limit, offset, sort); - return localVarResponse.Data; - } - - /// - /// Get the list of all the events for the received emails. This endpoint will show the list of all the events for the received emails. - /// - /// Thrown when fails to make API call - /// Email address of the sender. (optional) - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Number of documents returned per page (optional, default to 100) - /// Index of the first document on the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation (optional, default to desc) - /// ApiResponse of GetInboundEmailEvents - public ApiResponse< GetInboundEmailEvents > GetInboundEmailEventsWithHttpInfo (string sender = null, DateTime? startDate = null, DateTime? endDate = null, long? limit = null, long? offset = null, string sort = null) - { - - var localVarPath = "./inbound/events"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (sender != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sender", sender)); // query parameter - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetInboundEmailEvents", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetInboundEmailEvents) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetInboundEmailEvents))); - } - - /// - /// Get the list of all the events for the received emails. This endpoint will show the list of all the events for the received emails. - /// - /// Thrown when fails to make API call - /// Email address of the sender. (optional) - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Number of documents returned per page (optional, default to 100) - /// Index of the first document on the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation (optional, default to desc) - /// Task of GetInboundEmailEvents - public async System.Threading.Tasks.Task GetInboundEmailEventsAsync (string sender = null, DateTime? startDate = null, DateTime? endDate = null, long? limit = null, long? offset = null, string sort = null) - { - ApiResponse localVarResponse = await GetInboundEmailEventsAsyncWithHttpInfo(sender, startDate, endDate, limit, offset, sort); - return localVarResponse.Data; - - } - - /// - /// Get the list of all the events for the received emails. This endpoint will show the list of all the events for the received emails. - /// - /// Thrown when fails to make API call - /// Email address of the sender. (optional) - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Number of documents returned per page (optional, default to 100) - /// Index of the first document on the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation (optional, default to desc) - /// Task of ApiResponse (GetInboundEmailEvents) - public async System.Threading.Tasks.Task> GetInboundEmailEventsAsyncWithHttpInfo (string sender = null, DateTime? startDate = null, DateTime? endDate = null, long? limit = null, long? offset = null, string sort = null) - { - - var localVarPath = "./inbound/events"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (sender != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sender", sender)); // query parameter - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetInboundEmailEvents", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetInboundEmailEvents) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetInboundEmailEvents))); - } - - /// - /// Fetch all events history for one particular received email. This endpoint will show the list of all events history for one particular received email. - /// - /// Thrown when fails to make API call - /// UUID to fetch events specific to recieved email - /// GetInboundEmailEventsByUuid - public GetInboundEmailEventsByUuid GetInboundEmailEventsByUuid (string uuid) - { - ApiResponse localVarResponse = GetInboundEmailEventsByUuidWithHttpInfo(uuid); - return localVarResponse.Data; - } - - /// - /// Fetch all events history for one particular received email. This endpoint will show the list of all events history for one particular received email. - /// - /// Thrown when fails to make API call - /// UUID to fetch events specific to recieved email - /// ApiResponse of GetInboundEmailEventsByUuid - public ApiResponse< GetInboundEmailEventsByUuid > GetInboundEmailEventsByUuidWithHttpInfo (string uuid) - { - // verify the required parameter 'uuid' is set - if (uuid == null) - throw new ApiException(400, "Missing required parameter 'uuid' when calling InboundParsingApi->GetInboundEmailEventsByUuid"); - - var localVarPath = "./inbound/events/{uuid}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (uuid != null) localVarPathParams.Add("uuid", this.Configuration.ApiClient.ParameterToString(uuid)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetInboundEmailEventsByUuid", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetInboundEmailEventsByUuid) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetInboundEmailEventsByUuid))); - } - - /// - /// Fetch all events history for one particular received email. This endpoint will show the list of all events history for one particular received email. - /// - /// Thrown when fails to make API call - /// UUID to fetch events specific to recieved email - /// Task of GetInboundEmailEventsByUuid - public async System.Threading.Tasks.Task GetInboundEmailEventsByUuidAsync (string uuid) - { - ApiResponse localVarResponse = await GetInboundEmailEventsByUuidAsyncWithHttpInfo(uuid); - return localVarResponse.Data; - - } - - /// - /// Fetch all events history for one particular received email. This endpoint will show the list of all events history for one particular received email. - /// - /// Thrown when fails to make API call - /// UUID to fetch events specific to recieved email - /// Task of ApiResponse (GetInboundEmailEventsByUuid) - public async System.Threading.Tasks.Task> GetInboundEmailEventsByUuidAsyncWithHttpInfo (string uuid) - { - // verify the required parameter 'uuid' is set - if (uuid == null) - throw new ApiException(400, "Missing required parameter 'uuid' when calling InboundParsingApi->GetInboundEmailEventsByUuid"); - - var localVarPath = "./inbound/events/{uuid}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (uuid != null) localVarPathParams.Add("uuid", this.Configuration.ApiClient.ParameterToString(uuid)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetInboundEmailEventsByUuid", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetInboundEmailEventsByUuid) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetInboundEmailEventsByUuid))); - } - - } -} diff --git a/src/sib_api_v3_sdk/Api/MasterAccountApi.cs b/src/sib_api_v3_sdk/Api/MasterAccountApi.cs deleted file mode 100644 index 215d805..0000000 --- a/src/sib_api_v3_sdk/Api/MasterAccountApi.cs +++ /dev/null @@ -1,1774 +0,0 @@ -/* - * SendinBlue API - * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :- -- -- -- -- -- --: | - -- -- -- -- -- -- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | - * - * OpenAPI spec version: 3.0.0 - * Contact: contact@sendinblue.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using RestSharp.Portable; -using sib_api_v3_sdk.Client; -using sib_api_v3_sdk.Model; - -namespace sib_api_v3_sdk.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IMasterAccountApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Get the details of requested master account - /// - /// - /// This endpoint will provide the details of the master account. - /// - /// Thrown when fails to make API call - /// MasterDetailsResponse - MasterDetailsResponse CorporateMasterAccountGet (); - - /// - /// Get the details of requested master account - /// - /// - /// This endpoint will provide the details of the master account. - /// - /// Thrown when fails to make API call - /// ApiResponse of MasterDetailsResponse - ApiResponse CorporateMasterAccountGetWithHttpInfo (); - /// - /// Get the list of all the sub-accounts of the master account. - /// - /// - /// This endpoint will provide the list all the sub-accounts of the master account. - /// - /// Thrown when fails to make API call - /// Index of the first sub-account in the page - /// Number of sub-accounts to be displayed on each page - /// SubAccountsResponse - SubAccountsResponse CorporateSubAccountGet (int? offset, int? limit); - - /// - /// Get the list of all the sub-accounts of the master account. - /// - /// - /// This endpoint will provide the list all the sub-accounts of the master account. - /// - /// Thrown when fails to make API call - /// Index of the first sub-account in the page - /// Number of sub-accounts to be displayed on each page - /// ApiResponse of SubAccountsResponse - ApiResponse CorporateSubAccountGetWithHttpInfo (int? offset, int? limit); - /// - /// Delete a sub-account - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the sub-account organization to be deleted - /// - void CorporateSubAccountIdDelete (long? id); - - /// - /// Delete a sub-account - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the sub-account organization to be deleted - /// ApiResponse of Object(void) - ApiResponse CorporateSubAccountIdDeleteWithHttpInfo (long? id); - /// - /// Get sub-account details - /// - /// - /// This endpoint will provide the details for the specified sub-account company - /// - /// Thrown when fails to make API call - /// Id of the sub-account organization - /// SubAccountDetailsResponse - SubAccountDetailsResponse CorporateSubAccountIdGet (long? id); - - /// - /// Get sub-account details - /// - /// - /// This endpoint will provide the details for the specified sub-account company - /// - /// Thrown when fails to make API call - /// Id of the sub-account organization - /// ApiResponse of SubAccountDetailsResponse - ApiResponse CorporateSubAccountIdGetWithHttpInfo (long? id); - /// - /// Update sub-account plan - /// - /// - /// This endpoint will update the sub-account plan - /// - /// Thrown when fails to make API call - /// Id of the sub-account organization - /// Values to update a sub-account plan - /// - void CorporateSubAccountIdPlanPut (long? id, SubAccountUpdatePlanRequest updatePlanDetails); - - /// - /// Update sub-account plan - /// - /// - /// This endpoint will update the sub-account plan - /// - /// Thrown when fails to make API call - /// Id of the sub-account organization - /// Values to update a sub-account plan - /// ApiResponse of Object(void) - ApiResponse CorporateSubAccountIdPlanPutWithHttpInfo (long? id, SubAccountUpdatePlanRequest updatePlanDetails); - /// - /// Create an API key for a sub-account - /// - /// - /// This endpoint will generate an API v3 key for a sub account - /// - /// Thrown when fails to make API call - /// Values to generate API key for sub-account - /// CreateApiKeyResponse - CreateApiKeyResponse CorporateSubAccountKeyPost (CreateApiKeyRequest createApiKeyRequest); - - /// - /// Create an API key for a sub-account - /// - /// - /// This endpoint will generate an API v3 key for a sub account - /// - /// Thrown when fails to make API call - /// Values to generate API key for sub-account - /// ApiResponse of CreateApiKeyResponse - ApiResponse CorporateSubAccountKeyPostWithHttpInfo (CreateApiKeyRequest createApiKeyRequest); - /// - /// Create a new sub-account under a master account. - /// - /// - /// This endpoint will create a new sub-account under a master account - /// - /// Thrown when fails to make API call - /// values to create new sub-account - /// CreateSubAccountResponse - CreateSubAccountResponse CorporateSubAccountPost (CreateSubAccount subAccountCreate); - - /// - /// Create a new sub-account under a master account. - /// - /// - /// This endpoint will create a new sub-account under a master account - /// - /// Thrown when fails to make API call - /// values to create new sub-account - /// ApiResponse of CreateSubAccountResponse - ApiResponse CorporateSubAccountPostWithHttpInfo (CreateSubAccount subAccountCreate); - /// - /// Generate SSO token to access Sendinblue - /// - /// - /// This endpoint generates an sso token to authenticate and access a sub-account of the master using the account endpoint https://account-app.sendinblue.com/account/login/sub-account/sso/[token], where [token] will be replaced by the actual token. - /// - /// Thrown when fails to make API call - /// Values to generate SSO token for sub-account - /// GetSsoToken - GetSsoToken CorporateSubAccountSsoTokenPost (SsoTokenRequest ssoTokenRequest); - - /// - /// Generate SSO token to access Sendinblue - /// - /// - /// This endpoint generates an sso token to authenticate and access a sub-account of the master using the account endpoint https://account-app.sendinblue.com/account/login/sub-account/sso/[token], where [token] will be replaced by the actual token. - /// - /// Thrown when fails to make API call - /// Values to generate SSO token for sub-account - /// ApiResponse of GetSsoToken - ApiResponse CorporateSubAccountSsoTokenPostWithHttpInfo (SsoTokenRequest ssoTokenRequest); - #endregion Synchronous Operations - #region Asynchronous Operations - /// - /// Get the details of requested master account - /// - /// - /// This endpoint will provide the details of the master account. - /// - /// Thrown when fails to make API call - /// Task of MasterDetailsResponse - System.Threading.Tasks.Task CorporateMasterAccountGetAsync (); - - /// - /// Get the details of requested master account - /// - /// - /// This endpoint will provide the details of the master account. - /// - /// Thrown when fails to make API call - /// Task of ApiResponse (MasterDetailsResponse) - System.Threading.Tasks.Task> CorporateMasterAccountGetAsyncWithHttpInfo (); - /// - /// Get the list of all the sub-accounts of the master account. - /// - /// - /// This endpoint will provide the list all the sub-accounts of the master account. - /// - /// Thrown when fails to make API call - /// Index of the first sub-account in the page - /// Number of sub-accounts to be displayed on each page - /// Task of SubAccountsResponse - System.Threading.Tasks.Task CorporateSubAccountGetAsync (int? offset, int? limit); - - /// - /// Get the list of all the sub-accounts of the master account. - /// - /// - /// This endpoint will provide the list all the sub-accounts of the master account. - /// - /// Thrown when fails to make API call - /// Index of the first sub-account in the page - /// Number of sub-accounts to be displayed on each page - /// Task of ApiResponse (SubAccountsResponse) - System.Threading.Tasks.Task> CorporateSubAccountGetAsyncWithHttpInfo (int? offset, int? limit); - /// - /// Delete a sub-account - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the sub-account organization to be deleted - /// Task of void - System.Threading.Tasks.Task CorporateSubAccountIdDeleteAsync (long? id); - - /// - /// Delete a sub-account - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the sub-account organization to be deleted - /// Task of ApiResponse - System.Threading.Tasks.Task> CorporateSubAccountIdDeleteAsyncWithHttpInfo (long? id); - /// - /// Get sub-account details - /// - /// - /// This endpoint will provide the details for the specified sub-account company - /// - /// Thrown when fails to make API call - /// Id of the sub-account organization - /// Task of SubAccountDetailsResponse - System.Threading.Tasks.Task CorporateSubAccountIdGetAsync (long? id); - - /// - /// Get sub-account details - /// - /// - /// This endpoint will provide the details for the specified sub-account company - /// - /// Thrown when fails to make API call - /// Id of the sub-account organization - /// Task of ApiResponse (SubAccountDetailsResponse) - System.Threading.Tasks.Task> CorporateSubAccountIdGetAsyncWithHttpInfo (long? id); - /// - /// Update sub-account plan - /// - /// - /// This endpoint will update the sub-account plan - /// - /// Thrown when fails to make API call - /// Id of the sub-account organization - /// Values to update a sub-account plan - /// Task of void - System.Threading.Tasks.Task CorporateSubAccountIdPlanPutAsync (long? id, SubAccountUpdatePlanRequest updatePlanDetails); - - /// - /// Update sub-account plan - /// - /// - /// This endpoint will update the sub-account plan - /// - /// Thrown when fails to make API call - /// Id of the sub-account organization - /// Values to update a sub-account plan - /// Task of ApiResponse - System.Threading.Tasks.Task> CorporateSubAccountIdPlanPutAsyncWithHttpInfo (long? id, SubAccountUpdatePlanRequest updatePlanDetails); - /// - /// Create an API key for a sub-account - /// - /// - /// This endpoint will generate an API v3 key for a sub account - /// - /// Thrown when fails to make API call - /// Values to generate API key for sub-account - /// Task of CreateApiKeyResponse - System.Threading.Tasks.Task CorporateSubAccountKeyPostAsync (CreateApiKeyRequest createApiKeyRequest); - - /// - /// Create an API key for a sub-account - /// - /// - /// This endpoint will generate an API v3 key for a sub account - /// - /// Thrown when fails to make API call - /// Values to generate API key for sub-account - /// Task of ApiResponse (CreateApiKeyResponse) - System.Threading.Tasks.Task> CorporateSubAccountKeyPostAsyncWithHttpInfo (CreateApiKeyRequest createApiKeyRequest); - /// - /// Create a new sub-account under a master account. - /// - /// - /// This endpoint will create a new sub-account under a master account - /// - /// Thrown when fails to make API call - /// values to create new sub-account - /// Task of CreateSubAccountResponse - System.Threading.Tasks.Task CorporateSubAccountPostAsync (CreateSubAccount subAccountCreate); - - /// - /// Create a new sub-account under a master account. - /// - /// - /// This endpoint will create a new sub-account under a master account - /// - /// Thrown when fails to make API call - /// values to create new sub-account - /// Task of ApiResponse (CreateSubAccountResponse) - System.Threading.Tasks.Task> CorporateSubAccountPostAsyncWithHttpInfo (CreateSubAccount subAccountCreate); - /// - /// Generate SSO token to access Sendinblue - /// - /// - /// This endpoint generates an sso token to authenticate and access a sub-account of the master using the account endpoint https://account-app.sendinblue.com/account/login/sub-account/sso/[token], where [token] will be replaced by the actual token. - /// - /// Thrown when fails to make API call - /// Values to generate SSO token for sub-account - /// Task of GetSsoToken - System.Threading.Tasks.Task CorporateSubAccountSsoTokenPostAsync (SsoTokenRequest ssoTokenRequest); - - /// - /// Generate SSO token to access Sendinblue - /// - /// - /// This endpoint generates an sso token to authenticate and access a sub-account of the master using the account endpoint https://account-app.sendinblue.com/account/login/sub-account/sso/[token], where [token] will be replaced by the actual token. - /// - /// Thrown when fails to make API call - /// Values to generate SSO token for sub-account - /// Task of ApiResponse (GetSsoToken) - System.Threading.Tasks.Task> CorporateSubAccountSsoTokenPostAsyncWithHttpInfo (SsoTokenRequest ssoTokenRequest); - #endregion Asynchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public partial class MasterAccountApi : IMasterAccountApi - { - private sib_api_v3_sdk.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// - /// - public MasterAccountApi(String basePath) - { - this.Configuration = new sib_api_v3_sdk.Client.Configuration { BasePath = basePath }; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using Configuration object - /// - /// An instance of Configuration - /// - public MasterAccountApi(sib_api_v3_sdk.Client.Configuration configuration = null) - { - if (configuration == null) // use the default one in Configuration - this.Configuration = sib_api_v3_sdk.Client.Configuration.Default; - else - this.Configuration = configuration; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] - public void SetBasePath(String basePath) - { - // do nothing - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public sib_api_v3_sdk.Client.Configuration Configuration {get; set;} - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public sib_api_v3_sdk.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - /// - /// Gets the default header. - /// - /// Dictionary of HTTP header - [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] - public IDictionary DefaultHeader() - { - return new ReadOnlyDictionary(this.Configuration.DefaultHeader); - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] - public void AddDefaultHeader(string key, string value) - { - this.Configuration.AddDefaultHeader(key, value); - } - - /// - /// Get the details of requested master account This endpoint will provide the details of the master account. - /// - /// Thrown when fails to make API call - /// MasterDetailsResponse - public MasterDetailsResponse CorporateMasterAccountGet () - { - ApiResponse localVarResponse = CorporateMasterAccountGetWithHttpInfo(); - return localVarResponse.Data; - } - - /// - /// Get the details of requested master account This endpoint will provide the details of the master account. - /// - /// Thrown when fails to make API call - /// ApiResponse of MasterDetailsResponse - public ApiResponse< MasterDetailsResponse > CorporateMasterAccountGetWithHttpInfo () - { - - var localVarPath = "./corporate/masterAccount"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CorporateMasterAccountGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (MasterDetailsResponse) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(MasterDetailsResponse))); - } - - /// - /// Get the details of requested master account This endpoint will provide the details of the master account. - /// - /// Thrown when fails to make API call - /// Task of MasterDetailsResponse - public async System.Threading.Tasks.Task CorporateMasterAccountGetAsync () - { - ApiResponse localVarResponse = await CorporateMasterAccountGetAsyncWithHttpInfo(); - return localVarResponse.Data; - - } - - /// - /// Get the details of requested master account This endpoint will provide the details of the master account. - /// - /// Thrown when fails to make API call - /// Task of ApiResponse (MasterDetailsResponse) - public async System.Threading.Tasks.Task> CorporateMasterAccountGetAsyncWithHttpInfo () - { - - var localVarPath = "./corporate/masterAccount"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CorporateMasterAccountGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (MasterDetailsResponse) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(MasterDetailsResponse))); - } - - /// - /// Get the list of all the sub-accounts of the master account. This endpoint will provide the list all the sub-accounts of the master account. - /// - /// Thrown when fails to make API call - /// Index of the first sub-account in the page - /// Number of sub-accounts to be displayed on each page - /// SubAccountsResponse - public SubAccountsResponse CorporateSubAccountGet (int? offset, int? limit) - { - ApiResponse localVarResponse = CorporateSubAccountGetWithHttpInfo(offset, limit); - return localVarResponse.Data; - } - - /// - /// Get the list of all the sub-accounts of the master account. This endpoint will provide the list all the sub-accounts of the master account. - /// - /// Thrown when fails to make API call - /// Index of the first sub-account in the page - /// Number of sub-accounts to be displayed on each page - /// ApiResponse of SubAccountsResponse - public ApiResponse< SubAccountsResponse > CorporateSubAccountGetWithHttpInfo (int? offset, int? limit) - { - // verify the required parameter 'offset' is set - if (offset == null) - throw new ApiException(400, "Missing required parameter 'offset' when calling MasterAccountApi->CorporateSubAccountGet"); - // verify the required parameter 'limit' is set - if (limit == null) - throw new ApiException(400, "Missing required parameter 'limit' when calling MasterAccountApi->CorporateSubAccountGet"); - - var localVarPath = "./corporate/subAccount"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CorporateSubAccountGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (SubAccountsResponse) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(SubAccountsResponse))); - } - - /// - /// Get the list of all the sub-accounts of the master account. This endpoint will provide the list all the sub-accounts of the master account. - /// - /// Thrown when fails to make API call - /// Index of the first sub-account in the page - /// Number of sub-accounts to be displayed on each page - /// Task of SubAccountsResponse - public async System.Threading.Tasks.Task CorporateSubAccountGetAsync (int? offset, int? limit) - { - ApiResponse localVarResponse = await CorporateSubAccountGetAsyncWithHttpInfo(offset, limit); - return localVarResponse.Data; - - } - - /// - /// Get the list of all the sub-accounts of the master account. This endpoint will provide the list all the sub-accounts of the master account. - /// - /// Thrown when fails to make API call - /// Index of the first sub-account in the page - /// Number of sub-accounts to be displayed on each page - /// Task of ApiResponse (SubAccountsResponse) - public async System.Threading.Tasks.Task> CorporateSubAccountGetAsyncWithHttpInfo (int? offset, int? limit) - { - // verify the required parameter 'offset' is set - if (offset == null) - throw new ApiException(400, "Missing required parameter 'offset' when calling MasterAccountApi->CorporateSubAccountGet"); - // verify the required parameter 'limit' is set - if (limit == null) - throw new ApiException(400, "Missing required parameter 'limit' when calling MasterAccountApi->CorporateSubAccountGet"); - - var localVarPath = "./corporate/subAccount"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CorporateSubAccountGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (SubAccountsResponse) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(SubAccountsResponse))); - } - - /// - /// Delete a sub-account - /// - /// Thrown when fails to make API call - /// Id of the sub-account organization to be deleted - /// - public void CorporateSubAccountIdDelete (long? id) - { - CorporateSubAccountIdDeleteWithHttpInfo(id); - } - - /// - /// Delete a sub-account - /// - /// Thrown when fails to make API call - /// Id of the sub-account organization to be deleted - /// ApiResponse of Object(void) - public ApiResponse CorporateSubAccountIdDeleteWithHttpInfo (long? id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling MasterAccountApi->CorporateSubAccountIdDelete"); - - var localVarPath = "./corporate/subAccount/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CorporateSubAccountIdDelete", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete a sub-account - /// - /// Thrown when fails to make API call - /// Id of the sub-account organization to be deleted - /// Task of void - public async System.Threading.Tasks.Task CorporateSubAccountIdDeleteAsync (long? id) - { - await CorporateSubAccountIdDeleteAsyncWithHttpInfo(id); - - } - - /// - /// Delete a sub-account - /// - /// Thrown when fails to make API call - /// Id of the sub-account organization to be deleted - /// Task of ApiResponse - public async System.Threading.Tasks.Task> CorporateSubAccountIdDeleteAsyncWithHttpInfo (long? id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling MasterAccountApi->CorporateSubAccountIdDelete"); - - var localVarPath = "./corporate/subAccount/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CorporateSubAccountIdDelete", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Get sub-account details This endpoint will provide the details for the specified sub-account company - /// - /// Thrown when fails to make API call - /// Id of the sub-account organization - /// SubAccountDetailsResponse - public SubAccountDetailsResponse CorporateSubAccountIdGet (long? id) - { - ApiResponse localVarResponse = CorporateSubAccountIdGetWithHttpInfo(id); - return localVarResponse.Data; - } - - /// - /// Get sub-account details This endpoint will provide the details for the specified sub-account company - /// - /// Thrown when fails to make API call - /// Id of the sub-account organization - /// ApiResponse of SubAccountDetailsResponse - public ApiResponse< SubAccountDetailsResponse > CorporateSubAccountIdGetWithHttpInfo (long? id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling MasterAccountApi->CorporateSubAccountIdGet"); - - var localVarPath = "./corporate/subAccount/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CorporateSubAccountIdGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (SubAccountDetailsResponse) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(SubAccountDetailsResponse))); - } - - /// - /// Get sub-account details This endpoint will provide the details for the specified sub-account company - /// - /// Thrown when fails to make API call - /// Id of the sub-account organization - /// Task of SubAccountDetailsResponse - public async System.Threading.Tasks.Task CorporateSubAccountIdGetAsync (long? id) - { - ApiResponse localVarResponse = await CorporateSubAccountIdGetAsyncWithHttpInfo(id); - return localVarResponse.Data; - - } - - /// - /// Get sub-account details This endpoint will provide the details for the specified sub-account company - /// - /// Thrown when fails to make API call - /// Id of the sub-account organization - /// Task of ApiResponse (SubAccountDetailsResponse) - public async System.Threading.Tasks.Task> CorporateSubAccountIdGetAsyncWithHttpInfo (long? id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling MasterAccountApi->CorporateSubAccountIdGet"); - - var localVarPath = "./corporate/subAccount/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CorporateSubAccountIdGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (SubAccountDetailsResponse) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(SubAccountDetailsResponse))); - } - - /// - /// Update sub-account plan This endpoint will update the sub-account plan - /// - /// Thrown when fails to make API call - /// Id of the sub-account organization - /// Values to update a sub-account plan - /// - public void CorporateSubAccountIdPlanPut (long? id, SubAccountUpdatePlanRequest updatePlanDetails) - { - CorporateSubAccountIdPlanPutWithHttpInfo(id, updatePlanDetails); - } - - /// - /// Update sub-account plan This endpoint will update the sub-account plan - /// - /// Thrown when fails to make API call - /// Id of the sub-account organization - /// Values to update a sub-account plan - /// ApiResponse of Object(void) - public ApiResponse CorporateSubAccountIdPlanPutWithHttpInfo (long? id, SubAccountUpdatePlanRequest updatePlanDetails) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling MasterAccountApi->CorporateSubAccountIdPlanPut"); - // verify the required parameter 'updatePlanDetails' is set - if (updatePlanDetails == null) - throw new ApiException(400, "Missing required parameter 'updatePlanDetails' when calling MasterAccountApi->CorporateSubAccountIdPlanPut"); - - var localVarPath = "./corporate/subAccount/{id}/plan"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - if (updatePlanDetails != null && updatePlanDetails.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(updatePlanDetails); // http body (model) parameter - } - else - { - localVarPostBody = updatePlanDetails; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CorporateSubAccountIdPlanPut", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Update sub-account plan This endpoint will update the sub-account plan - /// - /// Thrown when fails to make API call - /// Id of the sub-account organization - /// Values to update a sub-account plan - /// Task of void - public async System.Threading.Tasks.Task CorporateSubAccountIdPlanPutAsync (long? id, SubAccountUpdatePlanRequest updatePlanDetails) - { - await CorporateSubAccountIdPlanPutAsyncWithHttpInfo(id, updatePlanDetails); - - } - - /// - /// Update sub-account plan This endpoint will update the sub-account plan - /// - /// Thrown when fails to make API call - /// Id of the sub-account organization - /// Values to update a sub-account plan - /// Task of ApiResponse - public async System.Threading.Tasks.Task> CorporateSubAccountIdPlanPutAsyncWithHttpInfo (long? id, SubAccountUpdatePlanRequest updatePlanDetails) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling MasterAccountApi->CorporateSubAccountIdPlanPut"); - // verify the required parameter 'updatePlanDetails' is set - if (updatePlanDetails == null) - throw new ApiException(400, "Missing required parameter 'updatePlanDetails' when calling MasterAccountApi->CorporateSubAccountIdPlanPut"); - - var localVarPath = "./corporate/subAccount/{id}/plan"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - if (updatePlanDetails != null && updatePlanDetails.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(updatePlanDetails); // http body (model) parameter - } - else - { - localVarPostBody = updatePlanDetails; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CorporateSubAccountIdPlanPut", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Create an API key for a sub-account This endpoint will generate an API v3 key for a sub account - /// - /// Thrown when fails to make API call - /// Values to generate API key for sub-account - /// CreateApiKeyResponse - public CreateApiKeyResponse CorporateSubAccountKeyPost (CreateApiKeyRequest createApiKeyRequest) - { - ApiResponse localVarResponse = CorporateSubAccountKeyPostWithHttpInfo(createApiKeyRequest); - return localVarResponse.Data; - } - - /// - /// Create an API key for a sub-account This endpoint will generate an API v3 key for a sub account - /// - /// Thrown when fails to make API call - /// Values to generate API key for sub-account - /// ApiResponse of CreateApiKeyResponse - public ApiResponse< CreateApiKeyResponse > CorporateSubAccountKeyPostWithHttpInfo (CreateApiKeyRequest createApiKeyRequest) - { - // verify the required parameter 'createApiKeyRequest' is set - if (createApiKeyRequest == null) - throw new ApiException(400, "Missing required parameter 'createApiKeyRequest' when calling MasterAccountApi->CorporateSubAccountKeyPost"); - - var localVarPath = "./corporate/subAccount/key"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (createApiKeyRequest != null && createApiKeyRequest.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(createApiKeyRequest); // http body (model) parameter - } - else - { - localVarPostBody = createApiKeyRequest; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CorporateSubAccountKeyPost", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateApiKeyResponse) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateApiKeyResponse))); - } - - /// - /// Create an API key for a sub-account This endpoint will generate an API v3 key for a sub account - /// - /// Thrown when fails to make API call - /// Values to generate API key for sub-account - /// Task of CreateApiKeyResponse - public async System.Threading.Tasks.Task CorporateSubAccountKeyPostAsync (CreateApiKeyRequest createApiKeyRequest) - { - ApiResponse localVarResponse = await CorporateSubAccountKeyPostAsyncWithHttpInfo(createApiKeyRequest); - return localVarResponse.Data; - - } - - /// - /// Create an API key for a sub-account This endpoint will generate an API v3 key for a sub account - /// - /// Thrown when fails to make API call - /// Values to generate API key for sub-account - /// Task of ApiResponse (CreateApiKeyResponse) - public async System.Threading.Tasks.Task> CorporateSubAccountKeyPostAsyncWithHttpInfo (CreateApiKeyRequest createApiKeyRequest) - { - // verify the required parameter 'createApiKeyRequest' is set - if (createApiKeyRequest == null) - throw new ApiException(400, "Missing required parameter 'createApiKeyRequest' when calling MasterAccountApi->CorporateSubAccountKeyPost"); - - var localVarPath = "./corporate/subAccount/key"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (createApiKeyRequest != null && createApiKeyRequest.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(createApiKeyRequest); // http body (model) parameter - } - else - { - localVarPostBody = createApiKeyRequest; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CorporateSubAccountKeyPost", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateApiKeyResponse) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateApiKeyResponse))); - } - - /// - /// Create a new sub-account under a master account. This endpoint will create a new sub-account under a master account - /// - /// Thrown when fails to make API call - /// values to create new sub-account - /// CreateSubAccountResponse - public CreateSubAccountResponse CorporateSubAccountPost (CreateSubAccount subAccountCreate) - { - ApiResponse localVarResponse = CorporateSubAccountPostWithHttpInfo(subAccountCreate); - return localVarResponse.Data; - } - - /// - /// Create a new sub-account under a master account. This endpoint will create a new sub-account under a master account - /// - /// Thrown when fails to make API call - /// values to create new sub-account - /// ApiResponse of CreateSubAccountResponse - public ApiResponse< CreateSubAccountResponse > CorporateSubAccountPostWithHttpInfo (CreateSubAccount subAccountCreate) - { - // verify the required parameter 'subAccountCreate' is set - if (subAccountCreate == null) - throw new ApiException(400, "Missing required parameter 'subAccountCreate' when calling MasterAccountApi->CorporateSubAccountPost"); - - var localVarPath = "./corporate/subAccount"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (subAccountCreate != null && subAccountCreate.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(subAccountCreate); // http body (model) parameter - } - else - { - localVarPostBody = subAccountCreate; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CorporateSubAccountPost", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateSubAccountResponse) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateSubAccountResponse))); - } - - /// - /// Create a new sub-account under a master account. This endpoint will create a new sub-account under a master account - /// - /// Thrown when fails to make API call - /// values to create new sub-account - /// Task of CreateSubAccountResponse - public async System.Threading.Tasks.Task CorporateSubAccountPostAsync (CreateSubAccount subAccountCreate) - { - ApiResponse localVarResponse = await CorporateSubAccountPostAsyncWithHttpInfo(subAccountCreate); - return localVarResponse.Data; - - } - - /// - /// Create a new sub-account under a master account. This endpoint will create a new sub-account under a master account - /// - /// Thrown when fails to make API call - /// values to create new sub-account - /// Task of ApiResponse (CreateSubAccountResponse) - public async System.Threading.Tasks.Task> CorporateSubAccountPostAsyncWithHttpInfo (CreateSubAccount subAccountCreate) - { - // verify the required parameter 'subAccountCreate' is set - if (subAccountCreate == null) - throw new ApiException(400, "Missing required parameter 'subAccountCreate' when calling MasterAccountApi->CorporateSubAccountPost"); - - var localVarPath = "./corporate/subAccount"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (subAccountCreate != null && subAccountCreate.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(subAccountCreate); // http body (model) parameter - } - else - { - localVarPostBody = subAccountCreate; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CorporateSubAccountPost", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateSubAccountResponse) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateSubAccountResponse))); - } - - /// - /// Generate SSO token to access Sendinblue This endpoint generates an sso token to authenticate and access a sub-account of the master using the account endpoint https://account-app.sendinblue.com/account/login/sub-account/sso/[token], where [token] will be replaced by the actual token. - /// - /// Thrown when fails to make API call - /// Values to generate SSO token for sub-account - /// GetSsoToken - public GetSsoToken CorporateSubAccountSsoTokenPost (SsoTokenRequest ssoTokenRequest) - { - ApiResponse localVarResponse = CorporateSubAccountSsoTokenPostWithHttpInfo(ssoTokenRequest); - return localVarResponse.Data; - } - - /// - /// Generate SSO token to access Sendinblue This endpoint generates an sso token to authenticate and access a sub-account of the master using the account endpoint https://account-app.sendinblue.com/account/login/sub-account/sso/[token], where [token] will be replaced by the actual token. - /// - /// Thrown when fails to make API call - /// Values to generate SSO token for sub-account - /// ApiResponse of GetSsoToken - public ApiResponse< GetSsoToken > CorporateSubAccountSsoTokenPostWithHttpInfo (SsoTokenRequest ssoTokenRequest) - { - // verify the required parameter 'ssoTokenRequest' is set - if (ssoTokenRequest == null) - throw new ApiException(400, "Missing required parameter 'ssoTokenRequest' when calling MasterAccountApi->CorporateSubAccountSsoTokenPost"); - - var localVarPath = "./corporate/subAccount/ssoToken"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (ssoTokenRequest != null && ssoTokenRequest.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(ssoTokenRequest); // http body (model) parameter - } - else - { - localVarPostBody = ssoTokenRequest; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CorporateSubAccountSsoTokenPost", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetSsoToken) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSsoToken))); - } - - /// - /// Generate SSO token to access Sendinblue This endpoint generates an sso token to authenticate and access a sub-account of the master using the account endpoint https://account-app.sendinblue.com/account/login/sub-account/sso/[token], where [token] will be replaced by the actual token. - /// - /// Thrown when fails to make API call - /// Values to generate SSO token for sub-account - /// Task of GetSsoToken - public async System.Threading.Tasks.Task CorporateSubAccountSsoTokenPostAsync (SsoTokenRequest ssoTokenRequest) - { - ApiResponse localVarResponse = await CorporateSubAccountSsoTokenPostAsyncWithHttpInfo(ssoTokenRequest); - return localVarResponse.Data; - - } - - /// - /// Generate SSO token to access Sendinblue This endpoint generates an sso token to authenticate and access a sub-account of the master using the account endpoint https://account-app.sendinblue.com/account/login/sub-account/sso/[token], where [token] will be replaced by the actual token. - /// - /// Thrown when fails to make API call - /// Values to generate SSO token for sub-account - /// Task of ApiResponse (GetSsoToken) - public async System.Threading.Tasks.Task> CorporateSubAccountSsoTokenPostAsyncWithHttpInfo (SsoTokenRequest ssoTokenRequest) - { - // verify the required parameter 'ssoTokenRequest' is set - if (ssoTokenRequest == null) - throw new ApiException(400, "Missing required parameter 'ssoTokenRequest' when calling MasterAccountApi->CorporateSubAccountSsoTokenPost"); - - var localVarPath = "./corporate/subAccount/ssoToken"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (ssoTokenRequest != null && ssoTokenRequest.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(ssoTokenRequest); // http body (model) parameter - } - else - { - localVarPostBody = ssoTokenRequest; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CorporateSubAccountSsoTokenPost", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetSsoToken) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSsoToken))); - } - - } -} diff --git a/src/sib_api_v3_sdk/Api/NotesApi.cs b/src/sib_api_v3_sdk/Api/NotesApi.cs deleted file mode 100644 index 23c8782..0000000 --- a/src/sib_api_v3_sdk/Api/NotesApi.cs +++ /dev/null @@ -1,1209 +0,0 @@ -/* - * SendinBlue API - * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :- -- -- -- -- -- --: | - -- -- -- -- -- -- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | - * - * OpenAPI spec version: 3.0.0 - * Contact: contact@sendinblue.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using RestSharp.Portable; -using sib_api_v3_sdk.Client; -using sib_api_v3_sdk.Model; - -namespace sib_api_v3_sdk.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface INotesApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Get all notes - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter by note entity type (optional) - /// Filter by note entity IDs (optional) - /// dateFrom to date range filter type (timestamp in milliseconds) (optional) - /// dateTo to date range filter type (timestamp in milliseconds) (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// NoteList - NoteList CrmNotesGet (string entity = null, string entityIds = null, int? dateFrom = null, int? dateTo = null, long? offset = null, long? limit = null, string sort = null); - - /// - /// Get all notes - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter by note entity type (optional) - /// Filter by note entity IDs (optional) - /// dateFrom to date range filter type (timestamp in milliseconds) (optional) - /// dateTo to date range filter type (timestamp in milliseconds) (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// ApiResponse of NoteList - ApiResponse CrmNotesGetWithHttpInfo (string entity = null, string entityIds = null, int? dateFrom = null, int? dateTo = null, long? offset = null, long? limit = null, string sort = null); - /// - /// Delete a note - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Note ID to delete - /// - void CrmNotesIdDelete (string id); - - /// - /// Delete a note - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Note ID to delete - /// ApiResponse of Object(void) - ApiResponse CrmNotesIdDeleteWithHttpInfo (string id); - /// - /// Get a note - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Note ID to get - /// Note - Note CrmNotesIdGet (string id); - - /// - /// Get a note - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Note ID to get - /// ApiResponse of Note - ApiResponse CrmNotesIdGetWithHttpInfo (string id); - /// - /// Update a note - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Note ID to update - /// Note data to update a note - /// - void CrmNotesIdPatch (string id, NoteData body); - - /// - /// Update a note - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Note ID to update - /// Note data to update a note - /// ApiResponse of Object(void) - ApiResponse CrmNotesIdPatchWithHttpInfo (string id, NoteData body); - /// - /// Create a note - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Note data to create a note. - /// NoteId - NoteId CrmNotesPost (NoteData body); - - /// - /// Create a note - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Note data to create a note. - /// ApiResponse of NoteId - ApiResponse CrmNotesPostWithHttpInfo (NoteData body); - #endregion Synchronous Operations - #region Asynchronous Operations - /// - /// Get all notes - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter by note entity type (optional) - /// Filter by note entity IDs (optional) - /// dateFrom to date range filter type (timestamp in milliseconds) (optional) - /// dateTo to date range filter type (timestamp in milliseconds) (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// Task of NoteList - System.Threading.Tasks.Task CrmNotesGetAsync (string entity = null, string entityIds = null, int? dateFrom = null, int? dateTo = null, long? offset = null, long? limit = null, string sort = null); - - /// - /// Get all notes - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter by note entity type (optional) - /// Filter by note entity IDs (optional) - /// dateFrom to date range filter type (timestamp in milliseconds) (optional) - /// dateTo to date range filter type (timestamp in milliseconds) (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// Task of ApiResponse (NoteList) - System.Threading.Tasks.Task> CrmNotesGetAsyncWithHttpInfo (string entity = null, string entityIds = null, int? dateFrom = null, int? dateTo = null, long? offset = null, long? limit = null, string sort = null); - /// - /// Delete a note - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Note ID to delete - /// Task of void - System.Threading.Tasks.Task CrmNotesIdDeleteAsync (string id); - - /// - /// Delete a note - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Note ID to delete - /// Task of ApiResponse - System.Threading.Tasks.Task> CrmNotesIdDeleteAsyncWithHttpInfo (string id); - /// - /// Get a note - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Note ID to get - /// Task of Note - System.Threading.Tasks.Task CrmNotesIdGetAsync (string id); - - /// - /// Get a note - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Note ID to get - /// Task of ApiResponse (Note) - System.Threading.Tasks.Task> CrmNotesIdGetAsyncWithHttpInfo (string id); - /// - /// Update a note - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Note ID to update - /// Note data to update a note - /// Task of void - System.Threading.Tasks.Task CrmNotesIdPatchAsync (string id, NoteData body); - - /// - /// Update a note - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Note ID to update - /// Note data to update a note - /// Task of ApiResponse - System.Threading.Tasks.Task> CrmNotesIdPatchAsyncWithHttpInfo (string id, NoteData body); - /// - /// Create a note - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Note data to create a note. - /// Task of NoteId - System.Threading.Tasks.Task CrmNotesPostAsync (NoteData body); - - /// - /// Create a note - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Note data to create a note. - /// Task of ApiResponse (NoteId) - System.Threading.Tasks.Task> CrmNotesPostAsyncWithHttpInfo (NoteData body); - #endregion Asynchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public partial class NotesApi : INotesApi - { - private sib_api_v3_sdk.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// - /// - public NotesApi(String basePath) - { - this.Configuration = new sib_api_v3_sdk.Client.Configuration { BasePath = basePath }; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using Configuration object - /// - /// An instance of Configuration - /// - public NotesApi(sib_api_v3_sdk.Client.Configuration configuration = null) - { - if (configuration == null) // use the default one in Configuration - this.Configuration = sib_api_v3_sdk.Client.Configuration.Default; - else - this.Configuration = configuration; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] - public void SetBasePath(String basePath) - { - // do nothing - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public sib_api_v3_sdk.Client.Configuration Configuration {get; set;} - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public sib_api_v3_sdk.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - /// - /// Gets the default header. - /// - /// Dictionary of HTTP header - [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] - public IDictionary DefaultHeader() - { - return new ReadOnlyDictionary(this.Configuration.DefaultHeader); - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] - public void AddDefaultHeader(string key, string value) - { - this.Configuration.AddDefaultHeader(key, value); - } - - /// - /// Get all notes - /// - /// Thrown when fails to make API call - /// Filter by note entity type (optional) - /// Filter by note entity IDs (optional) - /// dateFrom to date range filter type (timestamp in milliseconds) (optional) - /// dateTo to date range filter type (timestamp in milliseconds) (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// NoteList - public NoteList CrmNotesGet (string entity = null, string entityIds = null, int? dateFrom = null, int? dateTo = null, long? offset = null, long? limit = null, string sort = null) - { - ApiResponse localVarResponse = CrmNotesGetWithHttpInfo(entity, entityIds, dateFrom, dateTo, offset, limit, sort); - return localVarResponse.Data; - } - - /// - /// Get all notes - /// - /// Thrown when fails to make API call - /// Filter by note entity type (optional) - /// Filter by note entity IDs (optional) - /// dateFrom to date range filter type (timestamp in milliseconds) (optional) - /// dateTo to date range filter type (timestamp in milliseconds) (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// ApiResponse of NoteList - public ApiResponse< NoteList > CrmNotesGetWithHttpInfo (string entity = null, string entityIds = null, int? dateFrom = null, int? dateTo = null, long? offset = null, long? limit = null, string sort = null) - { - - var localVarPath = "./crm/notes"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (entity != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "entity", entity)); // query parameter - if (entityIds != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "entityIds", entityIds)); // query parameter - if (dateFrom != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "dateFrom", dateFrom)); // query parameter - if (dateTo != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "dateTo", dateTo)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmNotesGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (NoteList) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(NoteList))); - } - - /// - /// Get all notes - /// - /// Thrown when fails to make API call - /// Filter by note entity type (optional) - /// Filter by note entity IDs (optional) - /// dateFrom to date range filter type (timestamp in milliseconds) (optional) - /// dateTo to date range filter type (timestamp in milliseconds) (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// Task of NoteList - public async System.Threading.Tasks.Task CrmNotesGetAsync (string entity = null, string entityIds = null, int? dateFrom = null, int? dateTo = null, long? offset = null, long? limit = null, string sort = null) - { - ApiResponse localVarResponse = await CrmNotesGetAsyncWithHttpInfo(entity, entityIds, dateFrom, dateTo, offset, limit, sort); - return localVarResponse.Data; - - } - - /// - /// Get all notes - /// - /// Thrown when fails to make API call - /// Filter by note entity type (optional) - /// Filter by note entity IDs (optional) - /// dateFrom to date range filter type (timestamp in milliseconds) (optional) - /// dateTo to date range filter type (timestamp in milliseconds) (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// Task of ApiResponse (NoteList) - public async System.Threading.Tasks.Task> CrmNotesGetAsyncWithHttpInfo (string entity = null, string entityIds = null, int? dateFrom = null, int? dateTo = null, long? offset = null, long? limit = null, string sort = null) - { - - var localVarPath = "./crm/notes"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (entity != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "entity", entity)); // query parameter - if (entityIds != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "entityIds", entityIds)); // query parameter - if (dateFrom != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "dateFrom", dateFrom)); // query parameter - if (dateTo != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "dateTo", dateTo)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmNotesGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (NoteList) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(NoteList))); - } - - /// - /// Delete a note - /// - /// Thrown when fails to make API call - /// Note ID to delete - /// - public void CrmNotesIdDelete (string id) - { - CrmNotesIdDeleteWithHttpInfo(id); - } - - /// - /// Delete a note - /// - /// Thrown when fails to make API call - /// Note ID to delete - /// ApiResponse of Object(void) - public ApiResponse CrmNotesIdDeleteWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling NotesApi->CrmNotesIdDelete"); - - var localVarPath = "./crm/notes/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmNotesIdDelete", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete a note - /// - /// Thrown when fails to make API call - /// Note ID to delete - /// Task of void - public async System.Threading.Tasks.Task CrmNotesIdDeleteAsync (string id) - { - await CrmNotesIdDeleteAsyncWithHttpInfo(id); - - } - - /// - /// Delete a note - /// - /// Thrown when fails to make API call - /// Note ID to delete - /// Task of ApiResponse - public async System.Threading.Tasks.Task> CrmNotesIdDeleteAsyncWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling NotesApi->CrmNotesIdDelete"); - - var localVarPath = "./crm/notes/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmNotesIdDelete", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Get a note - /// - /// Thrown when fails to make API call - /// Note ID to get - /// Note - public Note CrmNotesIdGet (string id) - { - ApiResponse localVarResponse = CrmNotesIdGetWithHttpInfo(id); - return localVarResponse.Data; - } - - /// - /// Get a note - /// - /// Thrown when fails to make API call - /// Note ID to get - /// ApiResponse of Note - public ApiResponse< Note > CrmNotesIdGetWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling NotesApi->CrmNotesIdGet"); - - var localVarPath = "./crm/notes/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmNotesIdGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (Note) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Note))); - } - - /// - /// Get a note - /// - /// Thrown when fails to make API call - /// Note ID to get - /// Task of Note - public async System.Threading.Tasks.Task CrmNotesIdGetAsync (string id) - { - ApiResponse localVarResponse = await CrmNotesIdGetAsyncWithHttpInfo(id); - return localVarResponse.Data; - - } - - /// - /// Get a note - /// - /// Thrown when fails to make API call - /// Note ID to get - /// Task of ApiResponse (Note) - public async System.Threading.Tasks.Task> CrmNotesIdGetAsyncWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling NotesApi->CrmNotesIdGet"); - - var localVarPath = "./crm/notes/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmNotesIdGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (Note) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Note))); - } - - /// - /// Update a note - /// - /// Thrown when fails to make API call - /// Note ID to update - /// Note data to update a note - /// - public void CrmNotesIdPatch (string id, NoteData body) - { - CrmNotesIdPatchWithHttpInfo(id, body); - } - - /// - /// Update a note - /// - /// Thrown when fails to make API call - /// Note ID to update - /// Note data to update a note - /// ApiResponse of Object(void) - public ApiResponse CrmNotesIdPatchWithHttpInfo (string id, NoteData body) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling NotesApi->CrmNotesIdPatch"); - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling NotesApi->CrmNotesIdPatch"); - - var localVarPath = "./crm/notes/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmNotesIdPatch", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Update a note - /// - /// Thrown when fails to make API call - /// Note ID to update - /// Note data to update a note - /// Task of void - public async System.Threading.Tasks.Task CrmNotesIdPatchAsync (string id, NoteData body) - { - await CrmNotesIdPatchAsyncWithHttpInfo(id, body); - - } - - /// - /// Update a note - /// - /// Thrown when fails to make API call - /// Note ID to update - /// Note data to update a note - /// Task of ApiResponse - public async System.Threading.Tasks.Task> CrmNotesIdPatchAsyncWithHttpInfo (string id, NoteData body) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling NotesApi->CrmNotesIdPatch"); - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling NotesApi->CrmNotesIdPatch"); - - var localVarPath = "./crm/notes/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmNotesIdPatch", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Create a note - /// - /// Thrown when fails to make API call - /// Note data to create a note. - /// NoteId - public NoteId CrmNotesPost (NoteData body) - { - ApiResponse localVarResponse = CrmNotesPostWithHttpInfo(body); - return localVarResponse.Data; - } - - /// - /// Create a note - /// - /// Thrown when fails to make API call - /// Note data to create a note. - /// ApiResponse of NoteId - public ApiResponse< NoteId > CrmNotesPostWithHttpInfo (NoteData body) - { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling NotesApi->CrmNotesPost"); - - var localVarPath = "./crm/notes"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmNotesPost", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (NoteId) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(NoteId))); - } - - /// - /// Create a note - /// - /// Thrown when fails to make API call - /// Note data to create a note. - /// Task of NoteId - public async System.Threading.Tasks.Task CrmNotesPostAsync (NoteData body) - { - ApiResponse localVarResponse = await CrmNotesPostAsyncWithHttpInfo(body); - return localVarResponse.Data; - - } - - /// - /// Create a note - /// - /// Thrown when fails to make API call - /// Note data to create a note. - /// Task of ApiResponse (NoteId) - public async System.Threading.Tasks.Task> CrmNotesPostAsyncWithHttpInfo (NoteData body) - { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling NotesApi->CrmNotesPost"); - - var localVarPath = "./crm/notes"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmNotesPost", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (NoteId) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(NoteId))); - } - - } -} diff --git a/src/sib_api_v3_sdk/Api/ProcessApi.cs b/src/sib_api_v3_sdk/Api/ProcessApi.cs deleted file mode 100644 index d6fa814..0000000 --- a/src/sib_api_v3_sdk/Api/ProcessApi.cs +++ /dev/null @@ -1,538 +0,0 @@ -/* - * SendinBlue API - * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :- -- -- -- -- -- --: | - -- -- -- -- -- -- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | - * - * OpenAPI spec version: 3.0.0 - * Contact: contact@sendinblue.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using RestSharp.Portable; -using sib_api_v3_sdk.Client; -using sib_api_v3_sdk.Model; - -namespace sib_api_v3_sdk.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IProcessApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Return the informations for a process - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the process - /// GetProcess - GetProcess GetProcess (long? processId); - - /// - /// Return the informations for a process - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the process - /// ApiResponse of GetProcess - ApiResponse GetProcessWithHttpInfo (long? processId); - /// - /// Return all the processes for your account - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number limitation for the result returned (optional, default to 10) - /// Beginning point in the list to retrieve from. (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// GetProcesses - GetProcesses GetProcesses (long? limit = null, long? offset = null, string sort = null); - - /// - /// Return all the processes for your account - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number limitation for the result returned (optional, default to 10) - /// Beginning point in the list to retrieve from. (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// ApiResponse of GetProcesses - ApiResponse GetProcessesWithHttpInfo (long? limit = null, long? offset = null, string sort = null); - #endregion Synchronous Operations - #region Asynchronous Operations - /// - /// Return the informations for a process - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the process - /// Task of GetProcess - System.Threading.Tasks.Task GetProcessAsync (long? processId); - - /// - /// Return the informations for a process - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the process - /// Task of ApiResponse (GetProcess) - System.Threading.Tasks.Task> GetProcessAsyncWithHttpInfo (long? processId); - /// - /// Return all the processes for your account - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number limitation for the result returned (optional, default to 10) - /// Beginning point in the list to retrieve from. (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of GetProcesses - System.Threading.Tasks.Task GetProcessesAsync (long? limit = null, long? offset = null, string sort = null); - - /// - /// Return all the processes for your account - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number limitation for the result returned (optional, default to 10) - /// Beginning point in the list to retrieve from. (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of ApiResponse (GetProcesses) - System.Threading.Tasks.Task> GetProcessesAsyncWithHttpInfo (long? limit = null, long? offset = null, string sort = null); - #endregion Asynchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public partial class ProcessApi : IProcessApi - { - private sib_api_v3_sdk.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// - /// - public ProcessApi(String basePath) - { - this.Configuration = new sib_api_v3_sdk.Client.Configuration { BasePath = basePath }; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using Configuration object - /// - /// An instance of Configuration - /// - public ProcessApi(sib_api_v3_sdk.Client.Configuration configuration = null) - { - if (configuration == null) // use the default one in Configuration - this.Configuration = sib_api_v3_sdk.Client.Configuration.Default; - else - this.Configuration = configuration; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] - public void SetBasePath(String basePath) - { - // do nothing - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public sib_api_v3_sdk.Client.Configuration Configuration {get; set;} - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public sib_api_v3_sdk.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - /// - /// Gets the default header. - /// - /// Dictionary of HTTP header - [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] - public IDictionary DefaultHeader() - { - return new ReadOnlyDictionary(this.Configuration.DefaultHeader); - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] - public void AddDefaultHeader(string key, string value) - { - this.Configuration.AddDefaultHeader(key, value); - } - - /// - /// Return the informations for a process - /// - /// Thrown when fails to make API call - /// Id of the process - /// GetProcess - public GetProcess GetProcess (long? processId) - { - ApiResponse localVarResponse = GetProcessWithHttpInfo(processId); - return localVarResponse.Data; - } - - /// - /// Return the informations for a process - /// - /// Thrown when fails to make API call - /// Id of the process - /// ApiResponse of GetProcess - public ApiResponse< GetProcess > GetProcessWithHttpInfo (long? processId) - { - // verify the required parameter 'processId' is set - if (processId == null) - throw new ApiException(400, "Missing required parameter 'processId' when calling ProcessApi->GetProcess"); - - var localVarPath = "./processes/{processId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (processId != null) localVarPathParams.Add("processId", this.Configuration.ApiClient.ParameterToString(processId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetProcess", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetProcess) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetProcess))); - } - - /// - /// Return the informations for a process - /// - /// Thrown when fails to make API call - /// Id of the process - /// Task of GetProcess - public async System.Threading.Tasks.Task GetProcessAsync (long? processId) - { - ApiResponse localVarResponse = await GetProcessAsyncWithHttpInfo(processId); - return localVarResponse.Data; - - } - - /// - /// Return the informations for a process - /// - /// Thrown when fails to make API call - /// Id of the process - /// Task of ApiResponse (GetProcess) - public async System.Threading.Tasks.Task> GetProcessAsyncWithHttpInfo (long? processId) - { - // verify the required parameter 'processId' is set - if (processId == null) - throw new ApiException(400, "Missing required parameter 'processId' when calling ProcessApi->GetProcess"); - - var localVarPath = "./processes/{processId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (processId != null) localVarPathParams.Add("processId", this.Configuration.ApiClient.ParameterToString(processId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetProcess", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetProcess) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetProcess))); - } - - /// - /// Return all the processes for your account - /// - /// Thrown when fails to make API call - /// Number limitation for the result returned (optional, default to 10) - /// Beginning point in the list to retrieve from. (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// GetProcesses - public GetProcesses GetProcesses (long? limit = null, long? offset = null, string sort = null) - { - ApiResponse localVarResponse = GetProcessesWithHttpInfo(limit, offset, sort); - return localVarResponse.Data; - } - - /// - /// Return all the processes for your account - /// - /// Thrown when fails to make API call - /// Number limitation for the result returned (optional, default to 10) - /// Beginning point in the list to retrieve from. (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// ApiResponse of GetProcesses - public ApiResponse< GetProcesses > GetProcessesWithHttpInfo (long? limit = null, long? offset = null, string sort = null) - { - - var localVarPath = "./processes"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetProcesses", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetProcesses) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetProcesses))); - } - - /// - /// Return all the processes for your account - /// - /// Thrown when fails to make API call - /// Number limitation for the result returned (optional, default to 10) - /// Beginning point in the list to retrieve from. (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of GetProcesses - public async System.Threading.Tasks.Task GetProcessesAsync (long? limit = null, long? offset = null, string sort = null) - { - ApiResponse localVarResponse = await GetProcessesAsyncWithHttpInfo(limit, offset, sort); - return localVarResponse.Data; - - } - - /// - /// Return all the processes for your account - /// - /// Thrown when fails to make API call - /// Number limitation for the result returned (optional, default to 10) - /// Beginning point in the list to retrieve from. (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of ApiResponse (GetProcesses) - public async System.Threading.Tasks.Task> GetProcessesAsyncWithHttpInfo (long? limit = null, long? offset = null, string sort = null) - { - - var localVarPath = "./processes"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetProcesses", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetProcesses) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetProcesses))); - } - - } -} diff --git a/src/sib_api_v3_sdk/Api/ResellerApi.cs b/src/sib_api_v3_sdk/Api/ResellerApi.cs deleted file mode 100644 index 9d26338..0000000 --- a/src/sib_api_v3_sdk/Api/ResellerApi.cs +++ /dev/null @@ -1,3550 +0,0 @@ -/* - * SendinBlue API - * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :- -- -- -- -- -- --: | - -- -- -- -- -- -- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | - * - * OpenAPI spec version: 3.0.0 - * Contact: contact@sendinblue.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using RestSharp.Portable; -using sib_api_v3_sdk.Client; -using sib_api_v3_sdk.Model; - -namespace sib_api_v3_sdk.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IResellerApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Add Email and/or SMS credits to a specific child account - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Values to post to add credit to a specific child account - /// RemainingCreditModel - RemainingCreditModel AddCredits (string childIdentifier, AddCredits addCredits); - - /// - /// Add Email and/or SMS credits to a specific child account - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Values to post to add credit to a specific child account - /// ApiResponse of RemainingCreditModel - ApiResponse AddCreditsWithHttpInfo (string childIdentifier, AddCredits addCredits); - /// - /// Associate a dedicated IP to the child - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// IP to associate - /// - void AssociateIpToChild (string childIdentifier, ManageIp ip); - - /// - /// Associate a dedicated IP to the child - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// IP to associate - /// ApiResponse of Object(void) - ApiResponse AssociateIpToChildWithHttpInfo (string childIdentifier, ManageIp ip); - /// - /// Create a domain for a child account - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Sender domain to add for a specific child account. This will not be displayed to the parent account. - /// - void CreateChildDomain (string childIdentifier, AddChildDomain addChildDomain); - - /// - /// Create a domain for a child account - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Sender domain to add for a specific child account. This will not be displayed to the parent account. - /// ApiResponse of Object(void) - ApiResponse CreateChildDomainWithHttpInfo (string childIdentifier, AddChildDomain addChildDomain); - /// - /// Creates a reseller child - /// - /// - /// - /// - /// Thrown when fails to make API call - /// reseller child to add (optional) - /// CreateReseller - CreateReseller CreateResellerChild (CreateChild resellerChild = null); - - /// - /// Creates a reseller child - /// - /// - /// - /// - /// Thrown when fails to make API call - /// reseller child to add (optional) - /// ApiResponse of CreateReseller - ApiResponse CreateResellerChildWithHttpInfo (CreateChild resellerChild = null); - /// - /// Delete the sender domain of the reseller child based on the childIdentifier and domainName passed - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Pass the existing domain that needs to be deleted - /// - void DeleteChildDomain (string childIdentifier, string domainName); - - /// - /// Delete the sender domain of the reseller child based on the childIdentifier and domainName passed - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Pass the existing domain that needs to be deleted - /// ApiResponse of Object(void) - ApiResponse DeleteChildDomainWithHttpInfo (string childIdentifier, string domainName); - /// - /// Delete a single reseller child based on the child identifier supplied - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or child id of reseller's child - /// - void DeleteResellerChild (string childIdentifier); - - /// - /// Delete a single reseller child based on the child identifier supplied - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or child id of reseller's child - /// ApiResponse of Object(void) - ApiResponse DeleteResellerChildWithHttpInfo (string childIdentifier); - /// - /// Dissociate a dedicated IP to the child - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// IP to dissociate - /// - void DissociateIpFromChild (string childIdentifier, ManageIp ip); - - /// - /// Dissociate a dedicated IP to the child - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// IP to dissociate - /// ApiResponse of Object(void) - ApiResponse DissociateIpFromChildWithHttpInfo (string childIdentifier, ManageIp ip); - /// - /// Get the status of a reseller's child account creation, whether it is successfully created (exists) or not based on the identifier supplied - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// GetChildAccountCreationStatus - GetChildAccountCreationStatus GetChildAccountCreationStatus (string childIdentifier); - - /// - /// Get the status of a reseller's child account creation, whether it is successfully created (exists) or not based on the identifier supplied - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// ApiResponse of GetChildAccountCreationStatus - ApiResponse GetChildAccountCreationStatusWithHttpInfo (string childIdentifier); - /// - /// Get all sender domains for a specific child account - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// GetChildDomains - GetChildDomains GetChildDomains (string childIdentifier); - - /// - /// Get all sender domains for a specific child account - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// ApiResponse of GetChildDomains - ApiResponse GetChildDomainsWithHttpInfo (string childIdentifier); - /// - /// Get a child account's details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// GetChildInfo - GetChildInfo GetChildInfo (string childIdentifier); - - /// - /// Get a child account's details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// ApiResponse of GetChildInfo - ApiResponse GetChildInfoWithHttpInfo (string childIdentifier); - /// - /// Get the list of all children accounts - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents for child accounts information per page (optional, default to 10) - /// Index of the first document in the page (optional, default to 0) - /// GetChildrenList - GetChildrenList GetResellerChilds (long? limit = null, long? offset = null); - - /// - /// Get the list of all children accounts - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents for child accounts information per page (optional, default to 10) - /// Index of the first document in the page (optional, default to 0) - /// ApiResponse of GetChildrenList - ApiResponse GetResellerChildsWithHttpInfo (long? limit = null, long? offset = null); - /// - /// Get session token to access Sendinblue (SSO) - /// - /// - /// It returns a session [token] which will remain valid for a short period of time. A child account will be able to access a white-labeled section by using the following url pattern => https:/email.mydomain.com/login/sso?token=[token] - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// GetSsoToken - GetSsoToken GetSsoToken (string childIdentifier); - - /// - /// Get session token to access Sendinblue (SSO) - /// - /// - /// It returns a session [token] which will remain valid for a short period of time. A child account will be able to access a white-labeled section by using the following url pattern => https:/email.mydomain.com/login/sso?token=[token] - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// ApiResponse of GetSsoToken - ApiResponse GetSsoTokenWithHttpInfo (string childIdentifier); - /// - /// Remove Email and/or SMS credits from a specific child account - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Values to post to remove email or SMS credits from a specific child account - /// RemainingCreditModel - RemainingCreditModel RemoveCredits (string childIdentifier, RemoveCredits removeCredits); - - /// - /// Remove Email and/or SMS credits from a specific child account - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Values to post to remove email or SMS credits from a specific child account - /// ApiResponse of RemainingCreditModel - ApiResponse RemoveCreditsWithHttpInfo (string childIdentifier, RemoveCredits removeCredits); - /// - /// Update info of reseller's child account status based on the childIdentifier supplied - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// values to update in child account status - /// - void UpdateChildAccountStatus (string childIdentifier, UpdateChildAccountStatus updateChildAccountStatus); - - /// - /// Update info of reseller's child account status based on the childIdentifier supplied - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// values to update in child account status - /// ApiResponse of Object(void) - ApiResponse UpdateChildAccountStatusWithHttpInfo (string childIdentifier, UpdateChildAccountStatus updateChildAccountStatus); - /// - /// Update the sender domain of reseller's child based on the childIdentifier and domainName passed - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Pass the existing domain that needs to be updated - /// value to update for sender domain - /// - void UpdateChildDomain (string childIdentifier, string domainName, UpdateChildDomain updateChildDomain); - - /// - /// Update the sender domain of reseller's child based on the childIdentifier and domainName passed - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Pass the existing domain that needs to be updated - /// value to update for sender domain - /// ApiResponse of Object(void) - ApiResponse UpdateChildDomainWithHttpInfo (string childIdentifier, string domainName, UpdateChildDomain updateChildDomain); - /// - /// Update info of reseller's child based on the child identifier supplied - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// values to update in child profile - /// - void UpdateResellerChild (string childIdentifier, UpdateChild resellerChild); - - /// - /// Update info of reseller's child based on the child identifier supplied - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// values to update in child profile - /// ApiResponse of Object(void) - ApiResponse UpdateResellerChildWithHttpInfo (string childIdentifier, UpdateChild resellerChild); - #endregion Synchronous Operations - #region Asynchronous Operations - /// - /// Add Email and/or SMS credits to a specific child account - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Values to post to add credit to a specific child account - /// Task of RemainingCreditModel - System.Threading.Tasks.Task AddCreditsAsync (string childIdentifier, AddCredits addCredits); - - /// - /// Add Email and/or SMS credits to a specific child account - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Values to post to add credit to a specific child account - /// Task of ApiResponse (RemainingCreditModel) - System.Threading.Tasks.Task> AddCreditsAsyncWithHttpInfo (string childIdentifier, AddCredits addCredits); - /// - /// Associate a dedicated IP to the child - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// IP to associate - /// Task of void - System.Threading.Tasks.Task AssociateIpToChildAsync (string childIdentifier, ManageIp ip); - - /// - /// Associate a dedicated IP to the child - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// IP to associate - /// Task of ApiResponse - System.Threading.Tasks.Task> AssociateIpToChildAsyncWithHttpInfo (string childIdentifier, ManageIp ip); - /// - /// Create a domain for a child account - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Sender domain to add for a specific child account. This will not be displayed to the parent account. - /// Task of void - System.Threading.Tasks.Task CreateChildDomainAsync (string childIdentifier, AddChildDomain addChildDomain); - - /// - /// Create a domain for a child account - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Sender domain to add for a specific child account. This will not be displayed to the parent account. - /// Task of ApiResponse - System.Threading.Tasks.Task> CreateChildDomainAsyncWithHttpInfo (string childIdentifier, AddChildDomain addChildDomain); - /// - /// Creates a reseller child - /// - /// - /// - /// - /// Thrown when fails to make API call - /// reseller child to add (optional) - /// Task of CreateReseller - System.Threading.Tasks.Task CreateResellerChildAsync (CreateChild resellerChild = null); - - /// - /// Creates a reseller child - /// - /// - /// - /// - /// Thrown when fails to make API call - /// reseller child to add (optional) - /// Task of ApiResponse (CreateReseller) - System.Threading.Tasks.Task> CreateResellerChildAsyncWithHttpInfo (CreateChild resellerChild = null); - /// - /// Delete the sender domain of the reseller child based on the childIdentifier and domainName passed - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Pass the existing domain that needs to be deleted - /// Task of void - System.Threading.Tasks.Task DeleteChildDomainAsync (string childIdentifier, string domainName); - - /// - /// Delete the sender domain of the reseller child based on the childIdentifier and domainName passed - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Pass the existing domain that needs to be deleted - /// Task of ApiResponse - System.Threading.Tasks.Task> DeleteChildDomainAsyncWithHttpInfo (string childIdentifier, string domainName); - /// - /// Delete a single reseller child based on the child identifier supplied - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or child id of reseller's child - /// Task of void - System.Threading.Tasks.Task DeleteResellerChildAsync (string childIdentifier); - - /// - /// Delete a single reseller child based on the child identifier supplied - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or child id of reseller's child - /// Task of ApiResponse - System.Threading.Tasks.Task> DeleteResellerChildAsyncWithHttpInfo (string childIdentifier); - /// - /// Dissociate a dedicated IP to the child - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// IP to dissociate - /// Task of void - System.Threading.Tasks.Task DissociateIpFromChildAsync (string childIdentifier, ManageIp ip); - - /// - /// Dissociate a dedicated IP to the child - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// IP to dissociate - /// Task of ApiResponse - System.Threading.Tasks.Task> DissociateIpFromChildAsyncWithHttpInfo (string childIdentifier, ManageIp ip); - /// - /// Get the status of a reseller's child account creation, whether it is successfully created (exists) or not based on the identifier supplied - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Task of GetChildAccountCreationStatus - System.Threading.Tasks.Task GetChildAccountCreationStatusAsync (string childIdentifier); - - /// - /// Get the status of a reseller's child account creation, whether it is successfully created (exists) or not based on the identifier supplied - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Task of ApiResponse (GetChildAccountCreationStatus) - System.Threading.Tasks.Task> GetChildAccountCreationStatusAsyncWithHttpInfo (string childIdentifier); - /// - /// Get all sender domains for a specific child account - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Task of GetChildDomains - System.Threading.Tasks.Task GetChildDomainsAsync (string childIdentifier); - - /// - /// Get all sender domains for a specific child account - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Task of ApiResponse (GetChildDomains) - System.Threading.Tasks.Task> GetChildDomainsAsyncWithHttpInfo (string childIdentifier); - /// - /// Get a child account's details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Task of GetChildInfo - System.Threading.Tasks.Task GetChildInfoAsync (string childIdentifier); - - /// - /// Get a child account's details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Task of ApiResponse (GetChildInfo) - System.Threading.Tasks.Task> GetChildInfoAsyncWithHttpInfo (string childIdentifier); - /// - /// Get the list of all children accounts - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents for child accounts information per page (optional, default to 10) - /// Index of the first document in the page (optional, default to 0) - /// Task of GetChildrenList - System.Threading.Tasks.Task GetResellerChildsAsync (long? limit = null, long? offset = null); - - /// - /// Get the list of all children accounts - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents for child accounts information per page (optional, default to 10) - /// Index of the first document in the page (optional, default to 0) - /// Task of ApiResponse (GetChildrenList) - System.Threading.Tasks.Task> GetResellerChildsAsyncWithHttpInfo (long? limit = null, long? offset = null); - /// - /// Get session token to access Sendinblue (SSO) - /// - /// - /// It returns a session [token] which will remain valid for a short period of time. A child account will be able to access a white-labeled section by using the following url pattern => https:/email.mydomain.com/login/sso?token=[token] - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Task of GetSsoToken - System.Threading.Tasks.Task GetSsoTokenAsync (string childIdentifier); - - /// - /// Get session token to access Sendinblue (SSO) - /// - /// - /// It returns a session [token] which will remain valid for a short period of time. A child account will be able to access a white-labeled section by using the following url pattern => https:/email.mydomain.com/login/sso?token=[token] - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Task of ApiResponse (GetSsoToken) - System.Threading.Tasks.Task> GetSsoTokenAsyncWithHttpInfo (string childIdentifier); - /// - /// Remove Email and/or SMS credits from a specific child account - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Values to post to remove email or SMS credits from a specific child account - /// Task of RemainingCreditModel - System.Threading.Tasks.Task RemoveCreditsAsync (string childIdentifier, RemoveCredits removeCredits); - - /// - /// Remove Email and/or SMS credits from a specific child account - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Values to post to remove email or SMS credits from a specific child account - /// Task of ApiResponse (RemainingCreditModel) - System.Threading.Tasks.Task> RemoveCreditsAsyncWithHttpInfo (string childIdentifier, RemoveCredits removeCredits); - /// - /// Update info of reseller's child account status based on the childIdentifier supplied - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// values to update in child account status - /// Task of void - System.Threading.Tasks.Task UpdateChildAccountStatusAsync (string childIdentifier, UpdateChildAccountStatus updateChildAccountStatus); - - /// - /// Update info of reseller's child account status based on the childIdentifier supplied - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// values to update in child account status - /// Task of ApiResponse - System.Threading.Tasks.Task> UpdateChildAccountStatusAsyncWithHttpInfo (string childIdentifier, UpdateChildAccountStatus updateChildAccountStatus); - /// - /// Update the sender domain of reseller's child based on the childIdentifier and domainName passed - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Pass the existing domain that needs to be updated - /// value to update for sender domain - /// Task of void - System.Threading.Tasks.Task UpdateChildDomainAsync (string childIdentifier, string domainName, UpdateChildDomain updateChildDomain); - - /// - /// Update the sender domain of reseller's child based on the childIdentifier and domainName passed - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Pass the existing domain that needs to be updated - /// value to update for sender domain - /// Task of ApiResponse - System.Threading.Tasks.Task> UpdateChildDomainAsyncWithHttpInfo (string childIdentifier, string domainName, UpdateChildDomain updateChildDomain); - /// - /// Update info of reseller's child based on the child identifier supplied - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// values to update in child profile - /// Task of void - System.Threading.Tasks.Task UpdateResellerChildAsync (string childIdentifier, UpdateChild resellerChild); - - /// - /// Update info of reseller's child based on the child identifier supplied - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// values to update in child profile - /// Task of ApiResponse - System.Threading.Tasks.Task> UpdateResellerChildAsyncWithHttpInfo (string childIdentifier, UpdateChild resellerChild); - #endregion Asynchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public partial class ResellerApi : IResellerApi - { - private sib_api_v3_sdk.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// - /// - public ResellerApi(String basePath) - { - this.Configuration = new sib_api_v3_sdk.Client.Configuration { BasePath = basePath }; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using Configuration object - /// - /// An instance of Configuration - /// - public ResellerApi(sib_api_v3_sdk.Client.Configuration configuration = null) - { - if (configuration == null) // use the default one in Configuration - this.Configuration = sib_api_v3_sdk.Client.Configuration.Default; - else - this.Configuration = configuration; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] - public void SetBasePath(String basePath) - { - // do nothing - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public sib_api_v3_sdk.Client.Configuration Configuration {get; set;} - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public sib_api_v3_sdk.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - /// - /// Gets the default header. - /// - /// Dictionary of HTTP header - [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] - public IDictionary DefaultHeader() - { - return new ReadOnlyDictionary(this.Configuration.DefaultHeader); - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] - public void AddDefaultHeader(string key, string value) - { - this.Configuration.AddDefaultHeader(key, value); - } - - /// - /// Add Email and/or SMS credits to a specific child account - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Values to post to add credit to a specific child account - /// RemainingCreditModel - public RemainingCreditModel AddCredits (string childIdentifier, AddCredits addCredits) - { - ApiResponse localVarResponse = AddCreditsWithHttpInfo(childIdentifier, addCredits); - return localVarResponse.Data; - } - - /// - /// Add Email and/or SMS credits to a specific child account - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Values to post to add credit to a specific child account - /// ApiResponse of RemainingCreditModel - public ApiResponse< RemainingCreditModel > AddCreditsWithHttpInfo (string childIdentifier, AddCredits addCredits) - { - // verify the required parameter 'childIdentifier' is set - if (childIdentifier == null) - throw new ApiException(400, "Missing required parameter 'childIdentifier' when calling ResellerApi->AddCredits"); - // verify the required parameter 'addCredits' is set - if (addCredits == null) - throw new ApiException(400, "Missing required parameter 'addCredits' when calling ResellerApi->AddCredits"); - - var localVarPath = "./reseller/children/{childIdentifier}/credits/add"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (childIdentifier != null) localVarPathParams.Add("childIdentifier", this.Configuration.ApiClient.ParameterToString(childIdentifier)); // path parameter - if (addCredits != null && addCredits.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(addCredits); // http body (model) parameter - } - else - { - localVarPostBody = addCredits; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("AddCredits", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (RemainingCreditModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(RemainingCreditModel))); - } - - /// - /// Add Email and/or SMS credits to a specific child account - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Values to post to add credit to a specific child account - /// Task of RemainingCreditModel - public async System.Threading.Tasks.Task AddCreditsAsync (string childIdentifier, AddCredits addCredits) - { - ApiResponse localVarResponse = await AddCreditsAsyncWithHttpInfo(childIdentifier, addCredits); - return localVarResponse.Data; - - } - - /// - /// Add Email and/or SMS credits to a specific child account - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Values to post to add credit to a specific child account - /// Task of ApiResponse (RemainingCreditModel) - public async System.Threading.Tasks.Task> AddCreditsAsyncWithHttpInfo (string childIdentifier, AddCredits addCredits) - { - // verify the required parameter 'childIdentifier' is set - if (childIdentifier == null) - throw new ApiException(400, "Missing required parameter 'childIdentifier' when calling ResellerApi->AddCredits"); - // verify the required parameter 'addCredits' is set - if (addCredits == null) - throw new ApiException(400, "Missing required parameter 'addCredits' when calling ResellerApi->AddCredits"); - - var localVarPath = "./reseller/children/{childIdentifier}/credits/add"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (childIdentifier != null) localVarPathParams.Add("childIdentifier", this.Configuration.ApiClient.ParameterToString(childIdentifier)); // path parameter - if (addCredits != null && addCredits.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(addCredits); // http body (model) parameter - } - else - { - localVarPostBody = addCredits; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("AddCredits", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (RemainingCreditModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(RemainingCreditModel))); - } - - /// - /// Associate a dedicated IP to the child - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// IP to associate - /// - public void AssociateIpToChild (string childIdentifier, ManageIp ip) - { - AssociateIpToChildWithHttpInfo(childIdentifier, ip); - } - - /// - /// Associate a dedicated IP to the child - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// IP to associate - /// ApiResponse of Object(void) - public ApiResponse AssociateIpToChildWithHttpInfo (string childIdentifier, ManageIp ip) - { - // verify the required parameter 'childIdentifier' is set - if (childIdentifier == null) - throw new ApiException(400, "Missing required parameter 'childIdentifier' when calling ResellerApi->AssociateIpToChild"); - // verify the required parameter 'ip' is set - if (ip == null) - throw new ApiException(400, "Missing required parameter 'ip' when calling ResellerApi->AssociateIpToChild"); - - var localVarPath = "./reseller/children/{childIdentifier}/ips/associate"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (childIdentifier != null) localVarPathParams.Add("childIdentifier", this.Configuration.ApiClient.ParameterToString(childIdentifier)); // path parameter - if (ip != null && ip.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(ip); // http body (model) parameter - } - else - { - localVarPostBody = ip; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("AssociateIpToChild", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Associate a dedicated IP to the child - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// IP to associate - /// Task of void - public async System.Threading.Tasks.Task AssociateIpToChildAsync (string childIdentifier, ManageIp ip) - { - await AssociateIpToChildAsyncWithHttpInfo(childIdentifier, ip); - - } - - /// - /// Associate a dedicated IP to the child - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// IP to associate - /// Task of ApiResponse - public async System.Threading.Tasks.Task> AssociateIpToChildAsyncWithHttpInfo (string childIdentifier, ManageIp ip) - { - // verify the required parameter 'childIdentifier' is set - if (childIdentifier == null) - throw new ApiException(400, "Missing required parameter 'childIdentifier' when calling ResellerApi->AssociateIpToChild"); - // verify the required parameter 'ip' is set - if (ip == null) - throw new ApiException(400, "Missing required parameter 'ip' when calling ResellerApi->AssociateIpToChild"); - - var localVarPath = "./reseller/children/{childIdentifier}/ips/associate"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (childIdentifier != null) localVarPathParams.Add("childIdentifier", this.Configuration.ApiClient.ParameterToString(childIdentifier)); // path parameter - if (ip != null && ip.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(ip); // http body (model) parameter - } - else - { - localVarPostBody = ip; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("AssociateIpToChild", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Create a domain for a child account - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Sender domain to add for a specific child account. This will not be displayed to the parent account. - /// - public void CreateChildDomain (string childIdentifier, AddChildDomain addChildDomain) - { - CreateChildDomainWithHttpInfo(childIdentifier, addChildDomain); - } - - /// - /// Create a domain for a child account - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Sender domain to add for a specific child account. This will not be displayed to the parent account. - /// ApiResponse of Object(void) - public ApiResponse CreateChildDomainWithHttpInfo (string childIdentifier, AddChildDomain addChildDomain) - { - // verify the required parameter 'childIdentifier' is set - if (childIdentifier == null) - throw new ApiException(400, "Missing required parameter 'childIdentifier' when calling ResellerApi->CreateChildDomain"); - // verify the required parameter 'addChildDomain' is set - if (addChildDomain == null) - throw new ApiException(400, "Missing required parameter 'addChildDomain' when calling ResellerApi->CreateChildDomain"); - - var localVarPath = "./reseller/children/{childIdentifier}/domains"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (childIdentifier != null) localVarPathParams.Add("childIdentifier", this.Configuration.ApiClient.ParameterToString(childIdentifier)); // path parameter - if (addChildDomain != null && addChildDomain.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(addChildDomain); // http body (model) parameter - } - else - { - localVarPostBody = addChildDomain; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateChildDomain", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Create a domain for a child account - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Sender domain to add for a specific child account. This will not be displayed to the parent account. - /// Task of void - public async System.Threading.Tasks.Task CreateChildDomainAsync (string childIdentifier, AddChildDomain addChildDomain) - { - await CreateChildDomainAsyncWithHttpInfo(childIdentifier, addChildDomain); - - } - - /// - /// Create a domain for a child account - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Sender domain to add for a specific child account. This will not be displayed to the parent account. - /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateChildDomainAsyncWithHttpInfo (string childIdentifier, AddChildDomain addChildDomain) - { - // verify the required parameter 'childIdentifier' is set - if (childIdentifier == null) - throw new ApiException(400, "Missing required parameter 'childIdentifier' when calling ResellerApi->CreateChildDomain"); - // verify the required parameter 'addChildDomain' is set - if (addChildDomain == null) - throw new ApiException(400, "Missing required parameter 'addChildDomain' when calling ResellerApi->CreateChildDomain"); - - var localVarPath = "./reseller/children/{childIdentifier}/domains"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (childIdentifier != null) localVarPathParams.Add("childIdentifier", this.Configuration.ApiClient.ParameterToString(childIdentifier)); // path parameter - if (addChildDomain != null && addChildDomain.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(addChildDomain); // http body (model) parameter - } - else - { - localVarPostBody = addChildDomain; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateChildDomain", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Creates a reseller child - /// - /// Thrown when fails to make API call - /// reseller child to add (optional) - /// CreateReseller - public CreateReseller CreateResellerChild (CreateChild resellerChild = null) - { - ApiResponse localVarResponse = CreateResellerChildWithHttpInfo(resellerChild); - return localVarResponse.Data; - } - - /// - /// Creates a reseller child - /// - /// Thrown when fails to make API call - /// reseller child to add (optional) - /// ApiResponse of CreateReseller - public ApiResponse< CreateReseller > CreateResellerChildWithHttpInfo (CreateChild resellerChild = null) - { - - var localVarPath = "./reseller/children"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (resellerChild != null && resellerChild.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(resellerChild); // http body (model) parameter - } - else - { - localVarPostBody = resellerChild; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateResellerChild", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateReseller) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateReseller))); - } - - /// - /// Creates a reseller child - /// - /// Thrown when fails to make API call - /// reseller child to add (optional) - /// Task of CreateReseller - public async System.Threading.Tasks.Task CreateResellerChildAsync (CreateChild resellerChild = null) - { - ApiResponse localVarResponse = await CreateResellerChildAsyncWithHttpInfo(resellerChild); - return localVarResponse.Data; - - } - - /// - /// Creates a reseller child - /// - /// Thrown when fails to make API call - /// reseller child to add (optional) - /// Task of ApiResponse (CreateReseller) - public async System.Threading.Tasks.Task> CreateResellerChildAsyncWithHttpInfo (CreateChild resellerChild = null) - { - - var localVarPath = "./reseller/children"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (resellerChild != null && resellerChild.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(resellerChild); // http body (model) parameter - } - else - { - localVarPostBody = resellerChild; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateResellerChild", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateReseller) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateReseller))); - } - - /// - /// Delete the sender domain of the reseller child based on the childIdentifier and domainName passed - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Pass the existing domain that needs to be deleted - /// - public void DeleteChildDomain (string childIdentifier, string domainName) - { - DeleteChildDomainWithHttpInfo(childIdentifier, domainName); - } - - /// - /// Delete the sender domain of the reseller child based on the childIdentifier and domainName passed - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Pass the existing domain that needs to be deleted - /// ApiResponse of Object(void) - public ApiResponse DeleteChildDomainWithHttpInfo (string childIdentifier, string domainName) - { - // verify the required parameter 'childIdentifier' is set - if (childIdentifier == null) - throw new ApiException(400, "Missing required parameter 'childIdentifier' when calling ResellerApi->DeleteChildDomain"); - // verify the required parameter 'domainName' is set - if (domainName == null) - throw new ApiException(400, "Missing required parameter 'domainName' when calling ResellerApi->DeleteChildDomain"); - - var localVarPath = "./reseller/children/{childIdentifier}/domains/{domainName}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (childIdentifier != null) localVarPathParams.Add("childIdentifier", this.Configuration.ApiClient.ParameterToString(childIdentifier)); // path parameter - if (domainName != null) localVarPathParams.Add("domainName", this.Configuration.ApiClient.ParameterToString(domainName)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteChildDomain", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete the sender domain of the reseller child based on the childIdentifier and domainName passed - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Pass the existing domain that needs to be deleted - /// Task of void - public async System.Threading.Tasks.Task DeleteChildDomainAsync (string childIdentifier, string domainName) - { - await DeleteChildDomainAsyncWithHttpInfo(childIdentifier, domainName); - - } - - /// - /// Delete the sender domain of the reseller child based on the childIdentifier and domainName passed - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Pass the existing domain that needs to be deleted - /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeleteChildDomainAsyncWithHttpInfo (string childIdentifier, string domainName) - { - // verify the required parameter 'childIdentifier' is set - if (childIdentifier == null) - throw new ApiException(400, "Missing required parameter 'childIdentifier' when calling ResellerApi->DeleteChildDomain"); - // verify the required parameter 'domainName' is set - if (domainName == null) - throw new ApiException(400, "Missing required parameter 'domainName' when calling ResellerApi->DeleteChildDomain"); - - var localVarPath = "./reseller/children/{childIdentifier}/domains/{domainName}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (childIdentifier != null) localVarPathParams.Add("childIdentifier", this.Configuration.ApiClient.ParameterToString(childIdentifier)); // path parameter - if (domainName != null) localVarPathParams.Add("domainName", this.Configuration.ApiClient.ParameterToString(domainName)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteChildDomain", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete a single reseller child based on the child identifier supplied - /// - /// Thrown when fails to make API call - /// Either auth key or child id of reseller's child - /// - public void DeleteResellerChild (string childIdentifier) - { - DeleteResellerChildWithHttpInfo(childIdentifier); - } - - /// - /// Delete a single reseller child based on the child identifier supplied - /// - /// Thrown when fails to make API call - /// Either auth key or child id of reseller's child - /// ApiResponse of Object(void) - public ApiResponse DeleteResellerChildWithHttpInfo (string childIdentifier) - { - // verify the required parameter 'childIdentifier' is set - if (childIdentifier == null) - throw new ApiException(400, "Missing required parameter 'childIdentifier' when calling ResellerApi->DeleteResellerChild"); - - var localVarPath = "./reseller/children/{childIdentifier}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (childIdentifier != null) localVarPathParams.Add("childIdentifier", this.Configuration.ApiClient.ParameterToString(childIdentifier)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteResellerChild", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete a single reseller child based on the child identifier supplied - /// - /// Thrown when fails to make API call - /// Either auth key or child id of reseller's child - /// Task of void - public async System.Threading.Tasks.Task DeleteResellerChildAsync (string childIdentifier) - { - await DeleteResellerChildAsyncWithHttpInfo(childIdentifier); - - } - - /// - /// Delete a single reseller child based on the child identifier supplied - /// - /// Thrown when fails to make API call - /// Either auth key or child id of reseller's child - /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeleteResellerChildAsyncWithHttpInfo (string childIdentifier) - { - // verify the required parameter 'childIdentifier' is set - if (childIdentifier == null) - throw new ApiException(400, "Missing required parameter 'childIdentifier' when calling ResellerApi->DeleteResellerChild"); - - var localVarPath = "./reseller/children/{childIdentifier}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (childIdentifier != null) localVarPathParams.Add("childIdentifier", this.Configuration.ApiClient.ParameterToString(childIdentifier)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteResellerChild", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Dissociate a dedicated IP to the child - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// IP to dissociate - /// - public void DissociateIpFromChild (string childIdentifier, ManageIp ip) - { - DissociateIpFromChildWithHttpInfo(childIdentifier, ip); - } - - /// - /// Dissociate a dedicated IP to the child - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// IP to dissociate - /// ApiResponse of Object(void) - public ApiResponse DissociateIpFromChildWithHttpInfo (string childIdentifier, ManageIp ip) - { - // verify the required parameter 'childIdentifier' is set - if (childIdentifier == null) - throw new ApiException(400, "Missing required parameter 'childIdentifier' when calling ResellerApi->DissociateIpFromChild"); - // verify the required parameter 'ip' is set - if (ip == null) - throw new ApiException(400, "Missing required parameter 'ip' when calling ResellerApi->DissociateIpFromChild"); - - var localVarPath = "./reseller/children/{childIdentifier}/ips/dissociate"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (childIdentifier != null) localVarPathParams.Add("childIdentifier", this.Configuration.ApiClient.ParameterToString(childIdentifier)); // path parameter - if (ip != null && ip.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(ip); // http body (model) parameter - } - else - { - localVarPostBody = ip; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DissociateIpFromChild", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Dissociate a dedicated IP to the child - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// IP to dissociate - /// Task of void - public async System.Threading.Tasks.Task DissociateIpFromChildAsync (string childIdentifier, ManageIp ip) - { - await DissociateIpFromChildAsyncWithHttpInfo(childIdentifier, ip); - - } - - /// - /// Dissociate a dedicated IP to the child - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// IP to dissociate - /// Task of ApiResponse - public async System.Threading.Tasks.Task> DissociateIpFromChildAsyncWithHttpInfo (string childIdentifier, ManageIp ip) - { - // verify the required parameter 'childIdentifier' is set - if (childIdentifier == null) - throw new ApiException(400, "Missing required parameter 'childIdentifier' when calling ResellerApi->DissociateIpFromChild"); - // verify the required parameter 'ip' is set - if (ip == null) - throw new ApiException(400, "Missing required parameter 'ip' when calling ResellerApi->DissociateIpFromChild"); - - var localVarPath = "./reseller/children/{childIdentifier}/ips/dissociate"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (childIdentifier != null) localVarPathParams.Add("childIdentifier", this.Configuration.ApiClient.ParameterToString(childIdentifier)); // path parameter - if (ip != null && ip.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(ip); // http body (model) parameter - } - else - { - localVarPostBody = ip; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DissociateIpFromChild", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Get the status of a reseller's child account creation, whether it is successfully created (exists) or not based on the identifier supplied - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// GetChildAccountCreationStatus - public GetChildAccountCreationStatus GetChildAccountCreationStatus (string childIdentifier) - { - ApiResponse localVarResponse = GetChildAccountCreationStatusWithHttpInfo(childIdentifier); - return localVarResponse.Data; - } - - /// - /// Get the status of a reseller's child account creation, whether it is successfully created (exists) or not based on the identifier supplied - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// ApiResponse of GetChildAccountCreationStatus - public ApiResponse< GetChildAccountCreationStatus > GetChildAccountCreationStatusWithHttpInfo (string childIdentifier) - { - // verify the required parameter 'childIdentifier' is set - if (childIdentifier == null) - throw new ApiException(400, "Missing required parameter 'childIdentifier' when calling ResellerApi->GetChildAccountCreationStatus"); - - var localVarPath = "./reseller/children/{childIdentifier}/accountCreationStatus"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (childIdentifier != null) localVarPathParams.Add("childIdentifier", this.Configuration.ApiClient.ParameterToString(childIdentifier)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetChildAccountCreationStatus", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetChildAccountCreationStatus) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetChildAccountCreationStatus))); - } - - /// - /// Get the status of a reseller's child account creation, whether it is successfully created (exists) or not based on the identifier supplied - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Task of GetChildAccountCreationStatus - public async System.Threading.Tasks.Task GetChildAccountCreationStatusAsync (string childIdentifier) - { - ApiResponse localVarResponse = await GetChildAccountCreationStatusAsyncWithHttpInfo(childIdentifier); - return localVarResponse.Data; - - } - - /// - /// Get the status of a reseller's child account creation, whether it is successfully created (exists) or not based on the identifier supplied - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Task of ApiResponse (GetChildAccountCreationStatus) - public async System.Threading.Tasks.Task> GetChildAccountCreationStatusAsyncWithHttpInfo (string childIdentifier) - { - // verify the required parameter 'childIdentifier' is set - if (childIdentifier == null) - throw new ApiException(400, "Missing required parameter 'childIdentifier' when calling ResellerApi->GetChildAccountCreationStatus"); - - var localVarPath = "./reseller/children/{childIdentifier}/accountCreationStatus"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (childIdentifier != null) localVarPathParams.Add("childIdentifier", this.Configuration.ApiClient.ParameterToString(childIdentifier)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetChildAccountCreationStatus", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetChildAccountCreationStatus) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetChildAccountCreationStatus))); - } - - /// - /// Get all sender domains for a specific child account - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// GetChildDomains - public GetChildDomains GetChildDomains (string childIdentifier) - { - ApiResponse localVarResponse = GetChildDomainsWithHttpInfo(childIdentifier); - return localVarResponse.Data; - } - - /// - /// Get all sender domains for a specific child account - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// ApiResponse of GetChildDomains - public ApiResponse< GetChildDomains > GetChildDomainsWithHttpInfo (string childIdentifier) - { - // verify the required parameter 'childIdentifier' is set - if (childIdentifier == null) - throw new ApiException(400, "Missing required parameter 'childIdentifier' when calling ResellerApi->GetChildDomains"); - - var localVarPath = "./reseller/children/{childIdentifier}/domains"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (childIdentifier != null) localVarPathParams.Add("childIdentifier", this.Configuration.ApiClient.ParameterToString(childIdentifier)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetChildDomains", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetChildDomains) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetChildDomains))); - } - - /// - /// Get all sender domains for a specific child account - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Task of GetChildDomains - public async System.Threading.Tasks.Task GetChildDomainsAsync (string childIdentifier) - { - ApiResponse localVarResponse = await GetChildDomainsAsyncWithHttpInfo(childIdentifier); - return localVarResponse.Data; - - } - - /// - /// Get all sender domains for a specific child account - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Task of ApiResponse (GetChildDomains) - public async System.Threading.Tasks.Task> GetChildDomainsAsyncWithHttpInfo (string childIdentifier) - { - // verify the required parameter 'childIdentifier' is set - if (childIdentifier == null) - throw new ApiException(400, "Missing required parameter 'childIdentifier' when calling ResellerApi->GetChildDomains"); - - var localVarPath = "./reseller/children/{childIdentifier}/domains"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (childIdentifier != null) localVarPathParams.Add("childIdentifier", this.Configuration.ApiClient.ParameterToString(childIdentifier)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetChildDomains", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetChildDomains) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetChildDomains))); - } - - /// - /// Get a child account's details - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// GetChildInfo - public GetChildInfo GetChildInfo (string childIdentifier) - { - ApiResponse localVarResponse = GetChildInfoWithHttpInfo(childIdentifier); - return localVarResponse.Data; - } - - /// - /// Get a child account's details - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// ApiResponse of GetChildInfo - public ApiResponse< GetChildInfo > GetChildInfoWithHttpInfo (string childIdentifier) - { - // verify the required parameter 'childIdentifier' is set - if (childIdentifier == null) - throw new ApiException(400, "Missing required parameter 'childIdentifier' when calling ResellerApi->GetChildInfo"); - - var localVarPath = "./reseller/children/{childIdentifier}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (childIdentifier != null) localVarPathParams.Add("childIdentifier", this.Configuration.ApiClient.ParameterToString(childIdentifier)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetChildInfo", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetChildInfo) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetChildInfo))); - } - - /// - /// Get a child account's details - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Task of GetChildInfo - public async System.Threading.Tasks.Task GetChildInfoAsync (string childIdentifier) - { - ApiResponse localVarResponse = await GetChildInfoAsyncWithHttpInfo(childIdentifier); - return localVarResponse.Data; - - } - - /// - /// Get a child account's details - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Task of ApiResponse (GetChildInfo) - public async System.Threading.Tasks.Task> GetChildInfoAsyncWithHttpInfo (string childIdentifier) - { - // verify the required parameter 'childIdentifier' is set - if (childIdentifier == null) - throw new ApiException(400, "Missing required parameter 'childIdentifier' when calling ResellerApi->GetChildInfo"); - - var localVarPath = "./reseller/children/{childIdentifier}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (childIdentifier != null) localVarPathParams.Add("childIdentifier", this.Configuration.ApiClient.ParameterToString(childIdentifier)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetChildInfo", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetChildInfo) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetChildInfo))); - } - - /// - /// Get the list of all children accounts - /// - /// Thrown when fails to make API call - /// Number of documents for child accounts information per page (optional, default to 10) - /// Index of the first document in the page (optional, default to 0) - /// GetChildrenList - public GetChildrenList GetResellerChilds (long? limit = null, long? offset = null) - { - ApiResponse localVarResponse = GetResellerChildsWithHttpInfo(limit, offset); - return localVarResponse.Data; - } - - /// - /// Get the list of all children accounts - /// - /// Thrown when fails to make API call - /// Number of documents for child accounts information per page (optional, default to 10) - /// Index of the first document in the page (optional, default to 0) - /// ApiResponse of GetChildrenList - public ApiResponse< GetChildrenList > GetResellerChildsWithHttpInfo (long? limit = null, long? offset = null) - { - - var localVarPath = "./reseller/children"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetResellerChilds", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetChildrenList) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetChildrenList))); - } - - /// - /// Get the list of all children accounts - /// - /// Thrown when fails to make API call - /// Number of documents for child accounts information per page (optional, default to 10) - /// Index of the first document in the page (optional, default to 0) - /// Task of GetChildrenList - public async System.Threading.Tasks.Task GetResellerChildsAsync (long? limit = null, long? offset = null) - { - ApiResponse localVarResponse = await GetResellerChildsAsyncWithHttpInfo(limit, offset); - return localVarResponse.Data; - - } - - /// - /// Get the list of all children accounts - /// - /// Thrown when fails to make API call - /// Number of documents for child accounts information per page (optional, default to 10) - /// Index of the first document in the page (optional, default to 0) - /// Task of ApiResponse (GetChildrenList) - public async System.Threading.Tasks.Task> GetResellerChildsAsyncWithHttpInfo (long? limit = null, long? offset = null) - { - - var localVarPath = "./reseller/children"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetResellerChilds", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetChildrenList) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetChildrenList))); - } - - /// - /// Get session token to access Sendinblue (SSO) It returns a session [token] which will remain valid for a short period of time. A child account will be able to access a white-labeled section by using the following url pattern => https:/email.mydomain.com/login/sso?token=[token] - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// GetSsoToken - public GetSsoToken GetSsoToken (string childIdentifier) - { - ApiResponse localVarResponse = GetSsoTokenWithHttpInfo(childIdentifier); - return localVarResponse.Data; - } - - /// - /// Get session token to access Sendinblue (SSO) It returns a session [token] which will remain valid for a short period of time. A child account will be able to access a white-labeled section by using the following url pattern => https:/email.mydomain.com/login/sso?token=[token] - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// ApiResponse of GetSsoToken - public ApiResponse< GetSsoToken > GetSsoTokenWithHttpInfo (string childIdentifier) - { - // verify the required parameter 'childIdentifier' is set - if (childIdentifier == null) - throw new ApiException(400, "Missing required parameter 'childIdentifier' when calling ResellerApi->GetSsoToken"); - - var localVarPath = "./reseller/children/{childIdentifier}/auth"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (childIdentifier != null) localVarPathParams.Add("childIdentifier", this.Configuration.ApiClient.ParameterToString(childIdentifier)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetSsoToken", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetSsoToken) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSsoToken))); - } - - /// - /// Get session token to access Sendinblue (SSO) It returns a session [token] which will remain valid for a short period of time. A child account will be able to access a white-labeled section by using the following url pattern => https:/email.mydomain.com/login/sso?token=[token] - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Task of GetSsoToken - public async System.Threading.Tasks.Task GetSsoTokenAsync (string childIdentifier) - { - ApiResponse localVarResponse = await GetSsoTokenAsyncWithHttpInfo(childIdentifier); - return localVarResponse.Data; - - } - - /// - /// Get session token to access Sendinblue (SSO) It returns a session [token] which will remain valid for a short period of time. A child account will be able to access a white-labeled section by using the following url pattern => https:/email.mydomain.com/login/sso?token=[token] - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Task of ApiResponse (GetSsoToken) - public async System.Threading.Tasks.Task> GetSsoTokenAsyncWithHttpInfo (string childIdentifier) - { - // verify the required parameter 'childIdentifier' is set - if (childIdentifier == null) - throw new ApiException(400, "Missing required parameter 'childIdentifier' when calling ResellerApi->GetSsoToken"); - - var localVarPath = "./reseller/children/{childIdentifier}/auth"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (childIdentifier != null) localVarPathParams.Add("childIdentifier", this.Configuration.ApiClient.ParameterToString(childIdentifier)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetSsoToken", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetSsoToken) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSsoToken))); - } - - /// - /// Remove Email and/or SMS credits from a specific child account - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Values to post to remove email or SMS credits from a specific child account - /// RemainingCreditModel - public RemainingCreditModel RemoveCredits (string childIdentifier, RemoveCredits removeCredits) - { - ApiResponse localVarResponse = RemoveCreditsWithHttpInfo(childIdentifier, removeCredits); - return localVarResponse.Data; - } - - /// - /// Remove Email and/or SMS credits from a specific child account - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Values to post to remove email or SMS credits from a specific child account - /// ApiResponse of RemainingCreditModel - public ApiResponse< RemainingCreditModel > RemoveCreditsWithHttpInfo (string childIdentifier, RemoveCredits removeCredits) - { - // verify the required parameter 'childIdentifier' is set - if (childIdentifier == null) - throw new ApiException(400, "Missing required parameter 'childIdentifier' when calling ResellerApi->RemoveCredits"); - // verify the required parameter 'removeCredits' is set - if (removeCredits == null) - throw new ApiException(400, "Missing required parameter 'removeCredits' when calling ResellerApi->RemoveCredits"); - - var localVarPath = "./reseller/children/{childIdentifier}/credits/remove"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (childIdentifier != null) localVarPathParams.Add("childIdentifier", this.Configuration.ApiClient.ParameterToString(childIdentifier)); // path parameter - if (removeCredits != null && removeCredits.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(removeCredits); // http body (model) parameter - } - else - { - localVarPostBody = removeCredits; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("RemoveCredits", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (RemainingCreditModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(RemainingCreditModel))); - } - - /// - /// Remove Email and/or SMS credits from a specific child account - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Values to post to remove email or SMS credits from a specific child account - /// Task of RemainingCreditModel - public async System.Threading.Tasks.Task RemoveCreditsAsync (string childIdentifier, RemoveCredits removeCredits) - { - ApiResponse localVarResponse = await RemoveCreditsAsyncWithHttpInfo(childIdentifier, removeCredits); - return localVarResponse.Data; - - } - - /// - /// Remove Email and/or SMS credits from a specific child account - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Values to post to remove email or SMS credits from a specific child account - /// Task of ApiResponse (RemainingCreditModel) - public async System.Threading.Tasks.Task> RemoveCreditsAsyncWithHttpInfo (string childIdentifier, RemoveCredits removeCredits) - { - // verify the required parameter 'childIdentifier' is set - if (childIdentifier == null) - throw new ApiException(400, "Missing required parameter 'childIdentifier' when calling ResellerApi->RemoveCredits"); - // verify the required parameter 'removeCredits' is set - if (removeCredits == null) - throw new ApiException(400, "Missing required parameter 'removeCredits' when calling ResellerApi->RemoveCredits"); - - var localVarPath = "./reseller/children/{childIdentifier}/credits/remove"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (childIdentifier != null) localVarPathParams.Add("childIdentifier", this.Configuration.ApiClient.ParameterToString(childIdentifier)); // path parameter - if (removeCredits != null && removeCredits.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(removeCredits); // http body (model) parameter - } - else - { - localVarPostBody = removeCredits; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("RemoveCredits", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (RemainingCreditModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(RemainingCreditModel))); - } - - /// - /// Update info of reseller's child account status based on the childIdentifier supplied - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// values to update in child account status - /// - public void UpdateChildAccountStatus (string childIdentifier, UpdateChildAccountStatus updateChildAccountStatus) - { - UpdateChildAccountStatusWithHttpInfo(childIdentifier, updateChildAccountStatus); - } - - /// - /// Update info of reseller's child account status based on the childIdentifier supplied - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// values to update in child account status - /// ApiResponse of Object(void) - public ApiResponse UpdateChildAccountStatusWithHttpInfo (string childIdentifier, UpdateChildAccountStatus updateChildAccountStatus) - { - // verify the required parameter 'childIdentifier' is set - if (childIdentifier == null) - throw new ApiException(400, "Missing required parameter 'childIdentifier' when calling ResellerApi->UpdateChildAccountStatus"); - // verify the required parameter 'updateChildAccountStatus' is set - if (updateChildAccountStatus == null) - throw new ApiException(400, "Missing required parameter 'updateChildAccountStatus' when calling ResellerApi->UpdateChildAccountStatus"); - - var localVarPath = "./reseller/children/{childIdentifier}/accountStatus"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (childIdentifier != null) localVarPathParams.Add("childIdentifier", this.Configuration.ApiClient.ParameterToString(childIdentifier)); // path parameter - if (updateChildAccountStatus != null && updateChildAccountStatus.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(updateChildAccountStatus); // http body (model) parameter - } - else - { - localVarPostBody = updateChildAccountStatus; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UpdateChildAccountStatus", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Update info of reseller's child account status based on the childIdentifier supplied - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// values to update in child account status - /// Task of void - public async System.Threading.Tasks.Task UpdateChildAccountStatusAsync (string childIdentifier, UpdateChildAccountStatus updateChildAccountStatus) - { - await UpdateChildAccountStatusAsyncWithHttpInfo(childIdentifier, updateChildAccountStatus); - - } - - /// - /// Update info of reseller's child account status based on the childIdentifier supplied - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// values to update in child account status - /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdateChildAccountStatusAsyncWithHttpInfo (string childIdentifier, UpdateChildAccountStatus updateChildAccountStatus) - { - // verify the required parameter 'childIdentifier' is set - if (childIdentifier == null) - throw new ApiException(400, "Missing required parameter 'childIdentifier' when calling ResellerApi->UpdateChildAccountStatus"); - // verify the required parameter 'updateChildAccountStatus' is set - if (updateChildAccountStatus == null) - throw new ApiException(400, "Missing required parameter 'updateChildAccountStatus' when calling ResellerApi->UpdateChildAccountStatus"); - - var localVarPath = "./reseller/children/{childIdentifier}/accountStatus"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (childIdentifier != null) localVarPathParams.Add("childIdentifier", this.Configuration.ApiClient.ParameterToString(childIdentifier)); // path parameter - if (updateChildAccountStatus != null && updateChildAccountStatus.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(updateChildAccountStatus); // http body (model) parameter - } - else - { - localVarPostBody = updateChildAccountStatus; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UpdateChildAccountStatus", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Update the sender domain of reseller's child based on the childIdentifier and domainName passed - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Pass the existing domain that needs to be updated - /// value to update for sender domain - /// - public void UpdateChildDomain (string childIdentifier, string domainName, UpdateChildDomain updateChildDomain) - { - UpdateChildDomainWithHttpInfo(childIdentifier, domainName, updateChildDomain); - } - - /// - /// Update the sender domain of reseller's child based on the childIdentifier and domainName passed - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Pass the existing domain that needs to be updated - /// value to update for sender domain - /// ApiResponse of Object(void) - public ApiResponse UpdateChildDomainWithHttpInfo (string childIdentifier, string domainName, UpdateChildDomain updateChildDomain) - { - // verify the required parameter 'childIdentifier' is set - if (childIdentifier == null) - throw new ApiException(400, "Missing required parameter 'childIdentifier' when calling ResellerApi->UpdateChildDomain"); - // verify the required parameter 'domainName' is set - if (domainName == null) - throw new ApiException(400, "Missing required parameter 'domainName' when calling ResellerApi->UpdateChildDomain"); - // verify the required parameter 'updateChildDomain' is set - if (updateChildDomain == null) - throw new ApiException(400, "Missing required parameter 'updateChildDomain' when calling ResellerApi->UpdateChildDomain"); - - var localVarPath = "./reseller/children/{childIdentifier}/domains/{domainName}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (childIdentifier != null) localVarPathParams.Add("childIdentifier", this.Configuration.ApiClient.ParameterToString(childIdentifier)); // path parameter - if (domainName != null) localVarPathParams.Add("domainName", this.Configuration.ApiClient.ParameterToString(domainName)); // path parameter - if (updateChildDomain != null && updateChildDomain.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(updateChildDomain); // http body (model) parameter - } - else - { - localVarPostBody = updateChildDomain; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UpdateChildDomain", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Update the sender domain of reseller's child based on the childIdentifier and domainName passed - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Pass the existing domain that needs to be updated - /// value to update for sender domain - /// Task of void - public async System.Threading.Tasks.Task UpdateChildDomainAsync (string childIdentifier, string domainName, UpdateChildDomain updateChildDomain) - { - await UpdateChildDomainAsyncWithHttpInfo(childIdentifier, domainName, updateChildDomain); - - } - - /// - /// Update the sender domain of reseller's child based on the childIdentifier and domainName passed - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// Pass the existing domain that needs to be updated - /// value to update for sender domain - /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdateChildDomainAsyncWithHttpInfo (string childIdentifier, string domainName, UpdateChildDomain updateChildDomain) - { - // verify the required parameter 'childIdentifier' is set - if (childIdentifier == null) - throw new ApiException(400, "Missing required parameter 'childIdentifier' when calling ResellerApi->UpdateChildDomain"); - // verify the required parameter 'domainName' is set - if (domainName == null) - throw new ApiException(400, "Missing required parameter 'domainName' when calling ResellerApi->UpdateChildDomain"); - // verify the required parameter 'updateChildDomain' is set - if (updateChildDomain == null) - throw new ApiException(400, "Missing required parameter 'updateChildDomain' when calling ResellerApi->UpdateChildDomain"); - - var localVarPath = "./reseller/children/{childIdentifier}/domains/{domainName}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (childIdentifier != null) localVarPathParams.Add("childIdentifier", this.Configuration.ApiClient.ParameterToString(childIdentifier)); // path parameter - if (domainName != null) localVarPathParams.Add("domainName", this.Configuration.ApiClient.ParameterToString(domainName)); // path parameter - if (updateChildDomain != null && updateChildDomain.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(updateChildDomain); // http body (model) parameter - } - else - { - localVarPostBody = updateChildDomain; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UpdateChildDomain", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Update info of reseller's child based on the child identifier supplied - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// values to update in child profile - /// - public void UpdateResellerChild (string childIdentifier, UpdateChild resellerChild) - { - UpdateResellerChildWithHttpInfo(childIdentifier, resellerChild); - } - - /// - /// Update info of reseller's child based on the child identifier supplied - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// values to update in child profile - /// ApiResponse of Object(void) - public ApiResponse UpdateResellerChildWithHttpInfo (string childIdentifier, UpdateChild resellerChild) - { - // verify the required parameter 'childIdentifier' is set - if (childIdentifier == null) - throw new ApiException(400, "Missing required parameter 'childIdentifier' when calling ResellerApi->UpdateResellerChild"); - // verify the required parameter 'resellerChild' is set - if (resellerChild == null) - throw new ApiException(400, "Missing required parameter 'resellerChild' when calling ResellerApi->UpdateResellerChild"); - - var localVarPath = "./reseller/children/{childIdentifier}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (childIdentifier != null) localVarPathParams.Add("childIdentifier", this.Configuration.ApiClient.ParameterToString(childIdentifier)); // path parameter - if (resellerChild != null && resellerChild.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(resellerChild); // http body (model) parameter - } - else - { - localVarPostBody = resellerChild; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UpdateResellerChild", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Update info of reseller's child based on the child identifier supplied - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// values to update in child profile - /// Task of void - public async System.Threading.Tasks.Task UpdateResellerChildAsync (string childIdentifier, UpdateChild resellerChild) - { - await UpdateResellerChildAsyncWithHttpInfo(childIdentifier, resellerChild); - - } - - /// - /// Update info of reseller's child based on the child identifier supplied - /// - /// Thrown when fails to make API call - /// Either auth key or id of reseller's child - /// values to update in child profile - /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdateResellerChildAsyncWithHttpInfo (string childIdentifier, UpdateChild resellerChild) - { - // verify the required parameter 'childIdentifier' is set - if (childIdentifier == null) - throw new ApiException(400, "Missing required parameter 'childIdentifier' when calling ResellerApi->UpdateResellerChild"); - // verify the required parameter 'resellerChild' is set - if (resellerChild == null) - throw new ApiException(400, "Missing required parameter 'resellerChild' when calling ResellerApi->UpdateResellerChild"); - - var localVarPath = "./reseller/children/{childIdentifier}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (childIdentifier != null) localVarPathParams.Add("childIdentifier", this.Configuration.ApiClient.ParameterToString(childIdentifier)); // path parameter - if (resellerChild != null && resellerChild.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(resellerChild); // http body (model) parameter - } - else - { - localVarPostBody = resellerChild; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UpdateResellerChild", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - } -} diff --git a/src/sib_api_v3_sdk/Api/SMSCampaignsApi.cs b/src/sib_api_v3_sdk/Api/SMSCampaignsApi.cs deleted file mode 100644 index 899b989..0000000 --- a/src/sib_api_v3_sdk/Api/SMSCampaignsApi.cs +++ /dev/null @@ -1,2290 +0,0 @@ -/* - * SendinBlue API - * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :- -- -- -- -- -- --: | - -- -- -- -- -- -- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | - * - * OpenAPI spec version: 3.0.0 - * Contact: contact@sendinblue.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using RestSharp.Portable; -using sib_api_v3_sdk.Client; -using sib_api_v3_sdk.Model; - -namespace sib_api_v3_sdk.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface ISMSCampaignsApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Creates an SMS campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create an SMS Campaign - /// CreateModel - CreateModel CreateSmsCampaign (CreateSmsCampaign createSmsCampaign); - - /// - /// Creates an SMS campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create an SMS Campaign - /// ApiResponse of CreateModel - ApiResponse CreateSmsCampaignWithHttpInfo (CreateSmsCampaign createSmsCampaign); - /// - /// Delete an SMS campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the SMS campaign - /// - void DeleteSmsCampaign (long? campaignId); - - /// - /// Delete an SMS campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the SMS campaign - /// ApiResponse of Object(void) - ApiResponse DeleteSmsCampaignWithHttpInfo (long? campaignId); - /// - /// Get an SMS campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the SMS campaign - /// GetSmsCampaign - GetSmsCampaign GetSmsCampaign (long? campaignId); - - /// - /// Get an SMS campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the SMS campaign - /// ApiResponse of GetSmsCampaign - ApiResponse GetSmsCampaignWithHttpInfo (long? campaignId); - /// - /// Returns the information for all your created SMS campaigns - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Status of campaign. (optional) - /// Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Number limitation for the result returned (optional, default to 500) - /// Beginning point in the list to retrieve from. (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// GetSmsCampaigns - GetSmsCampaigns GetSmsCampaigns (string status = null, string startDate = null, string endDate = null, long? limit = null, long? offset = null, string sort = null); - - /// - /// Returns the information for all your created SMS campaigns - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Status of campaign. (optional) - /// Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Number limitation for the result returned (optional, default to 500) - /// Beginning point in the list to retrieve from. (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// ApiResponse of GetSmsCampaigns - ApiResponse GetSmsCampaignsWithHttpInfo (string status = null, string startDate = null, string endDate = null, long? limit = null, long? offset = null, string sort = null); - /// - /// Export an SMS campaign's recipients - /// - /// - /// It returns the background process ID which on completion calls the notify URL that you have set in the input. - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Values to send for a recipient export request (optional) - /// CreatedProcessId - CreatedProcessId RequestSmsRecipientExport (long? campaignId, RequestSmsRecipientExport recipientExport = null); - - /// - /// Export an SMS campaign's recipients - /// - /// - /// It returns the background process ID which on completion calls the notify URL that you have set in the input. - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Values to send for a recipient export request (optional) - /// ApiResponse of CreatedProcessId - ApiResponse RequestSmsRecipientExportWithHttpInfo (long? campaignId, RequestSmsRecipientExport recipientExport = null); - /// - /// Send your SMS campaign immediately - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the campaign - /// - void SendSmsCampaignNow (long? campaignId); - - /// - /// Send your SMS campaign immediately - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the campaign - /// ApiResponse of Object(void) - ApiResponse SendSmsCampaignNowWithHttpInfo (long? campaignId); - /// - /// Send an SMS campaign's report - /// - /// - /// Send report of Sent and Archived campaign, to the specified email addresses, with respective data and a pdf attachment in detail. - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Values for send a report - /// - void SendSmsReport (long? campaignId, SendReport sendReport); - - /// - /// Send an SMS campaign's report - /// - /// - /// Send report of Sent and Archived campaign, to the specified email addresses, with respective data and a pdf attachment in detail. - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Values for send a report - /// ApiResponse of Object(void) - ApiResponse SendSmsReportWithHttpInfo (long? campaignId, SendReport sendReport); - /// - /// Send a test SMS campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the SMS campaign - /// Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted - /// - void SendTestSms (long? campaignId, SendTestSms phoneNumber); - - /// - /// Send a test SMS campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the SMS campaign - /// Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted - /// ApiResponse of Object(void) - ApiResponse SendTestSmsWithHttpInfo (long? campaignId, SendTestSms phoneNumber); - /// - /// Update an SMS campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the SMS campaign - /// Values to update an SMS Campaign - /// - void UpdateSmsCampaign (long? campaignId, UpdateSmsCampaign updateSmsCampaign); - - /// - /// Update an SMS campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the SMS campaign - /// Values to update an SMS Campaign - /// ApiResponse of Object(void) - ApiResponse UpdateSmsCampaignWithHttpInfo (long? campaignId, UpdateSmsCampaign updateSmsCampaign); - /// - /// Update a campaign's status - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Status of the campaign. - /// - void UpdateSmsCampaignStatus (long? campaignId, UpdateCampaignStatus status); - - /// - /// Update a campaign's status - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Status of the campaign. - /// ApiResponse of Object(void) - ApiResponse UpdateSmsCampaignStatusWithHttpInfo (long? campaignId, UpdateCampaignStatus status); - #endregion Synchronous Operations - #region Asynchronous Operations - /// - /// Creates an SMS campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create an SMS Campaign - /// Task of CreateModel - System.Threading.Tasks.Task CreateSmsCampaignAsync (CreateSmsCampaign createSmsCampaign); - - /// - /// Creates an SMS campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create an SMS Campaign - /// Task of ApiResponse (CreateModel) - System.Threading.Tasks.Task> CreateSmsCampaignAsyncWithHttpInfo (CreateSmsCampaign createSmsCampaign); - /// - /// Delete an SMS campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the SMS campaign - /// Task of void - System.Threading.Tasks.Task DeleteSmsCampaignAsync (long? campaignId); - - /// - /// Delete an SMS campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the SMS campaign - /// Task of ApiResponse - System.Threading.Tasks.Task> DeleteSmsCampaignAsyncWithHttpInfo (long? campaignId); - /// - /// Get an SMS campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the SMS campaign - /// Task of GetSmsCampaign - System.Threading.Tasks.Task GetSmsCampaignAsync (long? campaignId); - - /// - /// Get an SMS campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the SMS campaign - /// Task of ApiResponse (GetSmsCampaign) - System.Threading.Tasks.Task> GetSmsCampaignAsyncWithHttpInfo (long? campaignId); - /// - /// Returns the information for all your created SMS campaigns - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Status of campaign. (optional) - /// Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Number limitation for the result returned (optional, default to 500) - /// Beginning point in the list to retrieve from. (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of GetSmsCampaigns - System.Threading.Tasks.Task GetSmsCampaignsAsync (string status = null, string startDate = null, string endDate = null, long? limit = null, long? offset = null, string sort = null); - - /// - /// Returns the information for all your created SMS campaigns - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Status of campaign. (optional) - /// Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Number limitation for the result returned (optional, default to 500) - /// Beginning point in the list to retrieve from. (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of ApiResponse (GetSmsCampaigns) - System.Threading.Tasks.Task> GetSmsCampaignsAsyncWithHttpInfo (string status = null, string startDate = null, string endDate = null, long? limit = null, long? offset = null, string sort = null); - /// - /// Export an SMS campaign's recipients - /// - /// - /// It returns the background process ID which on completion calls the notify URL that you have set in the input. - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Values to send for a recipient export request (optional) - /// Task of CreatedProcessId - System.Threading.Tasks.Task RequestSmsRecipientExportAsync (long? campaignId, RequestSmsRecipientExport recipientExport = null); - - /// - /// Export an SMS campaign's recipients - /// - /// - /// It returns the background process ID which on completion calls the notify URL that you have set in the input. - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Values to send for a recipient export request (optional) - /// Task of ApiResponse (CreatedProcessId) - System.Threading.Tasks.Task> RequestSmsRecipientExportAsyncWithHttpInfo (long? campaignId, RequestSmsRecipientExport recipientExport = null); - /// - /// Send your SMS campaign immediately - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Task of void - System.Threading.Tasks.Task SendSmsCampaignNowAsync (long? campaignId); - - /// - /// Send your SMS campaign immediately - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Task of ApiResponse - System.Threading.Tasks.Task> SendSmsCampaignNowAsyncWithHttpInfo (long? campaignId); - /// - /// Send an SMS campaign's report - /// - /// - /// Send report of Sent and Archived campaign, to the specified email addresses, with respective data and a pdf attachment in detail. - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Values for send a report - /// Task of void - System.Threading.Tasks.Task SendSmsReportAsync (long? campaignId, SendReport sendReport); - - /// - /// Send an SMS campaign's report - /// - /// - /// Send report of Sent and Archived campaign, to the specified email addresses, with respective data and a pdf attachment in detail. - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Values for send a report - /// Task of ApiResponse - System.Threading.Tasks.Task> SendSmsReportAsyncWithHttpInfo (long? campaignId, SendReport sendReport); - /// - /// Send a test SMS campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the SMS campaign - /// Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted - /// Task of void - System.Threading.Tasks.Task SendTestSmsAsync (long? campaignId, SendTestSms phoneNumber); - - /// - /// Send a test SMS campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the SMS campaign - /// Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted - /// Task of ApiResponse - System.Threading.Tasks.Task> SendTestSmsAsyncWithHttpInfo (long? campaignId, SendTestSms phoneNumber); - /// - /// Update an SMS campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the SMS campaign - /// Values to update an SMS Campaign - /// Task of void - System.Threading.Tasks.Task UpdateSmsCampaignAsync (long? campaignId, UpdateSmsCampaign updateSmsCampaign); - - /// - /// Update an SMS campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the SMS campaign - /// Values to update an SMS Campaign - /// Task of ApiResponse - System.Threading.Tasks.Task> UpdateSmsCampaignAsyncWithHttpInfo (long? campaignId, UpdateSmsCampaign updateSmsCampaign); - /// - /// Update a campaign's status - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Status of the campaign. - /// Task of void - System.Threading.Tasks.Task UpdateSmsCampaignStatusAsync (long? campaignId, UpdateCampaignStatus status); - - /// - /// Update a campaign's status - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Status of the campaign. - /// Task of ApiResponse - System.Threading.Tasks.Task> UpdateSmsCampaignStatusAsyncWithHttpInfo (long? campaignId, UpdateCampaignStatus status); - #endregion Asynchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public partial class SMSCampaignsApi : ISMSCampaignsApi - { - private sib_api_v3_sdk.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// - /// - public SMSCampaignsApi(String basePath) - { - this.Configuration = new sib_api_v3_sdk.Client.Configuration { BasePath = basePath }; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using Configuration object - /// - /// An instance of Configuration - /// - public SMSCampaignsApi(sib_api_v3_sdk.Client.Configuration configuration = null) - { - if (configuration == null) // use the default one in Configuration - this.Configuration = sib_api_v3_sdk.Client.Configuration.Default; - else - this.Configuration = configuration; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] - public void SetBasePath(String basePath) - { - // do nothing - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public sib_api_v3_sdk.Client.Configuration Configuration {get; set;} - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public sib_api_v3_sdk.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - /// - /// Gets the default header. - /// - /// Dictionary of HTTP header - [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] - public IDictionary DefaultHeader() - { - return new ReadOnlyDictionary(this.Configuration.DefaultHeader); - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] - public void AddDefaultHeader(string key, string value) - { - this.Configuration.AddDefaultHeader(key, value); - } - - /// - /// Creates an SMS campaign - /// - /// Thrown when fails to make API call - /// Values to create an SMS Campaign - /// CreateModel - public CreateModel CreateSmsCampaign (CreateSmsCampaign createSmsCampaign) - { - ApiResponse localVarResponse = CreateSmsCampaignWithHttpInfo(createSmsCampaign); - return localVarResponse.Data; - } - - /// - /// Creates an SMS campaign - /// - /// Thrown when fails to make API call - /// Values to create an SMS Campaign - /// ApiResponse of CreateModel - public ApiResponse< CreateModel > CreateSmsCampaignWithHttpInfo (CreateSmsCampaign createSmsCampaign) - { - // verify the required parameter 'createSmsCampaign' is set - if (createSmsCampaign == null) - throw new ApiException(400, "Missing required parameter 'createSmsCampaign' when calling SMSCampaignsApi->CreateSmsCampaign"); - - var localVarPath = "./smsCampaigns"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (createSmsCampaign != null && createSmsCampaign.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(createSmsCampaign); // http body (model) parameter - } - else - { - localVarPostBody = createSmsCampaign; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateSmsCampaign", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateModel))); - } - - /// - /// Creates an SMS campaign - /// - /// Thrown when fails to make API call - /// Values to create an SMS Campaign - /// Task of CreateModel - public async System.Threading.Tasks.Task CreateSmsCampaignAsync (CreateSmsCampaign createSmsCampaign) - { - ApiResponse localVarResponse = await CreateSmsCampaignAsyncWithHttpInfo(createSmsCampaign); - return localVarResponse.Data; - - } - - /// - /// Creates an SMS campaign - /// - /// Thrown when fails to make API call - /// Values to create an SMS Campaign - /// Task of ApiResponse (CreateModel) - public async System.Threading.Tasks.Task> CreateSmsCampaignAsyncWithHttpInfo (CreateSmsCampaign createSmsCampaign) - { - // verify the required parameter 'createSmsCampaign' is set - if (createSmsCampaign == null) - throw new ApiException(400, "Missing required parameter 'createSmsCampaign' when calling SMSCampaignsApi->CreateSmsCampaign"); - - var localVarPath = "./smsCampaigns"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (createSmsCampaign != null && createSmsCampaign.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(createSmsCampaign); // http body (model) parameter - } - else - { - localVarPostBody = createSmsCampaign; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateSmsCampaign", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateModel))); - } - - /// - /// Delete an SMS campaign - /// - /// Thrown when fails to make API call - /// id of the SMS campaign - /// - public void DeleteSmsCampaign (long? campaignId) - { - DeleteSmsCampaignWithHttpInfo(campaignId); - } - - /// - /// Delete an SMS campaign - /// - /// Thrown when fails to make API call - /// id of the SMS campaign - /// ApiResponse of Object(void) - public ApiResponse DeleteSmsCampaignWithHttpInfo (long? campaignId) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling SMSCampaignsApi->DeleteSmsCampaign"); - - var localVarPath = "./smsCampaigns/{campaignId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteSmsCampaign", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete an SMS campaign - /// - /// Thrown when fails to make API call - /// id of the SMS campaign - /// Task of void - public async System.Threading.Tasks.Task DeleteSmsCampaignAsync (long? campaignId) - { - await DeleteSmsCampaignAsyncWithHttpInfo(campaignId); - - } - - /// - /// Delete an SMS campaign - /// - /// Thrown when fails to make API call - /// id of the SMS campaign - /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeleteSmsCampaignAsyncWithHttpInfo (long? campaignId) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling SMSCampaignsApi->DeleteSmsCampaign"); - - var localVarPath = "./smsCampaigns/{campaignId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteSmsCampaign", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Get an SMS campaign - /// - /// Thrown when fails to make API call - /// id of the SMS campaign - /// GetSmsCampaign - public GetSmsCampaign GetSmsCampaign (long? campaignId) - { - ApiResponse localVarResponse = GetSmsCampaignWithHttpInfo(campaignId); - return localVarResponse.Data; - } - - /// - /// Get an SMS campaign - /// - /// Thrown when fails to make API call - /// id of the SMS campaign - /// ApiResponse of GetSmsCampaign - public ApiResponse< GetSmsCampaign > GetSmsCampaignWithHttpInfo (long? campaignId) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling SMSCampaignsApi->GetSmsCampaign"); - - var localVarPath = "./smsCampaigns/{campaignId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetSmsCampaign", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetSmsCampaign) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSmsCampaign))); - } - - /// - /// Get an SMS campaign - /// - /// Thrown when fails to make API call - /// id of the SMS campaign - /// Task of GetSmsCampaign - public async System.Threading.Tasks.Task GetSmsCampaignAsync (long? campaignId) - { - ApiResponse localVarResponse = await GetSmsCampaignAsyncWithHttpInfo(campaignId); - return localVarResponse.Data; - - } - - /// - /// Get an SMS campaign - /// - /// Thrown when fails to make API call - /// id of the SMS campaign - /// Task of ApiResponse (GetSmsCampaign) - public async System.Threading.Tasks.Task> GetSmsCampaignAsyncWithHttpInfo (long? campaignId) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling SMSCampaignsApi->GetSmsCampaign"); - - var localVarPath = "./smsCampaigns/{campaignId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetSmsCampaign", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetSmsCampaign) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSmsCampaign))); - } - - /// - /// Returns the information for all your created SMS campaigns - /// - /// Thrown when fails to make API call - /// Status of campaign. (optional) - /// Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Number limitation for the result returned (optional, default to 500) - /// Beginning point in the list to retrieve from. (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// GetSmsCampaigns - public GetSmsCampaigns GetSmsCampaigns (string status = null, string startDate = null, string endDate = null, long? limit = null, long? offset = null, string sort = null) - { - ApiResponse localVarResponse = GetSmsCampaignsWithHttpInfo(status, startDate, endDate, limit, offset, sort); - return localVarResponse.Data; - } - - /// - /// Returns the information for all your created SMS campaigns - /// - /// Thrown when fails to make API call - /// Status of campaign. (optional) - /// Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Number limitation for the result returned (optional, default to 500) - /// Beginning point in the list to retrieve from. (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// ApiResponse of GetSmsCampaigns - public ApiResponse< GetSmsCampaigns > GetSmsCampaignsWithHttpInfo (string status = null, string startDate = null, string endDate = null, long? limit = null, long? offset = null, string sort = null) - { - - var localVarPath = "./smsCampaigns"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (status != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "status", status)); // query parameter - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetSmsCampaigns", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetSmsCampaigns) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSmsCampaigns))); - } - - /// - /// Returns the information for all your created SMS campaigns - /// - /// Thrown when fails to make API call - /// Status of campaign. (optional) - /// Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Number limitation for the result returned (optional, default to 500) - /// Beginning point in the list to retrieve from. (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of GetSmsCampaigns - public async System.Threading.Tasks.Task GetSmsCampaignsAsync (string status = null, string startDate = null, string endDate = null, long? limit = null, long? offset = null, string sort = null) - { - ApiResponse localVarResponse = await GetSmsCampaignsAsyncWithHttpInfo(status, startDate, endDate, limit, offset, sort); - return localVarResponse.Data; - - } - - /// - /// Returns the information for all your created SMS campaigns - /// - /// Thrown when fails to make API call - /// Status of campaign. (optional) - /// Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - /// Number limitation for the result returned (optional, default to 500) - /// Beginning point in the list to retrieve from. (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of ApiResponse (GetSmsCampaigns) - public async System.Threading.Tasks.Task> GetSmsCampaignsAsyncWithHttpInfo (string status = null, string startDate = null, string endDate = null, long? limit = null, long? offset = null, string sort = null) - { - - var localVarPath = "./smsCampaigns"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (status != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "status", status)); // query parameter - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetSmsCampaigns", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetSmsCampaigns) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSmsCampaigns))); - } - - /// - /// Export an SMS campaign's recipients It returns the background process ID which on completion calls the notify URL that you have set in the input. - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Values to send for a recipient export request (optional) - /// CreatedProcessId - public CreatedProcessId RequestSmsRecipientExport (long? campaignId, RequestSmsRecipientExport recipientExport = null) - { - ApiResponse localVarResponse = RequestSmsRecipientExportWithHttpInfo(campaignId, recipientExport); - return localVarResponse.Data; - } - - /// - /// Export an SMS campaign's recipients It returns the background process ID which on completion calls the notify URL that you have set in the input. - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Values to send for a recipient export request (optional) - /// ApiResponse of CreatedProcessId - public ApiResponse< CreatedProcessId > RequestSmsRecipientExportWithHttpInfo (long? campaignId, RequestSmsRecipientExport recipientExport = null) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling SMSCampaignsApi->RequestSmsRecipientExport"); - - var localVarPath = "./smsCampaigns/{campaignId}/exportRecipients"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - if (recipientExport != null && recipientExport.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(recipientExport); // http body (model) parameter - } - else - { - localVarPostBody = recipientExport; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("RequestSmsRecipientExport", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreatedProcessId) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreatedProcessId))); - } - - /// - /// Export an SMS campaign's recipients It returns the background process ID which on completion calls the notify URL that you have set in the input. - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Values to send for a recipient export request (optional) - /// Task of CreatedProcessId - public async System.Threading.Tasks.Task RequestSmsRecipientExportAsync (long? campaignId, RequestSmsRecipientExport recipientExport = null) - { - ApiResponse localVarResponse = await RequestSmsRecipientExportAsyncWithHttpInfo(campaignId, recipientExport); - return localVarResponse.Data; - - } - - /// - /// Export an SMS campaign's recipients It returns the background process ID which on completion calls the notify URL that you have set in the input. - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Values to send for a recipient export request (optional) - /// Task of ApiResponse (CreatedProcessId) - public async System.Threading.Tasks.Task> RequestSmsRecipientExportAsyncWithHttpInfo (long? campaignId, RequestSmsRecipientExport recipientExport = null) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling SMSCampaignsApi->RequestSmsRecipientExport"); - - var localVarPath = "./smsCampaigns/{campaignId}/exportRecipients"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - if (recipientExport != null && recipientExport.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(recipientExport); // http body (model) parameter - } - else - { - localVarPostBody = recipientExport; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("RequestSmsRecipientExport", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreatedProcessId) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreatedProcessId))); - } - - /// - /// Send your SMS campaign immediately - /// - /// Thrown when fails to make API call - /// id of the campaign - /// - public void SendSmsCampaignNow (long? campaignId) - { - SendSmsCampaignNowWithHttpInfo(campaignId); - } - - /// - /// Send your SMS campaign immediately - /// - /// Thrown when fails to make API call - /// id of the campaign - /// ApiResponse of Object(void) - public ApiResponse SendSmsCampaignNowWithHttpInfo (long? campaignId) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling SMSCampaignsApi->SendSmsCampaignNow"); - - var localVarPath = "./smsCampaigns/{campaignId}/sendNow"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("SendSmsCampaignNow", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Send your SMS campaign immediately - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Task of void - public async System.Threading.Tasks.Task SendSmsCampaignNowAsync (long? campaignId) - { - await SendSmsCampaignNowAsyncWithHttpInfo(campaignId); - - } - - /// - /// Send your SMS campaign immediately - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Task of ApiResponse - public async System.Threading.Tasks.Task> SendSmsCampaignNowAsyncWithHttpInfo (long? campaignId) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling SMSCampaignsApi->SendSmsCampaignNow"); - - var localVarPath = "./smsCampaigns/{campaignId}/sendNow"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("SendSmsCampaignNow", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Send an SMS campaign's report Send report of Sent and Archived campaign, to the specified email addresses, with respective data and a pdf attachment in detail. - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Values for send a report - /// - public void SendSmsReport (long? campaignId, SendReport sendReport) - { - SendSmsReportWithHttpInfo(campaignId, sendReport); - } - - /// - /// Send an SMS campaign's report Send report of Sent and Archived campaign, to the specified email addresses, with respective data and a pdf attachment in detail. - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Values for send a report - /// ApiResponse of Object(void) - public ApiResponse SendSmsReportWithHttpInfo (long? campaignId, SendReport sendReport) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling SMSCampaignsApi->SendSmsReport"); - // verify the required parameter 'sendReport' is set - if (sendReport == null) - throw new ApiException(400, "Missing required parameter 'sendReport' when calling SMSCampaignsApi->SendSmsReport"); - - var localVarPath = "./smsCampaigns/{campaignId}/sendReport"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - if (sendReport != null && sendReport.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(sendReport); // http body (model) parameter - } - else - { - localVarPostBody = sendReport; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("SendSmsReport", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Send an SMS campaign's report Send report of Sent and Archived campaign, to the specified email addresses, with respective data and a pdf attachment in detail. - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Values for send a report - /// Task of void - public async System.Threading.Tasks.Task SendSmsReportAsync (long? campaignId, SendReport sendReport) - { - await SendSmsReportAsyncWithHttpInfo(campaignId, sendReport); - - } - - /// - /// Send an SMS campaign's report Send report of Sent and Archived campaign, to the specified email addresses, with respective data and a pdf attachment in detail. - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Values for send a report - /// Task of ApiResponse - public async System.Threading.Tasks.Task> SendSmsReportAsyncWithHttpInfo (long? campaignId, SendReport sendReport) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling SMSCampaignsApi->SendSmsReport"); - // verify the required parameter 'sendReport' is set - if (sendReport == null) - throw new ApiException(400, "Missing required parameter 'sendReport' when calling SMSCampaignsApi->SendSmsReport"); - - var localVarPath = "./smsCampaigns/{campaignId}/sendReport"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - if (sendReport != null && sendReport.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(sendReport); // http body (model) parameter - } - else - { - localVarPostBody = sendReport; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("SendSmsReport", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Send a test SMS campaign - /// - /// Thrown when fails to make API call - /// Id of the SMS campaign - /// Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted - /// - public void SendTestSms (long? campaignId, SendTestSms phoneNumber) - { - SendTestSmsWithHttpInfo(campaignId, phoneNumber); - } - - /// - /// Send a test SMS campaign - /// - /// Thrown when fails to make API call - /// Id of the SMS campaign - /// Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted - /// ApiResponse of Object(void) - public ApiResponse SendTestSmsWithHttpInfo (long? campaignId, SendTestSms phoneNumber) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling SMSCampaignsApi->SendTestSms"); - // verify the required parameter 'phoneNumber' is set - if (phoneNumber == null) - throw new ApiException(400, "Missing required parameter 'phoneNumber' when calling SMSCampaignsApi->SendTestSms"); - - var localVarPath = "./smsCampaigns/{campaignId}/sendTest"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - if (phoneNumber != null && phoneNumber.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(phoneNumber); // http body (model) parameter - } - else - { - localVarPostBody = phoneNumber; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("SendTestSms", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Send a test SMS campaign - /// - /// Thrown when fails to make API call - /// Id of the SMS campaign - /// Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted - /// Task of void - public async System.Threading.Tasks.Task SendTestSmsAsync (long? campaignId, SendTestSms phoneNumber) - { - await SendTestSmsAsyncWithHttpInfo(campaignId, phoneNumber); - - } - - /// - /// Send a test SMS campaign - /// - /// Thrown when fails to make API call - /// Id of the SMS campaign - /// Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted - /// Task of ApiResponse - public async System.Threading.Tasks.Task> SendTestSmsAsyncWithHttpInfo (long? campaignId, SendTestSms phoneNumber) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling SMSCampaignsApi->SendTestSms"); - // verify the required parameter 'phoneNumber' is set - if (phoneNumber == null) - throw new ApiException(400, "Missing required parameter 'phoneNumber' when calling SMSCampaignsApi->SendTestSms"); - - var localVarPath = "./smsCampaigns/{campaignId}/sendTest"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - if (phoneNumber != null && phoneNumber.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(phoneNumber); // http body (model) parameter - } - else - { - localVarPostBody = phoneNumber; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("SendTestSms", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Update an SMS campaign - /// - /// Thrown when fails to make API call - /// id of the SMS campaign - /// Values to update an SMS Campaign - /// - public void UpdateSmsCampaign (long? campaignId, UpdateSmsCampaign updateSmsCampaign) - { - UpdateSmsCampaignWithHttpInfo(campaignId, updateSmsCampaign); - } - - /// - /// Update an SMS campaign - /// - /// Thrown when fails to make API call - /// id of the SMS campaign - /// Values to update an SMS Campaign - /// ApiResponse of Object(void) - public ApiResponse UpdateSmsCampaignWithHttpInfo (long? campaignId, UpdateSmsCampaign updateSmsCampaign) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling SMSCampaignsApi->UpdateSmsCampaign"); - // verify the required parameter 'updateSmsCampaign' is set - if (updateSmsCampaign == null) - throw new ApiException(400, "Missing required parameter 'updateSmsCampaign' when calling SMSCampaignsApi->UpdateSmsCampaign"); - - var localVarPath = "./smsCampaigns/{campaignId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - if (updateSmsCampaign != null && updateSmsCampaign.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(updateSmsCampaign); // http body (model) parameter - } - else - { - localVarPostBody = updateSmsCampaign; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UpdateSmsCampaign", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Update an SMS campaign - /// - /// Thrown when fails to make API call - /// id of the SMS campaign - /// Values to update an SMS Campaign - /// Task of void - public async System.Threading.Tasks.Task UpdateSmsCampaignAsync (long? campaignId, UpdateSmsCampaign updateSmsCampaign) - { - await UpdateSmsCampaignAsyncWithHttpInfo(campaignId, updateSmsCampaign); - - } - - /// - /// Update an SMS campaign - /// - /// Thrown when fails to make API call - /// id of the SMS campaign - /// Values to update an SMS Campaign - /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdateSmsCampaignAsyncWithHttpInfo (long? campaignId, UpdateSmsCampaign updateSmsCampaign) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling SMSCampaignsApi->UpdateSmsCampaign"); - // verify the required parameter 'updateSmsCampaign' is set - if (updateSmsCampaign == null) - throw new ApiException(400, "Missing required parameter 'updateSmsCampaign' when calling SMSCampaignsApi->UpdateSmsCampaign"); - - var localVarPath = "./smsCampaigns/{campaignId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - if (updateSmsCampaign != null && updateSmsCampaign.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(updateSmsCampaign); // http body (model) parameter - } - else - { - localVarPostBody = updateSmsCampaign; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UpdateSmsCampaign", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Update a campaign's status - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Status of the campaign. - /// - public void UpdateSmsCampaignStatus (long? campaignId, UpdateCampaignStatus status) - { - UpdateSmsCampaignStatusWithHttpInfo(campaignId, status); - } - - /// - /// Update a campaign's status - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Status of the campaign. - /// ApiResponse of Object(void) - public ApiResponse UpdateSmsCampaignStatusWithHttpInfo (long? campaignId, UpdateCampaignStatus status) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling SMSCampaignsApi->UpdateSmsCampaignStatus"); - // verify the required parameter 'status' is set - if (status == null) - throw new ApiException(400, "Missing required parameter 'status' when calling SMSCampaignsApi->UpdateSmsCampaignStatus"); - - var localVarPath = "./smsCampaigns/{campaignId}/status"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - if (status != null && status.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(status); // http body (model) parameter - } - else - { - localVarPostBody = status; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UpdateSmsCampaignStatus", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Update a campaign's status - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Status of the campaign. - /// Task of void - public async System.Threading.Tasks.Task UpdateSmsCampaignStatusAsync (long? campaignId, UpdateCampaignStatus status) - { - await UpdateSmsCampaignStatusAsyncWithHttpInfo(campaignId, status); - - } - - /// - /// Update a campaign's status - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Status of the campaign. - /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdateSmsCampaignStatusAsyncWithHttpInfo (long? campaignId, UpdateCampaignStatus status) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling SMSCampaignsApi->UpdateSmsCampaignStatus"); - // verify the required parameter 'status' is set - if (status == null) - throw new ApiException(400, "Missing required parameter 'status' when calling SMSCampaignsApi->UpdateSmsCampaignStatus"); - - var localVarPath = "./smsCampaigns/{campaignId}/status"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - if (status != null && status.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(status); // http body (model) parameter - } - else - { - localVarPostBody = status; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UpdateSmsCampaignStatus", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - } -} diff --git a/src/sib_api_v3_sdk/Api/SendersApi.cs b/src/sib_api_v3_sdk/Api/SendersApi.cs deleted file mode 100644 index 70479e9..0000000 --- a/src/sib_api_v3_sdk/Api/SendersApi.cs +++ /dev/null @@ -1,1328 +0,0 @@ -/* - * SendinBlue API - * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :- -- -- -- -- -- --: | - -- -- -- -- -- -- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | - * - * OpenAPI spec version: 3.0.0 - * Contact: contact@sendinblue.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using RestSharp.Portable; -using sib_api_v3_sdk.Client; -using sib_api_v3_sdk.Model; - -namespace sib_api_v3_sdk.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface ISendersApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Create a new sender - /// - /// - /// - /// - /// Thrown when fails to make API call - /// sender's name (optional) - /// CreateSenderModel - CreateSenderModel CreateSender (CreateSender sender = null); - - /// - /// Create a new sender - /// - /// - /// - /// - /// Thrown when fails to make API call - /// sender's name (optional) - /// ApiResponse of CreateSenderModel - ApiResponse CreateSenderWithHttpInfo (CreateSender sender = null); - /// - /// Delete a sender - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the sender - /// - void DeleteSender (long? senderId); - - /// - /// Delete a sender - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the sender - /// ApiResponse of Object(void) - ApiResponse DeleteSenderWithHttpInfo (long? senderId); - /// - /// Get all the dedicated IPs for your account - /// - /// - /// - /// - /// Thrown when fails to make API call - /// GetIps - GetIps GetIps (); - - /// - /// Get all the dedicated IPs for your account - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ApiResponse of GetIps - ApiResponse GetIpsWithHttpInfo (); - /// - /// Get all the dedicated IPs for a sender - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the sender - /// GetIpsFromSender - GetIpsFromSender GetIpsFromSender (long? senderId); - - /// - /// Get all the dedicated IPs for a sender - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the sender - /// ApiResponse of GetIpsFromSender - ApiResponse GetIpsFromSenderWithHttpInfo (long? senderId); - /// - /// Get the list of all your senders - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter your senders for a specific ip (available for dedicated IP usage only) (optional) - /// Filter your senders for a specific domain (optional) - /// GetSendersList - GetSendersList GetSenders (string ip = null, string domain = null); - - /// - /// Get the list of all your senders - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter your senders for a specific ip (available for dedicated IP usage only) (optional) - /// Filter your senders for a specific domain (optional) - /// ApiResponse of GetSendersList - ApiResponse GetSendersWithHttpInfo (string ip = null, string domain = null); - /// - /// Update a sender - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the sender - /// sender's name (optional) - /// - void UpdateSender (long? senderId, UpdateSender sender = null); - - /// - /// Update a sender - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the sender - /// sender's name (optional) - /// ApiResponse of Object(void) - ApiResponse UpdateSenderWithHttpInfo (long? senderId, UpdateSender sender = null); - #endregion Synchronous Operations - #region Asynchronous Operations - /// - /// Create a new sender - /// - /// - /// - /// - /// Thrown when fails to make API call - /// sender's name (optional) - /// Task of CreateSenderModel - System.Threading.Tasks.Task CreateSenderAsync (CreateSender sender = null); - - /// - /// Create a new sender - /// - /// - /// - /// - /// Thrown when fails to make API call - /// sender's name (optional) - /// Task of ApiResponse (CreateSenderModel) - System.Threading.Tasks.Task> CreateSenderAsyncWithHttpInfo (CreateSender sender = null); - /// - /// Delete a sender - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the sender - /// Task of void - System.Threading.Tasks.Task DeleteSenderAsync (long? senderId); - - /// - /// Delete a sender - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the sender - /// Task of ApiResponse - System.Threading.Tasks.Task> DeleteSenderAsyncWithHttpInfo (long? senderId); - /// - /// Get all the dedicated IPs for your account - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Task of GetIps - System.Threading.Tasks.Task GetIpsAsync (); - - /// - /// Get all the dedicated IPs for your account - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Task of ApiResponse (GetIps) - System.Threading.Tasks.Task> GetIpsAsyncWithHttpInfo (); - /// - /// Get all the dedicated IPs for a sender - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the sender - /// Task of GetIpsFromSender - System.Threading.Tasks.Task GetIpsFromSenderAsync (long? senderId); - - /// - /// Get all the dedicated IPs for a sender - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the sender - /// Task of ApiResponse (GetIpsFromSender) - System.Threading.Tasks.Task> GetIpsFromSenderAsyncWithHttpInfo (long? senderId); - /// - /// Get the list of all your senders - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter your senders for a specific ip (available for dedicated IP usage only) (optional) - /// Filter your senders for a specific domain (optional) - /// Task of GetSendersList - System.Threading.Tasks.Task GetSendersAsync (string ip = null, string domain = null); - - /// - /// Get the list of all your senders - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter your senders for a specific ip (available for dedicated IP usage only) (optional) - /// Filter your senders for a specific domain (optional) - /// Task of ApiResponse (GetSendersList) - System.Threading.Tasks.Task> GetSendersAsyncWithHttpInfo (string ip = null, string domain = null); - /// - /// Update a sender - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the sender - /// sender's name (optional) - /// Task of void - System.Threading.Tasks.Task UpdateSenderAsync (long? senderId, UpdateSender sender = null); - - /// - /// Update a sender - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the sender - /// sender's name (optional) - /// Task of ApiResponse - System.Threading.Tasks.Task> UpdateSenderAsyncWithHttpInfo (long? senderId, UpdateSender sender = null); - #endregion Asynchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public partial class SendersApi : ISendersApi - { - private sib_api_v3_sdk.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// - /// - public SendersApi(String basePath) - { - this.Configuration = new sib_api_v3_sdk.Client.Configuration { BasePath = basePath }; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using Configuration object - /// - /// An instance of Configuration - /// - public SendersApi(sib_api_v3_sdk.Client.Configuration configuration = null) - { - if (configuration == null) // use the default one in Configuration - this.Configuration = sib_api_v3_sdk.Client.Configuration.Default; - else - this.Configuration = configuration; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] - public void SetBasePath(String basePath) - { - // do nothing - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public sib_api_v3_sdk.Client.Configuration Configuration {get; set;} - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public sib_api_v3_sdk.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - /// - /// Gets the default header. - /// - /// Dictionary of HTTP header - [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] - public IDictionary DefaultHeader() - { - return new ReadOnlyDictionary(this.Configuration.DefaultHeader); - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] - public void AddDefaultHeader(string key, string value) - { - this.Configuration.AddDefaultHeader(key, value); - } - - /// - /// Create a new sender - /// - /// Thrown when fails to make API call - /// sender's name (optional) - /// CreateSenderModel - public CreateSenderModel CreateSender (CreateSender sender = null) - { - ApiResponse localVarResponse = CreateSenderWithHttpInfo(sender); - return localVarResponse.Data; - } - - /// - /// Create a new sender - /// - /// Thrown when fails to make API call - /// sender's name (optional) - /// ApiResponse of CreateSenderModel - public ApiResponse< CreateSenderModel > CreateSenderWithHttpInfo (CreateSender sender = null) - { - - var localVarPath = "./senders"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (sender != null && sender.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(sender); // http body (model) parameter - } - else - { - localVarPostBody = sender; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateSender", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateSenderModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateSenderModel))); - } - - /// - /// Create a new sender - /// - /// Thrown when fails to make API call - /// sender's name (optional) - /// Task of CreateSenderModel - public async System.Threading.Tasks.Task CreateSenderAsync (CreateSender sender = null) - { - ApiResponse localVarResponse = await CreateSenderAsyncWithHttpInfo(sender); - return localVarResponse.Data; - - } - - /// - /// Create a new sender - /// - /// Thrown when fails to make API call - /// sender's name (optional) - /// Task of ApiResponse (CreateSenderModel) - public async System.Threading.Tasks.Task> CreateSenderAsyncWithHttpInfo (CreateSender sender = null) - { - - var localVarPath = "./senders"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (sender != null && sender.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(sender); // http body (model) parameter - } - else - { - localVarPostBody = sender; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateSender", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateSenderModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateSenderModel))); - } - - /// - /// Delete a sender - /// - /// Thrown when fails to make API call - /// Id of the sender - /// - public void DeleteSender (long? senderId) - { - DeleteSenderWithHttpInfo(senderId); - } - - /// - /// Delete a sender - /// - /// Thrown when fails to make API call - /// Id of the sender - /// ApiResponse of Object(void) - public ApiResponse DeleteSenderWithHttpInfo (long? senderId) - { - // verify the required parameter 'senderId' is set - if (senderId == null) - throw new ApiException(400, "Missing required parameter 'senderId' when calling SendersApi->DeleteSender"); - - var localVarPath = "./senders/{senderId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (senderId != null) localVarPathParams.Add("senderId", this.Configuration.ApiClient.ParameterToString(senderId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteSender", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete a sender - /// - /// Thrown when fails to make API call - /// Id of the sender - /// Task of void - public async System.Threading.Tasks.Task DeleteSenderAsync (long? senderId) - { - await DeleteSenderAsyncWithHttpInfo(senderId); - - } - - /// - /// Delete a sender - /// - /// Thrown when fails to make API call - /// Id of the sender - /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeleteSenderAsyncWithHttpInfo (long? senderId) - { - // verify the required parameter 'senderId' is set - if (senderId == null) - throw new ApiException(400, "Missing required parameter 'senderId' when calling SendersApi->DeleteSender"); - - var localVarPath = "./senders/{senderId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (senderId != null) localVarPathParams.Add("senderId", this.Configuration.ApiClient.ParameterToString(senderId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteSender", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Get all the dedicated IPs for your account - /// - /// Thrown when fails to make API call - /// GetIps - public GetIps GetIps () - { - ApiResponse localVarResponse = GetIpsWithHttpInfo(); - return localVarResponse.Data; - } - - /// - /// Get all the dedicated IPs for your account - /// - /// Thrown when fails to make API call - /// ApiResponse of GetIps - public ApiResponse< GetIps > GetIpsWithHttpInfo () - { - - var localVarPath = "./senders/ips"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetIps", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetIps) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetIps))); - } - - /// - /// Get all the dedicated IPs for your account - /// - /// Thrown when fails to make API call - /// Task of GetIps - public async System.Threading.Tasks.Task GetIpsAsync () - { - ApiResponse localVarResponse = await GetIpsAsyncWithHttpInfo(); - return localVarResponse.Data; - - } - - /// - /// Get all the dedicated IPs for your account - /// - /// Thrown when fails to make API call - /// Task of ApiResponse (GetIps) - public async System.Threading.Tasks.Task> GetIpsAsyncWithHttpInfo () - { - - var localVarPath = "./senders/ips"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetIps", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetIps) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetIps))); - } - - /// - /// Get all the dedicated IPs for a sender - /// - /// Thrown when fails to make API call - /// Id of the sender - /// GetIpsFromSender - public GetIpsFromSender GetIpsFromSender (long? senderId) - { - ApiResponse localVarResponse = GetIpsFromSenderWithHttpInfo(senderId); - return localVarResponse.Data; - } - - /// - /// Get all the dedicated IPs for a sender - /// - /// Thrown when fails to make API call - /// Id of the sender - /// ApiResponse of GetIpsFromSender - public ApiResponse< GetIpsFromSender > GetIpsFromSenderWithHttpInfo (long? senderId) - { - // verify the required parameter 'senderId' is set - if (senderId == null) - throw new ApiException(400, "Missing required parameter 'senderId' when calling SendersApi->GetIpsFromSender"); - - var localVarPath = "./senders/{senderId}/ips"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (senderId != null) localVarPathParams.Add("senderId", this.Configuration.ApiClient.ParameterToString(senderId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetIpsFromSender", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetIpsFromSender) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetIpsFromSender))); - } - - /// - /// Get all the dedicated IPs for a sender - /// - /// Thrown when fails to make API call - /// Id of the sender - /// Task of GetIpsFromSender - public async System.Threading.Tasks.Task GetIpsFromSenderAsync (long? senderId) - { - ApiResponse localVarResponse = await GetIpsFromSenderAsyncWithHttpInfo(senderId); - return localVarResponse.Data; - - } - - /// - /// Get all the dedicated IPs for a sender - /// - /// Thrown when fails to make API call - /// Id of the sender - /// Task of ApiResponse (GetIpsFromSender) - public async System.Threading.Tasks.Task> GetIpsFromSenderAsyncWithHttpInfo (long? senderId) - { - // verify the required parameter 'senderId' is set - if (senderId == null) - throw new ApiException(400, "Missing required parameter 'senderId' when calling SendersApi->GetIpsFromSender"); - - var localVarPath = "./senders/{senderId}/ips"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (senderId != null) localVarPathParams.Add("senderId", this.Configuration.ApiClient.ParameterToString(senderId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetIpsFromSender", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetIpsFromSender) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetIpsFromSender))); - } - - /// - /// Get the list of all your senders - /// - /// Thrown when fails to make API call - /// Filter your senders for a specific ip (available for dedicated IP usage only) (optional) - /// Filter your senders for a specific domain (optional) - /// GetSendersList - public GetSendersList GetSenders (string ip = null, string domain = null) - { - ApiResponse localVarResponse = GetSendersWithHttpInfo(ip, domain); - return localVarResponse.Data; - } - - /// - /// Get the list of all your senders - /// - /// Thrown when fails to make API call - /// Filter your senders for a specific ip (available for dedicated IP usage only) (optional) - /// Filter your senders for a specific domain (optional) - /// ApiResponse of GetSendersList - public ApiResponse< GetSendersList > GetSendersWithHttpInfo (string ip = null, string domain = null) - { - - var localVarPath = "./senders"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (ip != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "ip", ip)); // query parameter - if (domain != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "domain", domain)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetSenders", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetSendersList) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSendersList))); - } - - /// - /// Get the list of all your senders - /// - /// Thrown when fails to make API call - /// Filter your senders for a specific ip (available for dedicated IP usage only) (optional) - /// Filter your senders for a specific domain (optional) - /// Task of GetSendersList - public async System.Threading.Tasks.Task GetSendersAsync (string ip = null, string domain = null) - { - ApiResponse localVarResponse = await GetSendersAsyncWithHttpInfo(ip, domain); - return localVarResponse.Data; - - } - - /// - /// Get the list of all your senders - /// - /// Thrown when fails to make API call - /// Filter your senders for a specific ip (available for dedicated IP usage only) (optional) - /// Filter your senders for a specific domain (optional) - /// Task of ApiResponse (GetSendersList) - public async System.Threading.Tasks.Task> GetSendersAsyncWithHttpInfo (string ip = null, string domain = null) - { - - var localVarPath = "./senders"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (ip != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "ip", ip)); // query parameter - if (domain != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "domain", domain)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetSenders", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetSendersList) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSendersList))); - } - - /// - /// Update a sender - /// - /// Thrown when fails to make API call - /// Id of the sender - /// sender's name (optional) - /// - public void UpdateSender (long? senderId, UpdateSender sender = null) - { - UpdateSenderWithHttpInfo(senderId, sender); - } - - /// - /// Update a sender - /// - /// Thrown when fails to make API call - /// Id of the sender - /// sender's name (optional) - /// ApiResponse of Object(void) - public ApiResponse UpdateSenderWithHttpInfo (long? senderId, UpdateSender sender = null) - { - // verify the required parameter 'senderId' is set - if (senderId == null) - throw new ApiException(400, "Missing required parameter 'senderId' when calling SendersApi->UpdateSender"); - - var localVarPath = "./senders/{senderId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (senderId != null) localVarPathParams.Add("senderId", this.Configuration.ApiClient.ParameterToString(senderId)); // path parameter - if (sender != null && sender.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(sender); // http body (model) parameter - } - else - { - localVarPostBody = sender; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UpdateSender", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Update a sender - /// - /// Thrown when fails to make API call - /// Id of the sender - /// sender's name (optional) - /// Task of void - public async System.Threading.Tasks.Task UpdateSenderAsync (long? senderId, UpdateSender sender = null) - { - await UpdateSenderAsyncWithHttpInfo(senderId, sender); - - } - - /// - /// Update a sender - /// - /// Thrown when fails to make API call - /// Id of the sender - /// sender's name (optional) - /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdateSenderAsyncWithHttpInfo (long? senderId, UpdateSender sender = null) - { - // verify the required parameter 'senderId' is set - if (senderId == null) - throw new ApiException(400, "Missing required parameter 'senderId' when calling SendersApi->UpdateSender"); - - var localVarPath = "./senders/{senderId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (senderId != null) localVarPathParams.Add("senderId", this.Configuration.ApiClient.ParameterToString(senderId)); // path parameter - if (sender != null && sender.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(sender); // http body (model) parameter - } - else - { - localVarPostBody = sender; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UpdateSender", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - } -} diff --git a/src/sib_api_v3_sdk/Api/TasksApi.cs b/src/sib_api_v3_sdk/Api/TasksApi.cs deleted file mode 100644 index e3d6fb4..0000000 --- a/src/sib_api_v3_sdk/Api/TasksApi.cs +++ /dev/null @@ -1,1450 +0,0 @@ -/* - * SendinBlue API - * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :- -- -- -- -- -- --: | - -- -- -- -- -- -- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | - * - * OpenAPI spec version: 3.0.0 - * Contact: contact@sendinblue.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using RestSharp.Portable; -using sib_api_v3_sdk.Client; -using sib_api_v3_sdk.Model; - -namespace sib_api_v3_sdk.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface ITasksApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Get all tasks - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter by task type (ID) (optional) - /// Filter by task status (optional) - /// Filter by date (optional) - /// Filter by assignTo id (optional) - /// Filter by contact ids (optional) - /// Filter by deals ids (optional) - /// Filter by companies ids (optional) - /// dateFrom to date range filter type (timestamp in milliseconds) (optional) - /// dateTo to date range filter type (timestamp in milliseconds) (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// The field used to sort field names. (optional) - /// TaskList - TaskList CrmTasksGet (string filterType = null, string filterStatus = null, string filterDate = null, string filterAssignTo = null, string filterContacts = null, string filterDeals = null, string filterCompanies = null, int? dateFrom = null, int? dateTo = null, long? offset = null, long? limit = null, string sort = null, string sortBy = null); - - /// - /// Get all tasks - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter by task type (ID) (optional) - /// Filter by task status (optional) - /// Filter by date (optional) - /// Filter by assignTo id (optional) - /// Filter by contact ids (optional) - /// Filter by deals ids (optional) - /// Filter by companies ids (optional) - /// dateFrom to date range filter type (timestamp in milliseconds) (optional) - /// dateTo to date range filter type (timestamp in milliseconds) (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// The field used to sort field names. (optional) - /// ApiResponse of TaskList - ApiResponse CrmTasksGetWithHttpInfo (string filterType = null, string filterStatus = null, string filterDate = null, string filterAssignTo = null, string filterContacts = null, string filterDeals = null, string filterCompanies = null, int? dateFrom = null, int? dateTo = null, long? offset = null, long? limit = null, string sort = null, string sortBy = null); - /// - /// Delete a task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - void CrmTasksIdDelete (string id); - - /// - /// Delete a task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object(void) - ApiResponse CrmTasksIdDeleteWithHttpInfo (string id); - /// - /// Get a task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Task - Task CrmTasksIdGet (string id); - - /// - /// Get a task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Task - ApiResponse CrmTasksIdGetWithHttpInfo (string id); - /// - /// Update a task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Updated task details. - /// - void CrmTasksIdPatch (string id, Body7 body); - - /// - /// Update a task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Updated task details. - /// ApiResponse of Object(void) - ApiResponse CrmTasksIdPatchWithHttpInfo (string id, Body7 body); - /// - /// Create a task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Task name. - /// InlineResponse2011 - InlineResponse2011 CrmTasksPost (Body6 body); - - /// - /// Create a task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Task name. - /// ApiResponse of InlineResponse2011 - ApiResponse CrmTasksPostWithHttpInfo (Body6 body); - /// - /// Get all task types - /// - /// - /// - /// - /// Thrown when fails to make API call - /// TaskTypes - TaskTypes CrmTasktypesGet (); - - /// - /// Get all task types - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ApiResponse of TaskTypes - ApiResponse CrmTasktypesGetWithHttpInfo (); - #endregion Synchronous Operations - #region Asynchronous Operations - /// - /// Get all tasks - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter by task type (ID) (optional) - /// Filter by task status (optional) - /// Filter by date (optional) - /// Filter by assignTo id (optional) - /// Filter by contact ids (optional) - /// Filter by deals ids (optional) - /// Filter by companies ids (optional) - /// dateFrom to date range filter type (timestamp in milliseconds) (optional) - /// dateTo to date range filter type (timestamp in milliseconds) (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// The field used to sort field names. (optional) - /// Task of TaskList - System.Threading.Tasks.Task CrmTasksGetAsync (string filterType = null, string filterStatus = null, string filterDate = null, string filterAssignTo = null, string filterContacts = null, string filterDeals = null, string filterCompanies = null, int? dateFrom = null, int? dateTo = null, long? offset = null, long? limit = null, string sort = null, string sortBy = null); - - /// - /// Get all tasks - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter by task type (ID) (optional) - /// Filter by task status (optional) - /// Filter by date (optional) - /// Filter by assignTo id (optional) - /// Filter by contact ids (optional) - /// Filter by deals ids (optional) - /// Filter by companies ids (optional) - /// dateFrom to date range filter type (timestamp in milliseconds) (optional) - /// dateTo to date range filter type (timestamp in milliseconds) (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// The field used to sort field names. (optional) - /// Task of ApiResponse (TaskList) - System.Threading.Tasks.Task> CrmTasksGetAsyncWithHttpInfo (string filterType = null, string filterStatus = null, string filterDate = null, string filterAssignTo = null, string filterContacts = null, string filterDeals = null, string filterCompanies = null, int? dateFrom = null, int? dateTo = null, long? offset = null, long? limit = null, string sort = null, string sortBy = null); - /// - /// Delete a task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Task of void - System.Threading.Tasks.Task CrmTasksIdDeleteAsync (string id); - - /// - /// Delete a task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Task of ApiResponse - System.Threading.Tasks.Task> CrmTasksIdDeleteAsyncWithHttpInfo (string id); - /// - /// Get a task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Task of Task - System.Threading.Tasks.Task CrmTasksIdGetAsync (string id); - - /// - /// Get a task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Task of ApiResponse (Task) - System.Threading.Tasks.Task> CrmTasksIdGetAsyncWithHttpInfo (string id); - /// - /// Update a task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Updated task details. - /// Task of void - System.Threading.Tasks.Task CrmTasksIdPatchAsync (string id, Body7 body); - - /// - /// Update a task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Updated task details. - /// Task of ApiResponse - System.Threading.Tasks.Task> CrmTasksIdPatchAsyncWithHttpInfo (string id, Body7 body); - /// - /// Create a task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Task name. - /// Task of InlineResponse2011 - System.Threading.Tasks.Task CrmTasksPostAsync (Body6 body); - - /// - /// Create a task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Task name. - /// Task of ApiResponse (InlineResponse2011) - System.Threading.Tasks.Task> CrmTasksPostAsyncWithHttpInfo (Body6 body); - /// - /// Get all task types - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Task of TaskTypes - System.Threading.Tasks.Task CrmTasktypesGetAsync (); - - /// - /// Get all task types - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Task of ApiResponse (TaskTypes) - System.Threading.Tasks.Task> CrmTasktypesGetAsyncWithHttpInfo (); - #endregion Asynchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public partial class TasksApi : ITasksApi - { - private sib_api_v3_sdk.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// - /// - public TasksApi(String basePath) - { - this.Configuration = new sib_api_v3_sdk.Client.Configuration { BasePath = basePath }; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using Configuration object - /// - /// An instance of Configuration - /// - public TasksApi(sib_api_v3_sdk.Client.Configuration configuration = null) - { - if (configuration == null) // use the default one in Configuration - this.Configuration = sib_api_v3_sdk.Client.Configuration.Default; - else - this.Configuration = configuration; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] - public void SetBasePath(String basePath) - { - // do nothing - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public sib_api_v3_sdk.Client.Configuration Configuration {get; set;} - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public sib_api_v3_sdk.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - /// - /// Gets the default header. - /// - /// Dictionary of HTTP header - [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] - public IDictionary DefaultHeader() - { - return new ReadOnlyDictionary(this.Configuration.DefaultHeader); - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] - public void AddDefaultHeader(string key, string value) - { - this.Configuration.AddDefaultHeader(key, value); - } - - /// - /// Get all tasks - /// - /// Thrown when fails to make API call - /// Filter by task type (ID) (optional) - /// Filter by task status (optional) - /// Filter by date (optional) - /// Filter by assignTo id (optional) - /// Filter by contact ids (optional) - /// Filter by deals ids (optional) - /// Filter by companies ids (optional) - /// dateFrom to date range filter type (timestamp in milliseconds) (optional) - /// dateTo to date range filter type (timestamp in milliseconds) (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// The field used to sort field names. (optional) - /// TaskList - public TaskList CrmTasksGet (string filterType = null, string filterStatus = null, string filterDate = null, string filterAssignTo = null, string filterContacts = null, string filterDeals = null, string filterCompanies = null, int? dateFrom = null, int? dateTo = null, long? offset = null, long? limit = null, string sort = null, string sortBy = null) - { - ApiResponse localVarResponse = CrmTasksGetWithHttpInfo(filterType, filterStatus, filterDate, filterAssignTo, filterContacts, filterDeals, filterCompanies, dateFrom, dateTo, offset, limit, sort, sortBy); - return localVarResponse.Data; - } - - /// - /// Get all tasks - /// - /// Thrown when fails to make API call - /// Filter by task type (ID) (optional) - /// Filter by task status (optional) - /// Filter by date (optional) - /// Filter by assignTo id (optional) - /// Filter by contact ids (optional) - /// Filter by deals ids (optional) - /// Filter by companies ids (optional) - /// dateFrom to date range filter type (timestamp in milliseconds) (optional) - /// dateTo to date range filter type (timestamp in milliseconds) (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// The field used to sort field names. (optional) - /// ApiResponse of TaskList - public ApiResponse< TaskList > CrmTasksGetWithHttpInfo (string filterType = null, string filterStatus = null, string filterDate = null, string filterAssignTo = null, string filterContacts = null, string filterDeals = null, string filterCompanies = null, int? dateFrom = null, int? dateTo = null, long? offset = null, long? limit = null, string sort = null, string sortBy = null) - { - - var localVarPath = "./crm/tasks"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (filterType != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "filter[type]", filterType)); // query parameter - if (filterStatus != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "filter[status]", filterStatus)); // query parameter - if (filterDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "filter[date]", filterDate)); // query parameter - if (filterAssignTo != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "filter[assignTo]", filterAssignTo)); // query parameter - if (filterContacts != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "filter[contacts]", filterContacts)); // query parameter - if (filterDeals != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "filter[deals]", filterDeals)); // query parameter - if (filterCompanies != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "filter[companies]", filterCompanies)); // query parameter - if (dateFrom != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "dateFrom", dateFrom)); // query parameter - if (dateTo != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "dateTo", dateTo)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - if (sortBy != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sortBy", sortBy)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmTasksGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (TaskList) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(TaskList))); - } - - /// - /// Get all tasks - /// - /// Thrown when fails to make API call - /// Filter by task type (ID) (optional) - /// Filter by task status (optional) - /// Filter by date (optional) - /// Filter by assignTo id (optional) - /// Filter by contact ids (optional) - /// Filter by deals ids (optional) - /// Filter by companies ids (optional) - /// dateFrom to date range filter type (timestamp in milliseconds) (optional) - /// dateTo to date range filter type (timestamp in milliseconds) (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// The field used to sort field names. (optional) - /// Task of TaskList - public async System.Threading.Tasks.Task CrmTasksGetAsync (string filterType = null, string filterStatus = null, string filterDate = null, string filterAssignTo = null, string filterContacts = null, string filterDeals = null, string filterCompanies = null, int? dateFrom = null, int? dateTo = null, long? offset = null, long? limit = null, string sort = null, string sortBy = null) - { - ApiResponse localVarResponse = await CrmTasksGetAsyncWithHttpInfo(filterType, filterStatus, filterDate, filterAssignTo, filterContacts, filterDeals, filterCompanies, dateFrom, dateTo, offset, limit, sort, sortBy); - return localVarResponse.Data; - - } - - /// - /// Get all tasks - /// - /// Thrown when fails to make API call - /// Filter by task type (ID) (optional) - /// Filter by task status (optional) - /// Filter by date (optional) - /// Filter by assignTo id (optional) - /// Filter by contact ids (optional) - /// Filter by deals ids (optional) - /// Filter by companies ids (optional) - /// dateFrom to date range filter type (timestamp in milliseconds) (optional) - /// dateTo to date range filter type (timestamp in milliseconds) (optional) - /// Index of the first document of the page (optional) - /// Number of documents per page (optional, default to 50) - /// Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) - /// The field used to sort field names. (optional) - /// Task of ApiResponse (TaskList) - public async System.Threading.Tasks.Task> CrmTasksGetAsyncWithHttpInfo (string filterType = null, string filterStatus = null, string filterDate = null, string filterAssignTo = null, string filterContacts = null, string filterDeals = null, string filterCompanies = null, int? dateFrom = null, int? dateTo = null, long? offset = null, long? limit = null, string sort = null, string sortBy = null) - { - - var localVarPath = "./crm/tasks"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (filterType != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "filter[type]", filterType)); // query parameter - if (filterStatus != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "filter[status]", filterStatus)); // query parameter - if (filterDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "filter[date]", filterDate)); // query parameter - if (filterAssignTo != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "filter[assignTo]", filterAssignTo)); // query parameter - if (filterContacts != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "filter[contacts]", filterContacts)); // query parameter - if (filterDeals != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "filter[deals]", filterDeals)); // query parameter - if (filterCompanies != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "filter[companies]", filterCompanies)); // query parameter - if (dateFrom != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "dateFrom", dateFrom)); // query parameter - if (dateTo != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "dateTo", dateTo)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - if (sortBy != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sortBy", sortBy)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmTasksGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (TaskList) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(TaskList))); - } - - /// - /// Delete a task - /// - /// Thrown when fails to make API call - /// - /// - public void CrmTasksIdDelete (string id) - { - CrmTasksIdDeleteWithHttpInfo(id); - } - - /// - /// Delete a task - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object(void) - public ApiResponse CrmTasksIdDeleteWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling TasksApi->CrmTasksIdDelete"); - - var localVarPath = "./crm/tasks/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmTasksIdDelete", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete a task - /// - /// Thrown when fails to make API call - /// - /// Task of void - public async System.Threading.Tasks.Task CrmTasksIdDeleteAsync (string id) - { - await CrmTasksIdDeleteAsyncWithHttpInfo(id); - - } - - /// - /// Delete a task - /// - /// Thrown when fails to make API call - /// - /// Task of ApiResponse - public async System.Threading.Tasks.Task> CrmTasksIdDeleteAsyncWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling TasksApi->CrmTasksIdDelete"); - - var localVarPath = "./crm/tasks/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmTasksIdDelete", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Get a task - /// - /// Thrown when fails to make API call - /// - /// Task - public Task CrmTasksIdGet (string id) - { - ApiResponse localVarResponse = CrmTasksIdGetWithHttpInfo(id); - return localVarResponse.Data; - } - - /// - /// Get a task - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Task - public ApiResponse< Task > CrmTasksIdGetWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling TasksApi->CrmTasksIdGet"); - - var localVarPath = "./crm/tasks/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmTasksIdGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (Task) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Task))); - } - - /// - /// Get a task - /// - /// Thrown when fails to make API call - /// - /// Task of Task - public async System.Threading.Tasks.Task CrmTasksIdGetAsync (string id) - { - ApiResponse localVarResponse = await CrmTasksIdGetAsyncWithHttpInfo(id); - return localVarResponse.Data; - - } - - /// - /// Get a task - /// - /// Thrown when fails to make API call - /// - /// Task of ApiResponse (Task) - public async System.Threading.Tasks.Task> CrmTasksIdGetAsyncWithHttpInfo (string id) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling TasksApi->CrmTasksIdGet"); - - var localVarPath = "./crm/tasks/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmTasksIdGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (Task) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Task))); - } - - /// - /// Update a task - /// - /// Thrown when fails to make API call - /// - /// Updated task details. - /// - public void CrmTasksIdPatch (string id, Body7 body) - { - CrmTasksIdPatchWithHttpInfo(id, body); - } - - /// - /// Update a task - /// - /// Thrown when fails to make API call - /// - /// Updated task details. - /// ApiResponse of Object(void) - public ApiResponse CrmTasksIdPatchWithHttpInfo (string id, Body7 body) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling TasksApi->CrmTasksIdPatch"); - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling TasksApi->CrmTasksIdPatch"); - - var localVarPath = "./crm/tasks/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmTasksIdPatch", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Update a task - /// - /// Thrown when fails to make API call - /// - /// Updated task details. - /// Task of void - public async System.Threading.Tasks.Task CrmTasksIdPatchAsync (string id, Body7 body) - { - await CrmTasksIdPatchAsyncWithHttpInfo(id, body); - - } - - /// - /// Update a task - /// - /// Thrown when fails to make API call - /// - /// Updated task details. - /// Task of ApiResponse - public async System.Threading.Tasks.Task> CrmTasksIdPatchAsyncWithHttpInfo (string id, Body7 body) - { - // verify the required parameter 'id' is set - if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling TasksApi->CrmTasksIdPatch"); - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling TasksApi->CrmTasksIdPatch"); - - var localVarPath = "./crm/tasks/{id}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmTasksIdPatch", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Create a task - /// - /// Thrown when fails to make API call - /// Task name. - /// InlineResponse2011 - public InlineResponse2011 CrmTasksPost (Body6 body) - { - ApiResponse localVarResponse = CrmTasksPostWithHttpInfo(body); - return localVarResponse.Data; - } - - /// - /// Create a task - /// - /// Thrown when fails to make API call - /// Task name. - /// ApiResponse of InlineResponse2011 - public ApiResponse< InlineResponse2011 > CrmTasksPostWithHttpInfo (Body6 body) - { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling TasksApi->CrmTasksPost"); - - var localVarPath = "./crm/tasks"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmTasksPost", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (InlineResponse2011) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2011))); - } - - /// - /// Create a task - /// - /// Thrown when fails to make API call - /// Task name. - /// Task of InlineResponse2011 - public async System.Threading.Tasks.Task CrmTasksPostAsync (Body6 body) - { - ApiResponse localVarResponse = await CrmTasksPostAsyncWithHttpInfo(body); - return localVarResponse.Data; - - } - - /// - /// Create a task - /// - /// Thrown when fails to make API call - /// Task name. - /// Task of ApiResponse (InlineResponse2011) - public async System.Threading.Tasks.Task> CrmTasksPostAsyncWithHttpInfo (Body6 body) - { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling TasksApi->CrmTasksPost"); - - var localVarPath = "./crm/tasks"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmTasksPost", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (InlineResponse2011) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2011))); - } - - /// - /// Get all task types - /// - /// Thrown when fails to make API call - /// TaskTypes - public TaskTypes CrmTasktypesGet () - { - ApiResponse localVarResponse = CrmTasktypesGetWithHttpInfo(); - return localVarResponse.Data; - } - - /// - /// Get all task types - /// - /// Thrown when fails to make API call - /// ApiResponse of TaskTypes - public ApiResponse< TaskTypes > CrmTasktypesGetWithHttpInfo () - { - - var localVarPath = "./crm/tasktypes"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmTasktypesGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (TaskTypes) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(TaskTypes))); - } - - /// - /// Get all task types - /// - /// Thrown when fails to make API call - /// Task of TaskTypes - public async System.Threading.Tasks.Task CrmTasktypesGetAsync () - { - ApiResponse localVarResponse = await CrmTasktypesGetAsyncWithHttpInfo(); - return localVarResponse.Data; - - } - - /// - /// Get all task types - /// - /// Thrown when fails to make API call - /// Task of ApiResponse (TaskTypes) - public async System.Threading.Tasks.Task> CrmTasktypesGetAsyncWithHttpInfo () - { - - var localVarPath = "./crm/tasktypes"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CrmTasktypesGet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (TaskTypes) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(TaskTypes))); - } - - } -} diff --git a/src/sib_api_v3_sdk/Api/TransactionalEmailsApi.cs b/src/sib_api_v3_sdk/Api/TransactionalEmailsApi.cs index 0bc85b0..095c126 100644 --- a/src/sib_api_v3_sdk/Api/TransactionalEmailsApi.cs +++ b/src/sib_api_v3_sdk/Api/TransactionalEmailsApi.cs @@ -1,4924 +1,168 @@ -/* - * SendinBlue API - * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :- -- -- -- -- -- --: | - -- -- -- -- -- -- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | - * - * OpenAPI spec version: 3.0.0 - * Contact: contact@sendinblue.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using RestSharp.Portable; -using sib_api_v3_sdk.Client; -using sib_api_v3_sdk.Model; - -namespace sib_api_v3_sdk.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface ITransactionalEmailsApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Add a new domain to the list of blocked domains - /// - /// - /// Blocks a new domain in order to avoid messages being sent to the same - /// - /// Thrown when fails to make API call - /// - /// - void BlockNewDomain (BlockDomain blockDomain); - - /// - /// Add a new domain to the list of blocked domains - /// - /// - /// Blocks a new domain in order to avoid messages being sent to the same - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object(void) - ApiResponse BlockNewDomainWithHttpInfo (BlockDomain blockDomain); - /// - /// Create an email template - /// - /// - /// - /// - /// Thrown when fails to make API call - /// values to update in transactional email template - /// CreateModel - CreateModel CreateSmtpTemplate (CreateSmtpTemplate smtpTemplate); - - /// - /// Create an email template - /// - /// - /// - /// - /// Thrown when fails to make API call - /// values to update in transactional email template - /// ApiResponse of CreateModel - ApiResponse CreateSmtpTemplateWithHttpInfo (CreateSmtpTemplate smtpTemplate); - /// - /// Unblock an existing domain from the list of blocked domains - /// - /// - /// Unblocks an existing domain from the list of blocked domains - /// - /// Thrown when fails to make API call - /// The name of the domain to be deleted - /// - void DeleteBlockedDomain (string domain); - - /// - /// Unblock an existing domain from the list of blocked domains - /// - /// - /// Unblocks an existing domain from the list of blocked domains - /// - /// Thrown when fails to make API call - /// The name of the domain to be deleted - /// ApiResponse of Object(void) - ApiResponse DeleteBlockedDomainWithHttpInfo (string domain); - /// - /// Delete hardbounces - /// - /// - /// Delete hardbounces. To use carefully (e.g. in case of temporary ISP failures) - /// - /// Thrown when fails to make API call - /// values to delete hardbounces (optional) - /// - void DeleteHardbounces (DeleteHardbounces deleteHardbounces = null); - - /// - /// Delete hardbounces - /// - /// - /// Delete hardbounces. To use carefully (e.g. in case of temporary ISP failures) - /// - /// Thrown when fails to make API call - /// values to delete hardbounces (optional) - /// ApiResponse of Object(void) - ApiResponse DeleteHardbouncesWithHttpInfo (DeleteHardbounces deleteHardbounces = null); - /// - /// Delete scheduled emails by batchId or messageId - /// - /// - /// Delete scheduled batch of emails by batchId or single scheduled email by messageId - /// - /// Thrown when fails to make API call - /// The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. - /// - void DeleteScheduledEmailById (string identifier); - - /// - /// Delete scheduled emails by batchId or messageId - /// - /// - /// Delete scheduled batch of emails by batchId or single scheduled email by messageId - /// - /// Thrown when fails to make API call - /// The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. - /// ApiResponse of Object(void) - ApiResponse DeleteScheduledEmailByIdWithHttpInfo (string identifier); - /// - /// Delete an inactive email template - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the template - /// - void DeleteSmtpTemplate (long? templateId); - - /// - /// Delete an inactive email template - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the template - /// ApiResponse of Object(void) - ApiResponse DeleteSmtpTemplateWithHttpInfo (long? templateId); - /// - /// Get your transactional email activity aggregated over a period of time - /// - /// - /// This endpoint will show the aggregated stats for past 90 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) - /// Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Tag of the emails (optional) - /// GetAggregatedReport - GetAggregatedReport GetAggregatedSmtpReport (string startDate = null, string endDate = null, long? days = null, string tag = null); - - /// - /// Get your transactional email activity aggregated over a period of time - /// - /// - /// This endpoint will show the aggregated stats for past 90 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) - /// Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Tag of the emails (optional) - /// ApiResponse of GetAggregatedReport - ApiResponse GetAggregatedSmtpReportWithHttpInfo (string startDate = null, string endDate = null, long? days = null, string tag = null); - /// - /// Get the list of blocked domains - /// - /// - /// Get the list of blocked domains - /// - /// Thrown when fails to make API call - /// GetBlockedDomains - GetBlockedDomains GetBlockedDomains (); - - /// - /// Get the list of blocked domains - /// - /// - /// Get the list of blocked domains - /// - /// Thrown when fails to make API call - /// ApiResponse of GetBlockedDomains - ApiResponse GetBlockedDomainsWithHttpInfo (); - /// - /// Get all your transactional email activity (unaggregated events) - /// - /// - /// This endpoint will show the aggregated stats for past 30 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days - /// - /// Thrown when fails to make API call - /// Number limitation for the result returned (optional, default to 2500) - /// Beginning point in the list to retrieve from. (optional, default to 0) - /// Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) - /// Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Filter the report for a specific email addresses (optional) - /// Filter the report for a specific event type (optional) - /// Filter the report for tags (serialized and urlencoded array) (optional) - /// Filter on a specific message id (optional) - /// Filter on a specific template id (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// GetEmailEventReport - GetEmailEventReport GetEmailEventReport (long? limit = null, long? offset = null, string startDate = null, string endDate = null, long? days = null, string email = null, string _event = null, string tags = null, string messageId = null, long? templateId = null, string sort = null); - - /// - /// Get all your transactional email activity (unaggregated events) - /// - /// - /// This endpoint will show the aggregated stats for past 30 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days - /// - /// Thrown when fails to make API call - /// Number limitation for the result returned (optional, default to 2500) - /// Beginning point in the list to retrieve from. (optional, default to 0) - /// Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) - /// Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Filter the report for a specific email addresses (optional) - /// Filter the report for a specific event type (optional) - /// Filter the report for tags (serialized and urlencoded array) (optional) - /// Filter on a specific message id (optional) - /// Filter on a specific template id (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// ApiResponse of GetEmailEventReport - ApiResponse GetEmailEventReportWithHttpInfo (long? limit = null, long? offset = null, string startDate = null, string endDate = null, long? days = null, string email = null, string _event = null, string tags = null, string messageId = null, long? templateId = null, string sort = null); - /// - /// Fetch scheduled emails by batchId - /// - /// - /// Fetch scheduled batch of emails by batchId (Can retrieve data upto 30 days old) - /// - /// Thrown when fails to make API call - /// The batchId of scheduled emails batch (Should be a valid UUIDv4) - /// Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional) - /// Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Filter the records by `status` of the scheduled email batch or message. (optional) - /// Number of documents returned per page (optional, default to 100) - /// Index of the first document on the page (optional, default to 0) - /// GetScheduledEmailByBatchId - GetScheduledEmailByBatchId GetScheduledEmailByBatchId (string batchId, DateTime? startDate = null, DateTime? endDate = null, string sort = null, string status = null, long? limit = null, long? offset = null); - - /// - /// Fetch scheduled emails by batchId - /// - /// - /// Fetch scheduled batch of emails by batchId (Can retrieve data upto 30 days old) - /// - /// Thrown when fails to make API call - /// The batchId of scheduled emails batch (Should be a valid UUIDv4) - /// Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional) - /// Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Filter the records by `status` of the scheduled email batch or message. (optional) - /// Number of documents returned per page (optional, default to 100) - /// Index of the first document on the page (optional, default to 0) - /// ApiResponse of GetScheduledEmailByBatchId - ApiResponse GetScheduledEmailByBatchIdWithHttpInfo (string batchId, DateTime? startDate = null, DateTime? endDate = null, string sort = null, string status = null, long? limit = null, long? offset = null); - /// - /// Fetch scheduled email by messageId - /// - /// - /// Fetch scheduled email by messageId (Can retrieve data upto 30 days old) - /// - /// Thrown when fails to make API call - /// The messageId of scheduled email - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// GetScheduledEmailByMessageId - GetScheduledEmailByMessageId GetScheduledEmailByMessageId (string messageId, DateTime? startDate = null, DateTime? endDate = null); - - /// - /// Fetch scheduled email by messageId - /// - /// - /// Fetch scheduled email by messageId (Can retrieve data upto 30 days old) - /// - /// Thrown when fails to make API call - /// The messageId of scheduled email - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// ApiResponse of GetScheduledEmailByMessageId - ApiResponse GetScheduledEmailByMessageIdWithHttpInfo (string messageId, DateTime? startDate = null, DateTime? endDate = null); - /// - /// Get your transactional email activity aggregated per day - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents returned per page (optional, default to 10) - /// Index of the first document on the page (optional, default to 0) - /// Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional) - /// Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Tag of the emails (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// GetReports - GetReports GetSmtpReport (long? limit = null, long? offset = null, string startDate = null, string endDate = null, long? days = null, string tag = null, string sort = null); - - /// - /// Get your transactional email activity aggregated per day - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents returned per page (optional, default to 10) - /// Index of the first document on the page (optional, default to 0) - /// Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional) - /// Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Tag of the emails (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// ApiResponse of GetReports - ApiResponse GetSmtpReportWithHttpInfo (long? limit = null, long? offset = null, string startDate = null, string endDate = null, long? days = null, string tag = null, string sort = null); - /// - /// Returns the template information - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the template - /// GetSmtpTemplateOverview - GetSmtpTemplateOverview GetSmtpTemplate (long? templateId); - - /// - /// Returns the template information - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the template - /// ApiResponse of GetSmtpTemplateOverview - ApiResponse GetSmtpTemplateWithHttpInfo (long? templateId); - /// - /// Get the list of email templates - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter on the status of the template. Active = true, inactive = false (optional) - /// Number of documents returned per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// GetSmtpTemplates - GetSmtpTemplates GetSmtpTemplates (bool? templateStatus = null, long? limit = null, long? offset = null, string sort = null); - - /// - /// Get the list of email templates - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter on the status of the template. Active = true, inactive = false (optional) - /// Number of documents returned per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// ApiResponse of GetSmtpTemplates - ApiResponse GetSmtpTemplatesWithHttpInfo (bool? templateStatus = null, long? limit = null, long? offset = null, string sort = null); - /// - /// Get the list of blocked or unsubscribed transactional contacts - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts (optional) - /// Number of documents returned per page (optional, default to 50) - /// Index of the first document on the page (optional, default to 0) - /// Comma separated list of emails of the senders from which contacts are blocked or unsubscribed (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// GetTransacBlockedContacts - GetTransacBlockedContacts GetTransacBlockedContacts (string startDate = null, string endDate = null, long? limit = null, long? offset = null, List senders = null, string sort = null); - - /// - /// Get the list of blocked or unsubscribed transactional contacts - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts (optional) - /// Number of documents returned per page (optional, default to 50) - /// Index of the first document on the page (optional, default to 0) - /// Comma separated list of emails of the senders from which contacts are blocked or unsubscribed (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// ApiResponse of GetTransacBlockedContacts - ApiResponse GetTransacBlockedContactsWithHttpInfo (string startDate = null, string endDate = null, long? limit = null, long? offset = null, List senders = null, string sort = null); - /// - /// Get the personalized content of a sent transactional email - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Unique id of the transactional email that has been sent to a particular contact - /// GetTransacEmailContent - GetTransacEmailContent GetTransacEmailContent (string uuid); - - /// - /// Get the personalized content of a sent transactional email - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Unique id of the transactional email that has been sent to a particular contact - /// ApiResponse of GetTransacEmailContent - ApiResponse GetTransacEmailContentWithHttpInfo (string uuid); - /// - /// Get the list of transactional emails on the basis of allowed filters - /// - /// - /// This endpoint will show the list of emails for past 30 days by default. To retrieve emails before that time, please pass startDate and endDate in query filters. - /// - /// Thrown when fails to make API call - /// Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. (optional) - /// Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. (optional) - /// Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. (optional) - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Number of documents returned per page (optional, default to 500) - /// Index of the first document in the page (optional, default to 0) - /// GetTransacEmailsList - GetTransacEmailsList GetTransacEmailsList (string email = null, long? templateId = null, string messageId = null, string startDate = null, string endDate = null, string sort = null, long? limit = null, long? offset = null); - - /// - /// Get the list of transactional emails on the basis of allowed filters - /// - /// - /// This endpoint will show the list of emails for past 30 days by default. To retrieve emails before that time, please pass startDate and endDate in query filters. - /// - /// Thrown when fails to make API call - /// Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. (optional) - /// Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. (optional) - /// Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. (optional) - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Number of documents returned per page (optional, default to 500) - /// Index of the first document in the page (optional, default to 0) - /// ApiResponse of GetTransacEmailsList - ApiResponse GetTransacEmailsListWithHttpInfo (string email = null, long? templateId = null, string messageId = null, string startDate = null, string endDate = null, string sort = null, long? limit = null, long? offset = null); - /// - /// Send a template to your test list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the template - /// - /// - void SendTestTemplate (long? templateId, SendTestEmail sendTestEmail); - - /// - /// Send a template to your test list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the template - /// - /// ApiResponse of Object(void) - ApiResponse SendTestTemplateWithHttpInfo (long? templateId, SendTestEmail sendTestEmail); - /// - /// Send a transactional email - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to send a transactional email - /// CreateSmtpEmail - CreateSmtpEmail SendTransacEmail (SendSmtpEmail sendSmtpEmail); - - /// - /// Send a transactional email - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to send a transactional email - /// ApiResponse of CreateSmtpEmail - ApiResponse SendTransacEmailWithHttpInfo (SendSmtpEmail sendSmtpEmail); - /// - /// Unblock or resubscribe a transactional contact - /// - /// - /// - /// - /// Thrown when fails to make API call - /// contact email (urlencoded) to unblock. - /// - void SmtpBlockedContactsEmailDelete (string email); - - /// - /// Unblock or resubscribe a transactional contact - /// - /// - /// - /// - /// Thrown when fails to make API call - /// contact email (urlencoded) to unblock. - /// ApiResponse of Object(void) - ApiResponse SmtpBlockedContactsEmailDeleteWithHttpInfo (string email); - /// - /// Delete an SMTP transactional log - /// - /// - /// - /// - /// Thrown when fails to make API call - /// MessageId of the transactional log to delete - /// - void SmtpLogMessageIdDelete (string messageId); - - /// - /// Delete an SMTP transactional log - /// - /// - /// - /// - /// Thrown when fails to make API call - /// MessageId of the transactional log to delete - /// ApiResponse of Object(void) - ApiResponse SmtpLogMessageIdDeleteWithHttpInfo (string messageId); - /// - /// Update an email template - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the template - /// values to update in transactional email template - /// - void UpdateSmtpTemplate (long? templateId, UpdateSmtpTemplate smtpTemplate); - - /// - /// Update an email template - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the template - /// values to update in transactional email template - /// ApiResponse of Object(void) - ApiResponse UpdateSmtpTemplateWithHttpInfo (long? templateId, UpdateSmtpTemplate smtpTemplate); - #endregion Synchronous Operations - #region Asynchronous Operations - /// - /// Add a new domain to the list of blocked domains - /// - /// - /// Blocks a new domain in order to avoid messages being sent to the same - /// - /// Thrown when fails to make API call - /// - /// Task of void - System.Threading.Tasks.Task BlockNewDomainAsync (BlockDomain blockDomain); - - /// - /// Add a new domain to the list of blocked domains - /// - /// - /// Blocks a new domain in order to avoid messages being sent to the same - /// - /// Thrown when fails to make API call - /// - /// Task of ApiResponse - System.Threading.Tasks.Task> BlockNewDomainAsyncWithHttpInfo (BlockDomain blockDomain); - /// - /// Create an email template - /// - /// - /// - /// - /// Thrown when fails to make API call - /// values to update in transactional email template - /// Task of CreateModel - System.Threading.Tasks.Task CreateSmtpTemplateAsync (CreateSmtpTemplate smtpTemplate); - - /// - /// Create an email template - /// - /// - /// - /// - /// Thrown when fails to make API call - /// values to update in transactional email template - /// Task of ApiResponse (CreateModel) - System.Threading.Tasks.Task> CreateSmtpTemplateAsyncWithHttpInfo (CreateSmtpTemplate smtpTemplate); - /// - /// Unblock an existing domain from the list of blocked domains - /// - /// - /// Unblocks an existing domain from the list of blocked domains - /// - /// Thrown when fails to make API call - /// The name of the domain to be deleted - /// Task of void - System.Threading.Tasks.Task DeleteBlockedDomainAsync (string domain); - - /// - /// Unblock an existing domain from the list of blocked domains - /// - /// - /// Unblocks an existing domain from the list of blocked domains - /// - /// Thrown when fails to make API call - /// The name of the domain to be deleted - /// Task of ApiResponse - System.Threading.Tasks.Task> DeleteBlockedDomainAsyncWithHttpInfo (string domain); - /// - /// Delete hardbounces - /// - /// - /// Delete hardbounces. To use carefully (e.g. in case of temporary ISP failures) - /// - /// Thrown when fails to make API call - /// values to delete hardbounces (optional) - /// Task of void - System.Threading.Tasks.Task DeleteHardbouncesAsync (DeleteHardbounces deleteHardbounces = null); - - /// - /// Delete hardbounces - /// - /// - /// Delete hardbounces. To use carefully (e.g. in case of temporary ISP failures) - /// - /// Thrown when fails to make API call - /// values to delete hardbounces (optional) - /// Task of ApiResponse - System.Threading.Tasks.Task> DeleteHardbouncesAsyncWithHttpInfo (DeleteHardbounces deleteHardbounces = null); - /// - /// Delete scheduled emails by batchId or messageId - /// - /// - /// Delete scheduled batch of emails by batchId or single scheduled email by messageId - /// - /// Thrown when fails to make API call - /// The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. - /// Task of void - System.Threading.Tasks.Task DeleteScheduledEmailByIdAsync (string identifier); - - /// - /// Delete scheduled emails by batchId or messageId - /// - /// - /// Delete scheduled batch of emails by batchId or single scheduled email by messageId - /// - /// Thrown when fails to make API call - /// The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. - /// Task of ApiResponse - System.Threading.Tasks.Task> DeleteScheduledEmailByIdAsyncWithHttpInfo (string identifier); - /// - /// Delete an inactive email template - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the template - /// Task of void - System.Threading.Tasks.Task DeleteSmtpTemplateAsync (long? templateId); - - /// - /// Delete an inactive email template - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the template - /// Task of ApiResponse - System.Threading.Tasks.Task> DeleteSmtpTemplateAsyncWithHttpInfo (long? templateId); - /// - /// Get your transactional email activity aggregated over a period of time - /// - /// - /// This endpoint will show the aggregated stats for past 90 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) - /// Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Tag of the emails (optional) - /// Task of GetAggregatedReport - System.Threading.Tasks.Task GetAggregatedSmtpReportAsync (string startDate = null, string endDate = null, long? days = null, string tag = null); - - /// - /// Get your transactional email activity aggregated over a period of time - /// - /// - /// This endpoint will show the aggregated stats for past 90 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) - /// Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Tag of the emails (optional) - /// Task of ApiResponse (GetAggregatedReport) - System.Threading.Tasks.Task> GetAggregatedSmtpReportAsyncWithHttpInfo (string startDate = null, string endDate = null, long? days = null, string tag = null); - /// - /// Get the list of blocked domains - /// - /// - /// Get the list of blocked domains - /// - /// Thrown when fails to make API call - /// Task of GetBlockedDomains - System.Threading.Tasks.Task GetBlockedDomainsAsync (); - - /// - /// Get the list of blocked domains - /// - /// - /// Get the list of blocked domains - /// - /// Thrown when fails to make API call - /// Task of ApiResponse (GetBlockedDomains) - System.Threading.Tasks.Task> GetBlockedDomainsAsyncWithHttpInfo (); - /// - /// Get all your transactional email activity (unaggregated events) - /// - /// - /// This endpoint will show the aggregated stats for past 30 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days - /// - /// Thrown when fails to make API call - /// Number limitation for the result returned (optional, default to 2500) - /// Beginning point in the list to retrieve from. (optional, default to 0) - /// Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) - /// Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Filter the report for a specific email addresses (optional) - /// Filter the report for a specific event type (optional) - /// Filter the report for tags (serialized and urlencoded array) (optional) - /// Filter on a specific message id (optional) - /// Filter on a specific template id (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of GetEmailEventReport - System.Threading.Tasks.Task GetEmailEventReportAsync (long? limit = null, long? offset = null, string startDate = null, string endDate = null, long? days = null, string email = null, string _event = null, string tags = null, string messageId = null, long? templateId = null, string sort = null); - - /// - /// Get all your transactional email activity (unaggregated events) - /// - /// - /// This endpoint will show the aggregated stats for past 30 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days - /// - /// Thrown when fails to make API call - /// Number limitation for the result returned (optional, default to 2500) - /// Beginning point in the list to retrieve from. (optional, default to 0) - /// Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) - /// Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Filter the report for a specific email addresses (optional) - /// Filter the report for a specific event type (optional) - /// Filter the report for tags (serialized and urlencoded array) (optional) - /// Filter on a specific message id (optional) - /// Filter on a specific template id (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of ApiResponse (GetEmailEventReport) - System.Threading.Tasks.Task> GetEmailEventReportAsyncWithHttpInfo (long? limit = null, long? offset = null, string startDate = null, string endDate = null, long? days = null, string email = null, string _event = null, string tags = null, string messageId = null, long? templateId = null, string sort = null); - /// - /// Fetch scheduled emails by batchId - /// - /// - /// Fetch scheduled batch of emails by batchId (Can retrieve data upto 30 days old) - /// - /// Thrown when fails to make API call - /// The batchId of scheduled emails batch (Should be a valid UUIDv4) - /// Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional) - /// Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Filter the records by `status` of the scheduled email batch or message. (optional) - /// Number of documents returned per page (optional, default to 100) - /// Index of the first document on the page (optional, default to 0) - /// Task of GetScheduledEmailByBatchId - System.Threading.Tasks.Task GetScheduledEmailByBatchIdAsync (string batchId, DateTime? startDate = null, DateTime? endDate = null, string sort = null, string status = null, long? limit = null, long? offset = null); - - /// - /// Fetch scheduled emails by batchId - /// - /// - /// Fetch scheduled batch of emails by batchId (Can retrieve data upto 30 days old) - /// - /// Thrown when fails to make API call - /// The batchId of scheduled emails batch (Should be a valid UUIDv4) - /// Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional) - /// Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Filter the records by `status` of the scheduled email batch or message. (optional) - /// Number of documents returned per page (optional, default to 100) - /// Index of the first document on the page (optional, default to 0) - /// Task of ApiResponse (GetScheduledEmailByBatchId) - System.Threading.Tasks.Task> GetScheduledEmailByBatchIdAsyncWithHttpInfo (string batchId, DateTime? startDate = null, DateTime? endDate = null, string sort = null, string status = null, long? limit = null, long? offset = null); - /// - /// Fetch scheduled email by messageId - /// - /// - /// Fetch scheduled email by messageId (Can retrieve data upto 30 days old) - /// - /// Thrown when fails to make API call - /// The messageId of scheduled email - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Task of GetScheduledEmailByMessageId - System.Threading.Tasks.Task GetScheduledEmailByMessageIdAsync (string messageId, DateTime? startDate = null, DateTime? endDate = null); - - /// - /// Fetch scheduled email by messageId - /// - /// - /// Fetch scheduled email by messageId (Can retrieve data upto 30 days old) - /// - /// Thrown when fails to make API call - /// The messageId of scheduled email - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Task of ApiResponse (GetScheduledEmailByMessageId) - System.Threading.Tasks.Task> GetScheduledEmailByMessageIdAsyncWithHttpInfo (string messageId, DateTime? startDate = null, DateTime? endDate = null); - /// - /// Get your transactional email activity aggregated per day - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents returned per page (optional, default to 10) - /// Index of the first document on the page (optional, default to 0) - /// Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional) - /// Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Tag of the emails (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of GetReports - System.Threading.Tasks.Task GetSmtpReportAsync (long? limit = null, long? offset = null, string startDate = null, string endDate = null, long? days = null, string tag = null, string sort = null); - - /// - /// Get your transactional email activity aggregated per day - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents returned per page (optional, default to 10) - /// Index of the first document on the page (optional, default to 0) - /// Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional) - /// Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Tag of the emails (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of ApiResponse (GetReports) - System.Threading.Tasks.Task> GetSmtpReportAsyncWithHttpInfo (long? limit = null, long? offset = null, string startDate = null, string endDate = null, long? days = null, string tag = null, string sort = null); - /// - /// Returns the template information - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the template - /// Task of GetSmtpTemplateOverview - System.Threading.Tasks.Task GetSmtpTemplateAsync (long? templateId); - - /// - /// Returns the template information - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the template - /// Task of ApiResponse (GetSmtpTemplateOverview) - System.Threading.Tasks.Task> GetSmtpTemplateAsyncWithHttpInfo (long? templateId); - /// - /// Get the list of email templates - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter on the status of the template. Active = true, inactive = false (optional) - /// Number of documents returned per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of GetSmtpTemplates - System.Threading.Tasks.Task GetSmtpTemplatesAsync (bool? templateStatus = null, long? limit = null, long? offset = null, string sort = null); - - /// - /// Get the list of email templates - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter on the status of the template. Active = true, inactive = false (optional) - /// Number of documents returned per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of ApiResponse (GetSmtpTemplates) - System.Threading.Tasks.Task> GetSmtpTemplatesAsyncWithHttpInfo (bool? templateStatus = null, long? limit = null, long? offset = null, string sort = null); - /// - /// Get the list of blocked or unsubscribed transactional contacts - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts (optional) - /// Number of documents returned per page (optional, default to 50) - /// Index of the first document on the page (optional, default to 0) - /// Comma separated list of emails of the senders from which contacts are blocked or unsubscribed (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of GetTransacBlockedContacts - System.Threading.Tasks.Task GetTransacBlockedContactsAsync (string startDate = null, string endDate = null, long? limit = null, long? offset = null, List senders = null, string sort = null); - - /// - /// Get the list of blocked or unsubscribed transactional contacts - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts (optional) - /// Number of documents returned per page (optional, default to 50) - /// Index of the first document on the page (optional, default to 0) - /// Comma separated list of emails of the senders from which contacts are blocked or unsubscribed (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of ApiResponse (GetTransacBlockedContacts) - System.Threading.Tasks.Task> GetTransacBlockedContactsAsyncWithHttpInfo (string startDate = null, string endDate = null, long? limit = null, long? offset = null, List senders = null, string sort = null); - /// - /// Get the personalized content of a sent transactional email - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Unique id of the transactional email that has been sent to a particular contact - /// Task of GetTransacEmailContent - System.Threading.Tasks.Task GetTransacEmailContentAsync (string uuid); - - /// - /// Get the personalized content of a sent transactional email - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Unique id of the transactional email that has been sent to a particular contact - /// Task of ApiResponse (GetTransacEmailContent) - System.Threading.Tasks.Task> GetTransacEmailContentAsyncWithHttpInfo (string uuid); - /// - /// Get the list of transactional emails on the basis of allowed filters - /// - /// - /// This endpoint will show the list of emails for past 30 days by default. To retrieve emails before that time, please pass startDate and endDate in query filters. - /// - /// Thrown when fails to make API call - /// Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. (optional) - /// Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. (optional) - /// Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. (optional) - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Number of documents returned per page (optional, default to 500) - /// Index of the first document in the page (optional, default to 0) - /// Task of GetTransacEmailsList - System.Threading.Tasks.Task GetTransacEmailsListAsync (string email = null, long? templateId = null, string messageId = null, string startDate = null, string endDate = null, string sort = null, long? limit = null, long? offset = null); - - /// - /// Get the list of transactional emails on the basis of allowed filters - /// - /// - /// This endpoint will show the list of emails for past 30 days by default. To retrieve emails before that time, please pass startDate and endDate in query filters. - /// - /// Thrown when fails to make API call - /// Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. (optional) - /// Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. (optional) - /// Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. (optional) - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Number of documents returned per page (optional, default to 500) - /// Index of the first document in the page (optional, default to 0) - /// Task of ApiResponse (GetTransacEmailsList) - System.Threading.Tasks.Task> GetTransacEmailsListAsyncWithHttpInfo (string email = null, long? templateId = null, string messageId = null, string startDate = null, string endDate = null, string sort = null, long? limit = null, long? offset = null); - /// - /// Send a template to your test list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the template - /// - /// Task of void - System.Threading.Tasks.Task SendTestTemplateAsync (long? templateId, SendTestEmail sendTestEmail); - - /// - /// Send a template to your test list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the template - /// - /// Task of ApiResponse - System.Threading.Tasks.Task> SendTestTemplateAsyncWithHttpInfo (long? templateId, SendTestEmail sendTestEmail); - /// - /// Send a transactional email - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to send a transactional email - /// Task of CreateSmtpEmail - System.Threading.Tasks.Task SendTransacEmailAsync (SendSmtpEmail sendSmtpEmail); - - /// - /// Send a transactional email - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to send a transactional email - /// Task of ApiResponse (CreateSmtpEmail) - System.Threading.Tasks.Task> SendTransacEmailAsyncWithHttpInfo (SendSmtpEmail sendSmtpEmail); - /// - /// Unblock or resubscribe a transactional contact - /// - /// - /// - /// - /// Thrown when fails to make API call - /// contact email (urlencoded) to unblock. - /// Task of void - System.Threading.Tasks.Task SmtpBlockedContactsEmailDeleteAsync (string email); - - /// - /// Unblock or resubscribe a transactional contact - /// - /// - /// - /// - /// Thrown when fails to make API call - /// contact email (urlencoded) to unblock. - /// Task of ApiResponse - System.Threading.Tasks.Task> SmtpBlockedContactsEmailDeleteAsyncWithHttpInfo (string email); - /// - /// Delete an SMTP transactional log - /// - /// - /// - /// - /// Thrown when fails to make API call - /// MessageId of the transactional log to delete - /// Task of void - System.Threading.Tasks.Task SmtpLogMessageIdDeleteAsync (string messageId); - - /// - /// Delete an SMTP transactional log - /// - /// - /// - /// - /// Thrown when fails to make API call - /// MessageId of the transactional log to delete - /// Task of ApiResponse - System.Threading.Tasks.Task> SmtpLogMessageIdDeleteAsyncWithHttpInfo (string messageId); - /// - /// Update an email template - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the template - /// values to update in transactional email template - /// Task of void - System.Threading.Tasks.Task UpdateSmtpTemplateAsync (long? templateId, UpdateSmtpTemplate smtpTemplate); - - /// - /// Update an email template - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the template - /// values to update in transactional email template - /// Task of ApiResponse - System.Threading.Tasks.Task> UpdateSmtpTemplateAsyncWithHttpInfo (long? templateId, UpdateSmtpTemplate smtpTemplate); - #endregion Asynchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public partial class TransactionalEmailsApi : ITransactionalEmailsApi - { - private sib_api_v3_sdk.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// - /// - public TransactionalEmailsApi(String basePath) - { - this.Configuration = new sib_api_v3_sdk.Client.Configuration { BasePath = basePath }; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using Configuration object - /// - /// An instance of Configuration - /// - public TransactionalEmailsApi(sib_api_v3_sdk.Client.Configuration configuration = null) - { - if (configuration == null) // use the default one in Configuration - this.Configuration = sib_api_v3_sdk.Client.Configuration.Default; - else - this.Configuration = configuration; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] - public void SetBasePath(String basePath) - { - // do nothing - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public sib_api_v3_sdk.Client.Configuration Configuration {get; set;} - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public sib_api_v3_sdk.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - /// - /// Gets the default header. - /// - /// Dictionary of HTTP header - [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] - public IDictionary DefaultHeader() - { - return new ReadOnlyDictionary(this.Configuration.DefaultHeader); - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] - public void AddDefaultHeader(string key, string value) - { - this.Configuration.AddDefaultHeader(key, value); - } - - /// - /// Add a new domain to the list of blocked domains Blocks a new domain in order to avoid messages being sent to the same - /// - /// Thrown when fails to make API call - /// - /// - public void BlockNewDomain (BlockDomain blockDomain) - { - BlockNewDomainWithHttpInfo(blockDomain); - } - - /// - /// Add a new domain to the list of blocked domains Blocks a new domain in order to avoid messages being sent to the same - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object(void) - public ApiResponse BlockNewDomainWithHttpInfo (BlockDomain blockDomain) - { - // verify the required parameter 'blockDomain' is set - if (blockDomain == null) - throw new ApiException(400, "Missing required parameter 'blockDomain' when calling TransactionalEmailsApi->BlockNewDomain"); - - var localVarPath = "./smtp/blockedDomains"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (blockDomain != null && blockDomain.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(blockDomain); // http body (model) parameter - } - else - { - localVarPostBody = blockDomain; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("BlockNewDomain", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Add a new domain to the list of blocked domains Blocks a new domain in order to avoid messages being sent to the same - /// - /// Thrown when fails to make API call - /// - /// Task of void - public async System.Threading.Tasks.Task BlockNewDomainAsync (BlockDomain blockDomain) - { - await BlockNewDomainAsyncWithHttpInfo(blockDomain); - - } - - /// - /// Add a new domain to the list of blocked domains Blocks a new domain in order to avoid messages being sent to the same - /// - /// Thrown when fails to make API call - /// - /// Task of ApiResponse - public async System.Threading.Tasks.Task> BlockNewDomainAsyncWithHttpInfo (BlockDomain blockDomain) - { - // verify the required parameter 'blockDomain' is set - if (blockDomain == null) - throw new ApiException(400, "Missing required parameter 'blockDomain' when calling TransactionalEmailsApi->BlockNewDomain"); - - var localVarPath = "./smtp/blockedDomains"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (blockDomain != null && blockDomain.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(blockDomain); // http body (model) parameter - } - else - { - localVarPostBody = blockDomain; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("BlockNewDomain", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Create an email template - /// - /// Thrown when fails to make API call - /// values to update in transactional email template - /// CreateModel - public CreateModel CreateSmtpTemplate (CreateSmtpTemplate smtpTemplate) - { - ApiResponse localVarResponse = CreateSmtpTemplateWithHttpInfo(smtpTemplate); - return localVarResponse.Data; - } - - /// - /// Create an email template - /// - /// Thrown when fails to make API call - /// values to update in transactional email template - /// ApiResponse of CreateModel - public ApiResponse< CreateModel > CreateSmtpTemplateWithHttpInfo (CreateSmtpTemplate smtpTemplate) - { - // verify the required parameter 'smtpTemplate' is set - if (smtpTemplate == null) - throw new ApiException(400, "Missing required parameter 'smtpTemplate' when calling TransactionalEmailsApi->CreateSmtpTemplate"); - - var localVarPath = "./smtp/templates"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (smtpTemplate != null && smtpTemplate.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(smtpTemplate); // http body (model) parameter - } - else - { - localVarPostBody = smtpTemplate; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateSmtpTemplate", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateModel))); - } - - /// - /// Create an email template - /// - /// Thrown when fails to make API call - /// values to update in transactional email template - /// Task of CreateModel - public async System.Threading.Tasks.Task CreateSmtpTemplateAsync (CreateSmtpTemplate smtpTemplate) - { - ApiResponse localVarResponse = await CreateSmtpTemplateAsyncWithHttpInfo(smtpTemplate); - return localVarResponse.Data; - - } - - /// - /// Create an email template - /// - /// Thrown when fails to make API call - /// values to update in transactional email template - /// Task of ApiResponse (CreateModel) - public async System.Threading.Tasks.Task> CreateSmtpTemplateAsyncWithHttpInfo (CreateSmtpTemplate smtpTemplate) - { - // verify the required parameter 'smtpTemplate' is set - if (smtpTemplate == null) - throw new ApiException(400, "Missing required parameter 'smtpTemplate' when calling TransactionalEmailsApi->CreateSmtpTemplate"); - - var localVarPath = "./smtp/templates"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (smtpTemplate != null && smtpTemplate.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(smtpTemplate); // http body (model) parameter - } - else - { - localVarPostBody = smtpTemplate; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateSmtpTemplate", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateModel))); - } - - /// - /// Unblock an existing domain from the list of blocked domains Unblocks an existing domain from the list of blocked domains - /// - /// Thrown when fails to make API call - /// The name of the domain to be deleted - /// - public void DeleteBlockedDomain (string domain) - { - DeleteBlockedDomainWithHttpInfo(domain); - } - - /// - /// Unblock an existing domain from the list of blocked domains Unblocks an existing domain from the list of blocked domains - /// - /// Thrown when fails to make API call - /// The name of the domain to be deleted - /// ApiResponse of Object(void) - public ApiResponse DeleteBlockedDomainWithHttpInfo (string domain) - { - // verify the required parameter 'domain' is set - if (domain == null) - throw new ApiException(400, "Missing required parameter 'domain' when calling TransactionalEmailsApi->DeleteBlockedDomain"); - - var localVarPath = "./smtp/blockedDomains/{domain}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (domain != null) localVarPathParams.Add("domain", this.Configuration.ApiClient.ParameterToString(domain)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteBlockedDomain", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Unblock an existing domain from the list of blocked domains Unblocks an existing domain from the list of blocked domains - /// - /// Thrown when fails to make API call - /// The name of the domain to be deleted - /// Task of void - public async System.Threading.Tasks.Task DeleteBlockedDomainAsync (string domain) - { - await DeleteBlockedDomainAsyncWithHttpInfo(domain); - - } - - /// - /// Unblock an existing domain from the list of blocked domains Unblocks an existing domain from the list of blocked domains - /// - /// Thrown when fails to make API call - /// The name of the domain to be deleted - /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeleteBlockedDomainAsyncWithHttpInfo (string domain) - { - // verify the required parameter 'domain' is set - if (domain == null) - throw new ApiException(400, "Missing required parameter 'domain' when calling TransactionalEmailsApi->DeleteBlockedDomain"); - - var localVarPath = "./smtp/blockedDomains/{domain}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (domain != null) localVarPathParams.Add("domain", this.Configuration.ApiClient.ParameterToString(domain)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteBlockedDomain", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete hardbounces Delete hardbounces. To use carefully (e.g. in case of temporary ISP failures) - /// - /// Thrown when fails to make API call - /// values to delete hardbounces (optional) - /// - public void DeleteHardbounces (DeleteHardbounces deleteHardbounces = null) - { - DeleteHardbouncesWithHttpInfo(deleteHardbounces); - } - - /// - /// Delete hardbounces Delete hardbounces. To use carefully (e.g. in case of temporary ISP failures) - /// - /// Thrown when fails to make API call - /// values to delete hardbounces (optional) - /// ApiResponse of Object(void) - public ApiResponse DeleteHardbouncesWithHttpInfo (DeleteHardbounces deleteHardbounces = null) - { - - var localVarPath = "./smtp/deleteHardbounces"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (deleteHardbounces != null && deleteHardbounces.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(deleteHardbounces); // http body (model) parameter - } - else - { - localVarPostBody = deleteHardbounces; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteHardbounces", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete hardbounces Delete hardbounces. To use carefully (e.g. in case of temporary ISP failures) - /// - /// Thrown when fails to make API call - /// values to delete hardbounces (optional) - /// Task of void - public async System.Threading.Tasks.Task DeleteHardbouncesAsync (DeleteHardbounces deleteHardbounces = null) - { - await DeleteHardbouncesAsyncWithHttpInfo(deleteHardbounces); - - } - - /// - /// Delete hardbounces Delete hardbounces. To use carefully (e.g. in case of temporary ISP failures) - /// - /// Thrown when fails to make API call - /// values to delete hardbounces (optional) - /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeleteHardbouncesAsyncWithHttpInfo (DeleteHardbounces deleteHardbounces = null) - { - - var localVarPath = "./smtp/deleteHardbounces"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (deleteHardbounces != null && deleteHardbounces.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(deleteHardbounces); // http body (model) parameter - } - else - { - localVarPostBody = deleteHardbounces; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteHardbounces", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete scheduled emails by batchId or messageId Delete scheduled batch of emails by batchId or single scheduled email by messageId - /// - /// Thrown when fails to make API call - /// The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. - /// - public void DeleteScheduledEmailById (string identifier) - { - DeleteScheduledEmailByIdWithHttpInfo(identifier); - } - - /// - /// Delete scheduled emails by batchId or messageId Delete scheduled batch of emails by batchId or single scheduled email by messageId - /// - /// Thrown when fails to make API call - /// The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. - /// ApiResponse of Object(void) - public ApiResponse DeleteScheduledEmailByIdWithHttpInfo (string identifier) - { - // verify the required parameter 'identifier' is set - if (identifier == null) - throw new ApiException(400, "Missing required parameter 'identifier' when calling TransactionalEmailsApi->DeleteScheduledEmailById"); - - var localVarPath = "./smtp/email/{identifier}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (identifier != null) localVarPathParams.Add("identifier", this.Configuration.ApiClient.ParameterToString(identifier)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteScheduledEmailById", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete scheduled emails by batchId or messageId Delete scheduled batch of emails by batchId or single scheduled email by messageId - /// - /// Thrown when fails to make API call - /// The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. - /// Task of void - public async System.Threading.Tasks.Task DeleteScheduledEmailByIdAsync (string identifier) - { - await DeleteScheduledEmailByIdAsyncWithHttpInfo(identifier); - - } - - /// - /// Delete scheduled emails by batchId or messageId Delete scheduled batch of emails by batchId or single scheduled email by messageId - /// - /// Thrown when fails to make API call - /// The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. - /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeleteScheduledEmailByIdAsyncWithHttpInfo (string identifier) - { - // verify the required parameter 'identifier' is set - if (identifier == null) - throw new ApiException(400, "Missing required parameter 'identifier' when calling TransactionalEmailsApi->DeleteScheduledEmailById"); - - var localVarPath = "./smtp/email/{identifier}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (identifier != null) localVarPathParams.Add("identifier", this.Configuration.ApiClient.ParameterToString(identifier)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteScheduledEmailById", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete an inactive email template - /// - /// Thrown when fails to make API call - /// id of the template - /// - public void DeleteSmtpTemplate (long? templateId) - { - DeleteSmtpTemplateWithHttpInfo(templateId); - } - - /// - /// Delete an inactive email template - /// - /// Thrown when fails to make API call - /// id of the template - /// ApiResponse of Object(void) - public ApiResponse DeleteSmtpTemplateWithHttpInfo (long? templateId) - { - // verify the required parameter 'templateId' is set - if (templateId == null) - throw new ApiException(400, "Missing required parameter 'templateId' when calling TransactionalEmailsApi->DeleteSmtpTemplate"); - - var localVarPath = "./smtp/templates/{templateId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (templateId != null) localVarPathParams.Add("templateId", this.Configuration.ApiClient.ParameterToString(templateId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteSmtpTemplate", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete an inactive email template - /// - /// Thrown when fails to make API call - /// id of the template - /// Task of void - public async System.Threading.Tasks.Task DeleteSmtpTemplateAsync (long? templateId) - { - await DeleteSmtpTemplateAsyncWithHttpInfo(templateId); - - } - - /// - /// Delete an inactive email template - /// - /// Thrown when fails to make API call - /// id of the template - /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeleteSmtpTemplateAsyncWithHttpInfo (long? templateId) - { - // verify the required parameter 'templateId' is set - if (templateId == null) - throw new ApiException(400, "Missing required parameter 'templateId' when calling TransactionalEmailsApi->DeleteSmtpTemplate"); - - var localVarPath = "./smtp/templates/{templateId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (templateId != null) localVarPathParams.Add("templateId", this.Configuration.ApiClient.ParameterToString(templateId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteSmtpTemplate", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Get your transactional email activity aggregated over a period of time This endpoint will show the aggregated stats for past 90 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) - /// Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Tag of the emails (optional) - /// GetAggregatedReport - public GetAggregatedReport GetAggregatedSmtpReport (string startDate = null, string endDate = null, long? days = null, string tag = null) - { - ApiResponse localVarResponse = GetAggregatedSmtpReportWithHttpInfo(startDate, endDate, days, tag); - return localVarResponse.Data; - } - - /// - /// Get your transactional email activity aggregated over a period of time This endpoint will show the aggregated stats for past 90 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) - /// Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Tag of the emails (optional) - /// ApiResponse of GetAggregatedReport - public ApiResponse< GetAggregatedReport > GetAggregatedSmtpReportWithHttpInfo (string startDate = null, string endDate = null, long? days = null, string tag = null) - { - - var localVarPath = "./smtp/statistics/aggregatedReport"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - if (days != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "days", days)); // query parameter - if (tag != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "tag", tag)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetAggregatedSmtpReport", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetAggregatedReport) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetAggregatedReport))); - } - - /// - /// Get your transactional email activity aggregated over a period of time This endpoint will show the aggregated stats for past 90 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) - /// Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Tag of the emails (optional) - /// Task of GetAggregatedReport - public async System.Threading.Tasks.Task GetAggregatedSmtpReportAsync (string startDate = null, string endDate = null, long? days = null, string tag = null) - { - ApiResponse localVarResponse = await GetAggregatedSmtpReportAsyncWithHttpInfo(startDate, endDate, days, tag); - return localVarResponse.Data; - - } - - /// - /// Get your transactional email activity aggregated over a period of time This endpoint will show the aggregated stats for past 90 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) - /// Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Tag of the emails (optional) - /// Task of ApiResponse (GetAggregatedReport) - public async System.Threading.Tasks.Task> GetAggregatedSmtpReportAsyncWithHttpInfo (string startDate = null, string endDate = null, long? days = null, string tag = null) - { - - var localVarPath = "./smtp/statistics/aggregatedReport"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - if (days != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "days", days)); // query parameter - if (tag != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "tag", tag)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetAggregatedSmtpReport", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetAggregatedReport) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetAggregatedReport))); - } - - /// - /// Get the list of blocked domains Get the list of blocked domains - /// - /// Thrown when fails to make API call - /// GetBlockedDomains - public GetBlockedDomains GetBlockedDomains () - { - ApiResponse localVarResponse = GetBlockedDomainsWithHttpInfo(); - return localVarResponse.Data; - } - - /// - /// Get the list of blocked domains Get the list of blocked domains - /// - /// Thrown when fails to make API call - /// ApiResponse of GetBlockedDomains - public ApiResponse< GetBlockedDomains > GetBlockedDomainsWithHttpInfo () - { - - var localVarPath = "./smtp/blockedDomains"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetBlockedDomains", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetBlockedDomains) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetBlockedDomains))); - } - - /// - /// Get the list of blocked domains Get the list of blocked domains - /// - /// Thrown when fails to make API call - /// Task of GetBlockedDomains - public async System.Threading.Tasks.Task GetBlockedDomainsAsync () - { - ApiResponse localVarResponse = await GetBlockedDomainsAsyncWithHttpInfo(); - return localVarResponse.Data; - - } - - /// - /// Get the list of blocked domains Get the list of blocked domains - /// - /// Thrown when fails to make API call - /// Task of ApiResponse (GetBlockedDomains) - public async System.Threading.Tasks.Task> GetBlockedDomainsAsyncWithHttpInfo () - { - - var localVarPath = "./smtp/blockedDomains"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetBlockedDomains", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetBlockedDomains) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetBlockedDomains))); - } - - /// - /// Get all your transactional email activity (unaggregated events) This endpoint will show the aggregated stats for past 30 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days - /// - /// Thrown when fails to make API call - /// Number limitation for the result returned (optional, default to 2500) - /// Beginning point in the list to retrieve from. (optional, default to 0) - /// Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) - /// Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Filter the report for a specific email addresses (optional) - /// Filter the report for a specific event type (optional) - /// Filter the report for tags (serialized and urlencoded array) (optional) - /// Filter on a specific message id (optional) - /// Filter on a specific template id (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// GetEmailEventReport - public GetEmailEventReport GetEmailEventReport (long? limit = null, long? offset = null, string startDate = null, string endDate = null, long? days = null, string email = null, string _event = null, string tags = null, string messageId = null, long? templateId = null, string sort = null) - { - ApiResponse localVarResponse = GetEmailEventReportWithHttpInfo(limit, offset, startDate, endDate, days, email, _event, tags, messageId, templateId, sort); - return localVarResponse.Data; - } - - /// - /// Get all your transactional email activity (unaggregated events) This endpoint will show the aggregated stats for past 30 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days - /// - /// Thrown when fails to make API call - /// Number limitation for the result returned (optional, default to 2500) - /// Beginning point in the list to retrieve from. (optional, default to 0) - /// Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) - /// Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Filter the report for a specific email addresses (optional) - /// Filter the report for a specific event type (optional) - /// Filter the report for tags (serialized and urlencoded array) (optional) - /// Filter on a specific message id (optional) - /// Filter on a specific template id (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// ApiResponse of GetEmailEventReport - public ApiResponse< GetEmailEventReport > GetEmailEventReportWithHttpInfo (long? limit = null, long? offset = null, string startDate = null, string endDate = null, long? days = null, string email = null, string _event = null, string tags = null, string messageId = null, long? templateId = null, string sort = null) - { - - var localVarPath = "./smtp/statistics/events"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - if (days != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "days", days)); // query parameter - if (email != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "email", email)); // query parameter - if (_event != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "event", _event)); // query parameter - if (tags != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "tags", tags)); // query parameter - if (messageId != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "messageId", messageId)); // query parameter - if (templateId != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "templateId", templateId)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetEmailEventReport", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetEmailEventReport) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetEmailEventReport))); - } - - /// - /// Get all your transactional email activity (unaggregated events) This endpoint will show the aggregated stats for past 30 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days - /// - /// Thrown when fails to make API call - /// Number limitation for the result returned (optional, default to 2500) - /// Beginning point in the list to retrieve from. (optional, default to 0) - /// Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) - /// Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Filter the report for a specific email addresses (optional) - /// Filter the report for a specific event type (optional) - /// Filter the report for tags (serialized and urlencoded array) (optional) - /// Filter on a specific message id (optional) - /// Filter on a specific template id (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of GetEmailEventReport - public async System.Threading.Tasks.Task GetEmailEventReportAsync (long? limit = null, long? offset = null, string startDate = null, string endDate = null, long? days = null, string email = null, string _event = null, string tags = null, string messageId = null, long? templateId = null, string sort = null) - { - ApiResponse localVarResponse = await GetEmailEventReportAsyncWithHttpInfo(limit, offset, startDate, endDate, days, email, _event, tags, messageId, templateId, sort); - return localVarResponse.Data; - - } - - /// - /// Get all your transactional email activity (unaggregated events) This endpoint will show the aggregated stats for past 30 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days - /// - /// Thrown when fails to make API call - /// Number limitation for the result returned (optional, default to 2500) - /// Beginning point in the list to retrieve from. (optional, default to 0) - /// Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) - /// Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Filter the report for a specific email addresses (optional) - /// Filter the report for a specific event type (optional) - /// Filter the report for tags (serialized and urlencoded array) (optional) - /// Filter on a specific message id (optional) - /// Filter on a specific template id (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of ApiResponse (GetEmailEventReport) - public async System.Threading.Tasks.Task> GetEmailEventReportAsyncWithHttpInfo (long? limit = null, long? offset = null, string startDate = null, string endDate = null, long? days = null, string email = null, string _event = null, string tags = null, string messageId = null, long? templateId = null, string sort = null) - { - - var localVarPath = "./smtp/statistics/events"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - if (days != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "days", days)); // query parameter - if (email != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "email", email)); // query parameter - if (_event != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "event", _event)); // query parameter - if (tags != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "tags", tags)); // query parameter - if (messageId != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "messageId", messageId)); // query parameter - if (templateId != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "templateId", templateId)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetEmailEventReport", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetEmailEventReport) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetEmailEventReport))); - } - - /// - /// Fetch scheduled emails by batchId Fetch scheduled batch of emails by batchId (Can retrieve data upto 30 days old) - /// - /// Thrown when fails to make API call - /// The batchId of scheduled emails batch (Should be a valid UUIDv4) - /// Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional) - /// Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Filter the records by `status` of the scheduled email batch or message. (optional) - /// Number of documents returned per page (optional, default to 100) - /// Index of the first document on the page (optional, default to 0) - /// GetScheduledEmailByBatchId - public GetScheduledEmailByBatchId GetScheduledEmailByBatchId (string batchId, DateTime? startDate = null, DateTime? endDate = null, string sort = null, string status = null, long? limit = null, long? offset = null) - { - ApiResponse localVarResponse = GetScheduledEmailByBatchIdWithHttpInfo(batchId, startDate, endDate, sort, status, limit, offset); - return localVarResponse.Data; - } - - /// - /// Fetch scheduled emails by batchId Fetch scheduled batch of emails by batchId (Can retrieve data upto 30 days old) - /// - /// Thrown when fails to make API call - /// The batchId of scheduled emails batch (Should be a valid UUIDv4) - /// Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional) - /// Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Filter the records by `status` of the scheduled email batch or message. (optional) - /// Number of documents returned per page (optional, default to 100) - /// Index of the first document on the page (optional, default to 0) - /// ApiResponse of GetScheduledEmailByBatchId - public ApiResponse< GetScheduledEmailByBatchId > GetScheduledEmailByBatchIdWithHttpInfo (string batchId, DateTime? startDate = null, DateTime? endDate = null, string sort = null, string status = null, long? limit = null, long? offset = null) - { - // verify the required parameter 'batchId' is set - if (batchId == null) - throw new ApiException(400, "Missing required parameter 'batchId' when calling TransactionalEmailsApi->GetScheduledEmailByBatchId"); - - var localVarPath = "./smtp/emailStatus/{batchId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (batchId != null) localVarPathParams.Add("batchId", this.Configuration.ApiClient.ParameterToString(batchId)); // path parameter - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - if (status != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "status", status)); // query parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetScheduledEmailByBatchId", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetScheduledEmailByBatchId) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetScheduledEmailByBatchId))); - } - - /// - /// Fetch scheduled emails by batchId Fetch scheduled batch of emails by batchId (Can retrieve data upto 30 days old) - /// - /// Thrown when fails to make API call - /// The batchId of scheduled emails batch (Should be a valid UUIDv4) - /// Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional) - /// Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Filter the records by `status` of the scheduled email batch or message. (optional) - /// Number of documents returned per page (optional, default to 100) - /// Index of the first document on the page (optional, default to 0) - /// Task of GetScheduledEmailByBatchId - public async System.Threading.Tasks.Task GetScheduledEmailByBatchIdAsync (string batchId, DateTime? startDate = null, DateTime? endDate = null, string sort = null, string status = null, long? limit = null, long? offset = null) - { - ApiResponse localVarResponse = await GetScheduledEmailByBatchIdAsyncWithHttpInfo(batchId, startDate, endDate, sort, status, limit, offset); - return localVarResponse.Data; - - } - - /// - /// Fetch scheduled emails by batchId Fetch scheduled batch of emails by batchId (Can retrieve data upto 30 days old) - /// - /// Thrown when fails to make API call - /// The batchId of scheduled emails batch (Should be a valid UUIDv4) - /// Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional) - /// Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Filter the records by `status` of the scheduled email batch or message. (optional) - /// Number of documents returned per page (optional, default to 100) - /// Index of the first document on the page (optional, default to 0) - /// Task of ApiResponse (GetScheduledEmailByBatchId) - public async System.Threading.Tasks.Task> GetScheduledEmailByBatchIdAsyncWithHttpInfo (string batchId, DateTime? startDate = null, DateTime? endDate = null, string sort = null, string status = null, long? limit = null, long? offset = null) - { - // verify the required parameter 'batchId' is set - if (batchId == null) - throw new ApiException(400, "Missing required parameter 'batchId' when calling TransactionalEmailsApi->GetScheduledEmailByBatchId"); - - var localVarPath = "./smtp/emailStatus/{batchId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (batchId != null) localVarPathParams.Add("batchId", this.Configuration.ApiClient.ParameterToString(batchId)); // path parameter - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - if (status != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "status", status)); // query parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetScheduledEmailByBatchId", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetScheduledEmailByBatchId) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetScheduledEmailByBatchId))); - } - - /// - /// Fetch scheduled email by messageId Fetch scheduled email by messageId (Can retrieve data upto 30 days old) - /// - /// Thrown when fails to make API call - /// The messageId of scheduled email - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// GetScheduledEmailByMessageId - public GetScheduledEmailByMessageId GetScheduledEmailByMessageId (string messageId, DateTime? startDate = null, DateTime? endDate = null) - { - ApiResponse localVarResponse = GetScheduledEmailByMessageIdWithHttpInfo(messageId, startDate, endDate); - return localVarResponse.Data; - } - - /// - /// Fetch scheduled email by messageId Fetch scheduled email by messageId (Can retrieve data upto 30 days old) - /// - /// Thrown when fails to make API call - /// The messageId of scheduled email - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// ApiResponse of GetScheduledEmailByMessageId - public ApiResponse< GetScheduledEmailByMessageId > GetScheduledEmailByMessageIdWithHttpInfo (string messageId, DateTime? startDate = null, DateTime? endDate = null) - { - // verify the required parameter 'messageId' is set - if (messageId == null) - throw new ApiException(400, "Missing required parameter 'messageId' when calling TransactionalEmailsApi->GetScheduledEmailByMessageId"); - - var localVarPath = "./smtp/emailStatus/{messageId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (messageId != null) localVarPathParams.Add("messageId", this.Configuration.ApiClient.ParameterToString(messageId)); // path parameter - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetScheduledEmailByMessageId", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetScheduledEmailByMessageId) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetScheduledEmailByMessageId))); - } - - /// - /// Fetch scheduled email by messageId Fetch scheduled email by messageId (Can retrieve data upto 30 days old) - /// - /// Thrown when fails to make API call - /// The messageId of scheduled email - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Task of GetScheduledEmailByMessageId - public async System.Threading.Tasks.Task GetScheduledEmailByMessageIdAsync (string messageId, DateTime? startDate = null, DateTime? endDate = null) - { - ApiResponse localVarResponse = await GetScheduledEmailByMessageIdAsyncWithHttpInfo(messageId, startDate, endDate); - return localVarResponse.Data; - - } - - /// - /// Fetch scheduled email by messageId Fetch scheduled email by messageId (Can retrieve data upto 30 days old) - /// - /// Thrown when fails to make API call - /// The messageId of scheduled email - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Task of ApiResponse (GetScheduledEmailByMessageId) - public async System.Threading.Tasks.Task> GetScheduledEmailByMessageIdAsyncWithHttpInfo (string messageId, DateTime? startDate = null, DateTime? endDate = null) - { - // verify the required parameter 'messageId' is set - if (messageId == null) - throw new ApiException(400, "Missing required parameter 'messageId' when calling TransactionalEmailsApi->GetScheduledEmailByMessageId"); - - var localVarPath = "./smtp/emailStatus/{messageId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (messageId != null) localVarPathParams.Add("messageId", this.Configuration.ApiClient.ParameterToString(messageId)); // path parameter - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetScheduledEmailByMessageId", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetScheduledEmailByMessageId) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetScheduledEmailByMessageId))); - } - - /// - /// Get your transactional email activity aggregated per day - /// - /// Thrown when fails to make API call - /// Number of documents returned per page (optional, default to 10) - /// Index of the first document on the page (optional, default to 0) - /// Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional) - /// Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Tag of the emails (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// GetReports - public GetReports GetSmtpReport (long? limit = null, long? offset = null, string startDate = null, string endDate = null, long? days = null, string tag = null, string sort = null) - { - ApiResponse localVarResponse = GetSmtpReportWithHttpInfo(limit, offset, startDate, endDate, days, tag, sort); - return localVarResponse.Data; - } - - /// - /// Get your transactional email activity aggregated per day - /// - /// Thrown when fails to make API call - /// Number of documents returned per page (optional, default to 10) - /// Index of the first document on the page (optional, default to 0) - /// Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional) - /// Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Tag of the emails (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// ApiResponse of GetReports - public ApiResponse< GetReports > GetSmtpReportWithHttpInfo (long? limit = null, long? offset = null, string startDate = null, string endDate = null, long? days = null, string tag = null, string sort = null) - { - - var localVarPath = "./smtp/statistics/reports"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - if (days != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "days", days)); // query parameter - if (tag != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "tag", tag)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetSmtpReport", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetReports) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetReports))); - } - - /// - /// Get your transactional email activity aggregated per day - /// - /// Thrown when fails to make API call - /// Number of documents returned per page (optional, default to 10) - /// Index of the first document on the page (optional, default to 0) - /// Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional) - /// Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Tag of the emails (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of GetReports - public async System.Threading.Tasks.Task GetSmtpReportAsync (long? limit = null, long? offset = null, string startDate = null, string endDate = null, long? days = null, string tag = null, string sort = null) - { - ApiResponse localVarResponse = await GetSmtpReportAsyncWithHttpInfo(limit, offset, startDate, endDate, days, tag, sort); - return localVarResponse.Data; - - } - - /// - /// Get your transactional email activity aggregated per day - /// - /// Thrown when fails to make API call - /// Number of documents returned per page (optional, default to 10) - /// Index of the first document on the page (optional, default to 0) - /// Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional) - /// Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Tag of the emails (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of ApiResponse (GetReports) - public async System.Threading.Tasks.Task> GetSmtpReportAsyncWithHttpInfo (long? limit = null, long? offset = null, string startDate = null, string endDate = null, long? days = null, string tag = null, string sort = null) - { - - var localVarPath = "./smtp/statistics/reports"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - if (days != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "days", days)); // query parameter - if (tag != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "tag", tag)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetSmtpReport", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetReports) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetReports))); - } - - /// - /// Returns the template information - /// - /// Thrown when fails to make API call - /// id of the template - /// GetSmtpTemplateOverview - public GetSmtpTemplateOverview GetSmtpTemplate (long? templateId) - { - ApiResponse localVarResponse = GetSmtpTemplateWithHttpInfo(templateId); - return localVarResponse.Data; - } - - /// - /// Returns the template information - /// - /// Thrown when fails to make API call - /// id of the template - /// ApiResponse of GetSmtpTemplateOverview - public ApiResponse< GetSmtpTemplateOverview > GetSmtpTemplateWithHttpInfo (long? templateId) - { - // verify the required parameter 'templateId' is set - if (templateId == null) - throw new ApiException(400, "Missing required parameter 'templateId' when calling TransactionalEmailsApi->GetSmtpTemplate"); - - var localVarPath = "./smtp/templates/{templateId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (templateId != null) localVarPathParams.Add("templateId", this.Configuration.ApiClient.ParameterToString(templateId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetSmtpTemplate", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetSmtpTemplateOverview) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSmtpTemplateOverview))); - } - - /// - /// Returns the template information - /// - /// Thrown when fails to make API call - /// id of the template - /// Task of GetSmtpTemplateOverview - public async System.Threading.Tasks.Task GetSmtpTemplateAsync (long? templateId) - { - ApiResponse localVarResponse = await GetSmtpTemplateAsyncWithHttpInfo(templateId); - return localVarResponse.Data; - - } - - /// - /// Returns the template information - /// - /// Thrown when fails to make API call - /// id of the template - /// Task of ApiResponse (GetSmtpTemplateOverview) - public async System.Threading.Tasks.Task> GetSmtpTemplateAsyncWithHttpInfo (long? templateId) - { - // verify the required parameter 'templateId' is set - if (templateId == null) - throw new ApiException(400, "Missing required parameter 'templateId' when calling TransactionalEmailsApi->GetSmtpTemplate"); - - var localVarPath = "./smtp/templates/{templateId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (templateId != null) localVarPathParams.Add("templateId", this.Configuration.ApiClient.ParameterToString(templateId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetSmtpTemplate", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetSmtpTemplateOverview) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSmtpTemplateOverview))); - } - - /// - /// Get the list of email templates - /// - /// Thrown when fails to make API call - /// Filter on the status of the template. Active = true, inactive = false (optional) - /// Number of documents returned per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// GetSmtpTemplates - public GetSmtpTemplates GetSmtpTemplates (bool? templateStatus = null, long? limit = null, long? offset = null, string sort = null) - { - ApiResponse localVarResponse = GetSmtpTemplatesWithHttpInfo(templateStatus, limit, offset, sort); - return localVarResponse.Data; - } - - /// - /// Get the list of email templates - /// - /// Thrown when fails to make API call - /// Filter on the status of the template. Active = true, inactive = false (optional) - /// Number of documents returned per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// ApiResponse of GetSmtpTemplates - public ApiResponse< GetSmtpTemplates > GetSmtpTemplatesWithHttpInfo (bool? templateStatus = null, long? limit = null, long? offset = null, string sort = null) - { - - var localVarPath = "./smtp/templates"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (templateStatus != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "templateStatus", templateStatus)); // query parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetSmtpTemplates", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetSmtpTemplates) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSmtpTemplates))); - } - - /// - /// Get the list of email templates - /// - /// Thrown when fails to make API call - /// Filter on the status of the template. Active = true, inactive = false (optional) - /// Number of documents returned per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of GetSmtpTemplates - public async System.Threading.Tasks.Task GetSmtpTemplatesAsync (bool? templateStatus = null, long? limit = null, long? offset = null, string sort = null) - { - ApiResponse localVarResponse = await GetSmtpTemplatesAsyncWithHttpInfo(templateStatus, limit, offset, sort); - return localVarResponse.Data; - - } - - /// - /// Get the list of email templates - /// - /// Thrown when fails to make API call - /// Filter on the status of the template. Active = true, inactive = false (optional) - /// Number of documents returned per page (optional, default to 50) - /// Index of the first document in the page (optional, default to 0) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of ApiResponse (GetSmtpTemplates) - public async System.Threading.Tasks.Task> GetSmtpTemplatesAsyncWithHttpInfo (bool? templateStatus = null, long? limit = null, long? offset = null, string sort = null) - { - - var localVarPath = "./smtp/templates"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (templateStatus != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "templateStatus", templateStatus)); // query parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetSmtpTemplates", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetSmtpTemplates) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSmtpTemplates))); - } - - /// - /// Get the list of blocked or unsubscribed transactional contacts - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts (optional) - /// Number of documents returned per page (optional, default to 50) - /// Index of the first document on the page (optional, default to 0) - /// Comma separated list of emails of the senders from which contacts are blocked or unsubscribed (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// GetTransacBlockedContacts - public GetTransacBlockedContacts GetTransacBlockedContacts (string startDate = null, string endDate = null, long? limit = null, long? offset = null, List senders = null, string sort = null) - { - ApiResponse localVarResponse = GetTransacBlockedContactsWithHttpInfo(startDate, endDate, limit, offset, senders, sort); - return localVarResponse.Data; - } - - /// - /// Get the list of blocked or unsubscribed transactional contacts - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts (optional) - /// Number of documents returned per page (optional, default to 50) - /// Index of the first document on the page (optional, default to 0) - /// Comma separated list of emails of the senders from which contacts are blocked or unsubscribed (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// ApiResponse of GetTransacBlockedContacts - public ApiResponse< GetTransacBlockedContacts > GetTransacBlockedContactsWithHttpInfo (string startDate = null, string endDate = null, long? limit = null, long? offset = null, List senders = null, string sort = null) - { - - var localVarPath = "./smtp/blockedContacts"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (senders != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "senders", senders)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetTransacBlockedContacts", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetTransacBlockedContacts) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetTransacBlockedContacts))); - } - - /// - /// Get the list of blocked or unsubscribed transactional contacts - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts (optional) - /// Number of documents returned per page (optional, default to 50) - /// Index of the first document on the page (optional, default to 0) - /// Comma separated list of emails of the senders from which contacts are blocked or unsubscribed (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of GetTransacBlockedContacts - public async System.Threading.Tasks.Task GetTransacBlockedContactsAsync (string startDate = null, string endDate = null, long? limit = null, long? offset = null, List senders = null, string sort = null) - { - ApiResponse localVarResponse = await GetTransacBlockedContactsAsyncWithHttpInfo(startDate, endDate, limit, offset, senders, sort); - return localVarResponse.Data; - - } - - /// - /// Get the list of blocked or unsubscribed transactional contacts - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts (optional) - /// Number of documents returned per page (optional, default to 50) - /// Index of the first document on the page (optional, default to 0) - /// Comma separated list of emails of the senders from which contacts are blocked or unsubscribed (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of ApiResponse (GetTransacBlockedContacts) - public async System.Threading.Tasks.Task> GetTransacBlockedContactsAsyncWithHttpInfo (string startDate = null, string endDate = null, long? limit = null, long? offset = null, List senders = null, string sort = null) - { - - var localVarPath = "./smtp/blockedContacts"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (senders != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "senders", senders)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetTransacBlockedContacts", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetTransacBlockedContacts) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetTransacBlockedContacts))); - } - - /// - /// Get the personalized content of a sent transactional email - /// - /// Thrown when fails to make API call - /// Unique id of the transactional email that has been sent to a particular contact - /// GetTransacEmailContent - public GetTransacEmailContent GetTransacEmailContent (string uuid) - { - ApiResponse localVarResponse = GetTransacEmailContentWithHttpInfo(uuid); - return localVarResponse.Data; - } - - /// - /// Get the personalized content of a sent transactional email - /// - /// Thrown when fails to make API call - /// Unique id of the transactional email that has been sent to a particular contact - /// ApiResponse of GetTransacEmailContent - public ApiResponse< GetTransacEmailContent > GetTransacEmailContentWithHttpInfo (string uuid) - { - // verify the required parameter 'uuid' is set - if (uuid == null) - throw new ApiException(400, "Missing required parameter 'uuid' when calling TransactionalEmailsApi->GetTransacEmailContent"); - - var localVarPath = "./smtp/emails/{uuid}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (uuid != null) localVarPathParams.Add("uuid", this.Configuration.ApiClient.ParameterToString(uuid)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetTransacEmailContent", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetTransacEmailContent) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetTransacEmailContent))); - } - - /// - /// Get the personalized content of a sent transactional email - /// - /// Thrown when fails to make API call - /// Unique id of the transactional email that has been sent to a particular contact - /// Task of GetTransacEmailContent - public async System.Threading.Tasks.Task GetTransacEmailContentAsync (string uuid) - { - ApiResponse localVarResponse = await GetTransacEmailContentAsyncWithHttpInfo(uuid); - return localVarResponse.Data; - - } - - /// - /// Get the personalized content of a sent transactional email - /// - /// Thrown when fails to make API call - /// Unique id of the transactional email that has been sent to a particular contact - /// Task of ApiResponse (GetTransacEmailContent) - public async System.Threading.Tasks.Task> GetTransacEmailContentAsyncWithHttpInfo (string uuid) - { - // verify the required parameter 'uuid' is set - if (uuid == null) - throw new ApiException(400, "Missing required parameter 'uuid' when calling TransactionalEmailsApi->GetTransacEmailContent"); - - var localVarPath = "./smtp/emails/{uuid}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (uuid != null) localVarPathParams.Add("uuid", this.Configuration.ApiClient.ParameterToString(uuid)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetTransacEmailContent", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetTransacEmailContent) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetTransacEmailContent))); - } - - /// - /// Get the list of transactional emails on the basis of allowed filters This endpoint will show the list of emails for past 30 days by default. To retrieve emails before that time, please pass startDate and endDate in query filters. - /// - /// Thrown when fails to make API call - /// Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. (optional) - /// Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. (optional) - /// Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. (optional) - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Number of documents returned per page (optional, default to 500) - /// Index of the first document in the page (optional, default to 0) - /// GetTransacEmailsList - public GetTransacEmailsList GetTransacEmailsList (string email = null, long? templateId = null, string messageId = null, string startDate = null, string endDate = null, string sort = null, long? limit = null, long? offset = null) - { - ApiResponse localVarResponse = GetTransacEmailsListWithHttpInfo(email, templateId, messageId, startDate, endDate, sort, limit, offset); - return localVarResponse.Data; - } - - /// - /// Get the list of transactional emails on the basis of allowed filters This endpoint will show the list of emails for past 30 days by default. To retrieve emails before that time, please pass startDate and endDate in query filters. - /// - /// Thrown when fails to make API call - /// Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. (optional) - /// Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. (optional) - /// Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. (optional) - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Number of documents returned per page (optional, default to 500) - /// Index of the first document in the page (optional, default to 0) - /// ApiResponse of GetTransacEmailsList - public ApiResponse< GetTransacEmailsList > GetTransacEmailsListWithHttpInfo (string email = null, long? templateId = null, string messageId = null, string startDate = null, string endDate = null, string sort = null, long? limit = null, long? offset = null) - { - - var localVarPath = "./smtp/emails"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (email != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "email", email)); // query parameter - if (templateId != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "templateId", templateId)); // query parameter - if (messageId != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "messageId", messageId)); // query parameter - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetTransacEmailsList", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetTransacEmailsList) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetTransacEmailsList))); - } - - /// - /// Get the list of transactional emails on the basis of allowed filters This endpoint will show the list of emails for past 30 days by default. To retrieve emails before that time, please pass startDate and endDate in query filters. - /// - /// Thrown when fails to make API call - /// Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. (optional) - /// Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. (optional) - /// Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. (optional) - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Number of documents returned per page (optional, default to 500) - /// Index of the first document in the page (optional, default to 0) - /// Task of GetTransacEmailsList - public async System.Threading.Tasks.Task GetTransacEmailsListAsync (string email = null, long? templateId = null, string messageId = null, string startDate = null, string endDate = null, string sort = null, long? limit = null, long? offset = null) - { - ApiResponse localVarResponse = await GetTransacEmailsListAsyncWithHttpInfo(email, templateId, messageId, startDate, endDate, sort, limit, offset); - return localVarResponse.Data; - - } - - /// - /// Get the list of transactional emails on the basis of allowed filters This endpoint will show the list of emails for past 30 days by default. To retrieve emails before that time, please pass startDate and endDate in query filters. - /// - /// Thrown when fails to make API call - /// Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. (optional) - /// Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. (optional) - /// Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. (optional) - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Number of documents returned per page (optional, default to 500) - /// Index of the first document in the page (optional, default to 0) - /// Task of ApiResponse (GetTransacEmailsList) - public async System.Threading.Tasks.Task> GetTransacEmailsListAsyncWithHttpInfo (string email = null, long? templateId = null, string messageId = null, string startDate = null, string endDate = null, string sort = null, long? limit = null, long? offset = null) - { - - var localVarPath = "./smtp/emails"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (email != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "email", email)); // query parameter - if (templateId != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "templateId", templateId)); // query parameter - if (messageId != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "messageId", messageId)); // query parameter - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetTransacEmailsList", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetTransacEmailsList) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetTransacEmailsList))); - } - - /// - /// Send a template to your test list - /// - /// Thrown when fails to make API call - /// Id of the template - /// - /// - public void SendTestTemplate (long? templateId, SendTestEmail sendTestEmail) - { - SendTestTemplateWithHttpInfo(templateId, sendTestEmail); - } - - /// - /// Send a template to your test list - /// - /// Thrown when fails to make API call - /// Id of the template - /// - /// ApiResponse of Object(void) - public ApiResponse SendTestTemplateWithHttpInfo (long? templateId, SendTestEmail sendTestEmail) - { - // verify the required parameter 'templateId' is set - if (templateId == null) - throw new ApiException(400, "Missing required parameter 'templateId' when calling TransactionalEmailsApi->SendTestTemplate"); - // verify the required parameter 'sendTestEmail' is set - if (sendTestEmail == null) - throw new ApiException(400, "Missing required parameter 'sendTestEmail' when calling TransactionalEmailsApi->SendTestTemplate"); - - var localVarPath = "./smtp/templates/{templateId}/sendTest"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (templateId != null) localVarPathParams.Add("templateId", this.Configuration.ApiClient.ParameterToString(templateId)); // path parameter - if (sendTestEmail != null && sendTestEmail.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(sendTestEmail); // http body (model) parameter - } - else - { - localVarPostBody = sendTestEmail; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("SendTestTemplate", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Send a template to your test list - /// - /// Thrown when fails to make API call - /// Id of the template - /// - /// Task of void - public async System.Threading.Tasks.Task SendTestTemplateAsync (long? templateId, SendTestEmail sendTestEmail) - { - await SendTestTemplateAsyncWithHttpInfo(templateId, sendTestEmail); - - } - - /// - /// Send a template to your test list - /// - /// Thrown when fails to make API call - /// Id of the template - /// - /// Task of ApiResponse - public async System.Threading.Tasks.Task> SendTestTemplateAsyncWithHttpInfo (long? templateId, SendTestEmail sendTestEmail) - { - // verify the required parameter 'templateId' is set - if (templateId == null) - throw new ApiException(400, "Missing required parameter 'templateId' when calling TransactionalEmailsApi->SendTestTemplate"); - // verify the required parameter 'sendTestEmail' is set - if (sendTestEmail == null) - throw new ApiException(400, "Missing required parameter 'sendTestEmail' when calling TransactionalEmailsApi->SendTestTemplate"); - - var localVarPath = "./smtp/templates/{templateId}/sendTest"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (templateId != null) localVarPathParams.Add("templateId", this.Configuration.ApiClient.ParameterToString(templateId)); // path parameter - if (sendTestEmail != null && sendTestEmail.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(sendTestEmail); // http body (model) parameter - } - else - { - localVarPostBody = sendTestEmail; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("SendTestTemplate", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Send a transactional email - /// - /// Thrown when fails to make API call - /// Values to send a transactional email - /// CreateSmtpEmail - public CreateSmtpEmail SendTransacEmail (SendSmtpEmail sendSmtpEmail) - { - ApiResponse localVarResponse = SendTransacEmailWithHttpInfo(sendSmtpEmail); - return localVarResponse.Data; - } - - /// - /// Send a transactional email - /// - /// Thrown when fails to make API call - /// Values to send a transactional email - /// ApiResponse of CreateSmtpEmail - public ApiResponse< CreateSmtpEmail > SendTransacEmailWithHttpInfo (SendSmtpEmail sendSmtpEmail) - { - // verify the required parameter 'sendSmtpEmail' is set - if (sendSmtpEmail == null) - throw new ApiException(400, "Missing required parameter 'sendSmtpEmail' when calling TransactionalEmailsApi->SendTransacEmail"); - - var localVarPath = "./smtp/email"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (sendSmtpEmail != null && sendSmtpEmail.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(sendSmtpEmail); // http body (model) parameter - } - else - { - localVarPostBody = sendSmtpEmail; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("SendTransacEmail", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateSmtpEmail) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateSmtpEmail))); - } +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using sib_api_v3_sdk.Client; +using sib_api_v3_sdk.Model; +namespace sib_api_v3_sdk.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface ITransactionalEmailsApi : IApiAccessor + { /// - /// Send a transactional email + /// Send a transactional email /// + /// + /// + /// /// Thrown when fails to make API call /// Values to send a transactional email /// Task of CreateSmtpEmail - public async System.Threading.Tasks.Task SendTransacEmailAsync (SendSmtpEmail sendSmtpEmail) - { - ApiResponse localVarResponse = await SendTransacEmailAsyncWithHttpInfo(sendSmtpEmail); - return localVarResponse.Data; + System.Threading.Tasks.Task SendTransacEmailAsync (SendSmtpEmail sendSmtpEmail); + } - } + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class TransactionalEmailsApi : ITransactionalEmailsApi + { + private sib_api_v3_sdk.Client.ExceptionFactory _exceptionFactory = (name, response) => null; /// - /// Send a transactional email + /// Initializes a new instance of the class. /// - /// Thrown when fails to make API call - /// Values to send a transactional email - /// Task of ApiResponse (CreateSmtpEmail) - public async System.Threading.Tasks.Task> SendTransacEmailAsyncWithHttpInfo (SendSmtpEmail sendSmtpEmail) + /// + public TransactionalEmailsApi(String basePath) { - // verify the required parameter 'sendSmtpEmail' is set - if (sendSmtpEmail == null) - throw new ApiException(400, "Missing required parameter 'sendSmtpEmail' when calling TransactionalEmailsApi->SendTransacEmail"); - - var localVarPath = "./smtp/email"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (sendSmtpEmail != null && sendSmtpEmail.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(sendSmtpEmail); // http body (model) parameter - } - else - { - localVarPostBody = sendSmtpEmail; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("SendTransacEmail", localVarResponse); - if (exception != null) throw exception; - } + this.Configuration = new sib_api_v3_sdk.Client.Configuration { BasePath = basePath }; - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateSmtpEmail) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateSmtpEmail))); + ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; } /// - /// Unblock or resubscribe a transactional contact + /// Initializes a new instance of the class + /// using Configuration object /// - /// Thrown when fails to make API call - /// contact email (urlencoded) to unblock. + /// An instance of Configuration /// - public void SmtpBlockedContactsEmailDelete (string email) - { - SmtpBlockedContactsEmailDeleteWithHttpInfo(email); - } - - /// - /// Unblock or resubscribe a transactional contact - /// - /// Thrown when fails to make API call - /// contact email (urlencoded) to unblock. - /// ApiResponse of Object(void) - public ApiResponse SmtpBlockedContactsEmailDeleteWithHttpInfo (string email) + public TransactionalEmailsApi(sib_api_v3_sdk.Client.Configuration configuration = null) { - // verify the required parameter 'email' is set - if (email == null) - throw new ApiException(400, "Missing required parameter 'email' when calling TransactionalEmailsApi->SmtpBlockedContactsEmailDelete"); - - var localVarPath = "./smtp/blockedContacts/{email}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (email != null) localVarPathParams.Add("email", this.Configuration.ApiClient.ParameterToString(email)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("SmtpBlockedContactsEmailDelete", localVarResponse); - if (exception != null) throw exception; - } + if (configuration == null) // use the default one in Configuration + this.Configuration = sib_api_v3_sdk.Client.Configuration.Default; + else + this.Configuration = configuration; - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); + ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; } /// - /// Unblock or resubscribe a transactional contact + /// Gets the base path of the API client. /// - /// Thrown when fails to make API call - /// contact email (urlencoded) to unblock. - /// Task of void - public async System.Threading.Tasks.Task SmtpBlockedContactsEmailDeleteAsync (string email) + /// The base path + public String GetBasePath() { - await SmtpBlockedContactsEmailDeleteAsyncWithHttpInfo(email); - + return this.Configuration.ApiClient.RestClient.BaseAddress.ToString(); } /// - /// Unblock or resubscribe a transactional contact + /// Sets the base path of the API client. /// - /// Thrown when fails to make API call - /// contact email (urlencoded) to unblock. - /// Task of ApiResponse - public async System.Threading.Tasks.Task> SmtpBlockedContactsEmailDeleteAsyncWithHttpInfo (string email) + /// The base path + [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] + public void SetBasePath(String basePath) { - // verify the required parameter 'email' is set - if (email == null) - throw new ApiException(400, "Missing required parameter 'email' when calling TransactionalEmailsApi->SmtpBlockedContactsEmailDelete"); - - var localVarPath = "./smtp/blockedContacts/{email}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (email != null) localVarPathParams.Add("email", this.Configuration.ApiClient.ParameterToString(email)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("SmtpBlockedContactsEmailDelete", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); + // do nothing } /// - /// Delete an SMTP transactional log + /// Gets or sets the configuration object /// - /// Thrown when fails to make API call - /// MessageId of the transactional log to delete - /// - public void SmtpLogMessageIdDelete (string messageId) - { - SmtpLogMessageIdDeleteWithHttpInfo(messageId); - } + /// An instance of the Configuration + public sib_api_v3_sdk.Client.Configuration Configuration {get; set;} /// - /// Delete an SMTP transactional log + /// Provides a factory method hook for the creation of exceptions. /// - /// Thrown when fails to make API call - /// MessageId of the transactional log to delete - /// ApiResponse of Object(void) - public ApiResponse SmtpLogMessageIdDeleteWithHttpInfo (string messageId) + public sib_api_v3_sdk.Client.ExceptionFactory ExceptionFactory { - // verify the required parameter 'messageId' is set - if (messageId == null) - throw new ApiException(400, "Missing required parameter 'messageId' when calling TransactionalEmailsApi->SmtpLogMessageIdDelete"); - - var localVarPath = "./smtp/log/{messageId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (messageId != null) localVarPathParams.Add("messageId", this.Configuration.ApiClient.ParameterToString(messageId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) + get { - Exception exception = ExceptionFactory("SmtpLogMessageIdDelete", localVarResponse); - if (exception != null) throw exception; + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete an SMTP transactional log - /// - /// Thrown when fails to make API call - /// MessageId of the transactional log to delete - /// Task of void - public async System.Threading.Tasks.Task SmtpLogMessageIdDeleteAsync (string messageId) - { - await SmtpLogMessageIdDeleteAsyncWithHttpInfo(messageId); - + set { _exceptionFactory = value; } } /// - /// Delete an SMTP transactional log + /// Gets the default header. /// - /// Thrown when fails to make API call - /// MessageId of the transactional log to delete - /// Task of ApiResponse - public async System.Threading.Tasks.Task> SmtpLogMessageIdDeleteAsyncWithHttpInfo (string messageId) + /// Dictionary of HTTP header + [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] + public IDictionary DefaultHeader() { - // verify the required parameter 'messageId' is set - if (messageId == null) - throw new ApiException(400, "Missing required parameter 'messageId' when calling TransactionalEmailsApi->SmtpLogMessageIdDelete"); - - var localVarPath = "./smtp/log/{messageId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (messageId != null) localVarPathParams.Add("messageId", this.Configuration.ApiClient.ParameterToString(messageId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("SmtpLogMessageIdDelete", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); + return new ReadOnlyDictionary(this.Configuration.DefaultHeader); } /// - /// Update an email template + /// Add default header. /// - /// Thrown when fails to make API call - /// id of the template - /// values to update in transactional email template + /// Header field name. + /// Header field value. /// - public void UpdateSmtpTemplate (long? templateId, UpdateSmtpTemplate smtpTemplate) - { - UpdateSmtpTemplateWithHttpInfo(templateId, smtpTemplate); - } - - /// - /// Update an email template - /// - /// Thrown when fails to make API call - /// id of the template - /// values to update in transactional email template - /// ApiResponse of Object(void) - public ApiResponse UpdateSmtpTemplateWithHttpInfo (long? templateId, UpdateSmtpTemplate smtpTemplate) + [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] + public void AddDefaultHeader(string key, string value) { - // verify the required parameter 'templateId' is set - if (templateId == null) - throw new ApiException(400, "Missing required parameter 'templateId' when calling TransactionalEmailsApi->UpdateSmtpTemplate"); - // verify the required parameter 'smtpTemplate' is set - if (smtpTemplate == null) - throw new ApiException(400, "Missing required parameter 'smtpTemplate' when calling TransactionalEmailsApi->UpdateSmtpTemplate"); - - var localVarPath = "./smtp/templates/{templateId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (templateId != null) localVarPathParams.Add("templateId", this.Configuration.ApiClient.ParameterToString(templateId)); // path parameter - if (smtpTemplate != null && smtpTemplate.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(smtpTemplate); // http body (model) parameter - } - else - { - localVarPostBody = smtpTemplate; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UpdateSmtpTemplate", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); + this.Configuration.AddDefaultHeader(key, value); } /// - /// Update an email template + /// Send a transactional email /// /// Thrown when fails to make API call - /// id of the template - /// values to update in transactional email template - /// Task of void - public async System.Threading.Tasks.Task UpdateSmtpTemplateAsync (long? templateId, UpdateSmtpTemplate smtpTemplate) + /// Values to send a transactional email + /// Task of CreateSmtpEmail + public async System.Threading.Tasks.Task SendTransacEmailAsync (SendSmtpEmail sendSmtpEmail) { - await UpdateSmtpTemplateAsyncWithHttpInfo(templateId, smtpTemplate); + var response = await SendTransacEmailAsyncWithHttpInfo(sendSmtpEmail); + return response.Data; } /// - /// Update an email template + /// Send a transactional email /// /// Thrown when fails to make API call - /// id of the template - /// values to update in transactional email template - /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdateSmtpTemplateAsyncWithHttpInfo (long? templateId, UpdateSmtpTemplate smtpTemplate) + /// Values to send a transactional email + /// Task of ApiResponse (CreateSmtpEmail) + public async System.Threading.Tasks.Task> SendTransacEmailAsyncWithHttpInfo (SendSmtpEmail sendSmtpEmail) { - // verify the required parameter 'templateId' is set - if (templateId == null) - throw new ApiException(400, "Missing required parameter 'templateId' when calling TransactionalEmailsApi->UpdateSmtpTemplate"); - // verify the required parameter 'smtpTemplate' is set - if (smtpTemplate == null) - throw new ApiException(400, "Missing required parameter 'smtpTemplate' when calling TransactionalEmailsApi->UpdateSmtpTemplate"); - - var localVarPath = "./smtp/templates/{templateId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (templateId != null) localVarPathParams.Add("templateId", this.Configuration.ApiClient.ParameterToString(templateId)); // path parameter - if (smtpTemplate != null && smtpTemplate.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(smtpTemplate); // http body (model) parameter - } - else - { - localVarPostBody = smtpTemplate; // byte array - } + // verify the required parameter 'sendSmtpEmail' is set + if (sendSmtpEmail == null) + throw new ApiException(400, "Missing required parameter 'sendSmtpEmail' when calling TransactionalEmailsApi->SendTransacEmail"); - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } + var localVarPath = "./smtp/email"; + var localVarPostBody = this.Configuration.ApiClient.Serialize(sendSmtpEmail); - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + var request = this.Configuration.ApiClient.PreparePostBodyRequest(localVarPath, "application/json", localVarPostBody); + var response = await this.Configuration.ApiClient.RestClient.SendAsync(request); - int localVarStatusCode = (int) localVarResponse.StatusCode; + var localVarStatusCode = (int) response.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("UpdateSmtpTemplate", localVarResponse); + var exception = ExceptionFactory("SendTransacEmail", response); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); + return new ApiResponse(localVarStatusCode, + response.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (CreateSmtpEmail) this.Configuration.ApiClient.Deserialize(response, typeof(CreateSmtpEmail))); } - } } diff --git a/src/sib_api_v3_sdk/Api/TransactionalSMSApi.cs b/src/sib_api_v3_sdk/Api/TransactionalSMSApi.cs deleted file mode 100644 index 7f2f72d..0000000 --- a/src/sib_api_v3_sdk/Api/TransactionalSMSApi.cs +++ /dev/null @@ -1,1064 +0,0 @@ -/* - * SendinBlue API - * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :- -- -- -- -- -- --: | - -- -- -- -- -- -- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | - * - * OpenAPI spec version: 3.0.0 - * Contact: contact@sendinblue.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using RestSharp.Portable; -using sib_api_v3_sdk.Client; -using sib_api_v3_sdk.Model; - -namespace sib_api_v3_sdk.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface ITransactionalSMSApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Get all your SMS activity (unaggregated events) - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) - /// Index of the first document of the page (optional, default to 0) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Filter the report for a specific phone number (optional) - /// Filter the report for specific events (optional) - /// Filter the report for specific tags passed as a serialized urlencoded array (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// GetSmsEventReport - GetSmsEventReport GetSmsEvents (long? limit = null, string startDate = null, string endDate = null, long? offset = null, long? days = null, string phoneNumber = null, string _event = null, string tags = null, string sort = null); - - /// - /// Get all your SMS activity (unaggregated events) - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) - /// Index of the first document of the page (optional, default to 0) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Filter the report for a specific phone number (optional) - /// Filter the report for specific events (optional) - /// Filter the report for specific tags passed as a serialized urlencoded array (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// ApiResponse of GetSmsEventReport - ApiResponse GetSmsEventsWithHttpInfo (long? limit = null, string startDate = null, string endDate = null, long? offset = null, long? days = null, string phoneNumber = null, string _event = null, string tags = null, string sort = null); - /// - /// Get your SMS activity aggregated over a period of time - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) - /// Number of days in the past including today (positive integer). Not compatible with startDate and endDate (optional) - /// Filter on a tag (optional) - /// GetTransacAggregatedSmsReport - GetTransacAggregatedSmsReport GetTransacAggregatedSmsReport (string startDate = null, string endDate = null, long? days = null, string tag = null); - - /// - /// Get your SMS activity aggregated over a period of time - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) - /// Number of days in the past including today (positive integer). Not compatible with startDate and endDate (optional) - /// Filter on a tag (optional) - /// ApiResponse of GetTransacAggregatedSmsReport - ApiResponse GetTransacAggregatedSmsReportWithHttpInfo (string startDate = null, string endDate = null, long? days = null, string tag = null); - /// - /// Get your SMS activity aggregated per day - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Filter on a tag (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// GetTransacSmsReport - GetTransacSmsReport GetTransacSmsReport (string startDate = null, string endDate = null, long? days = null, string tag = null, string sort = null); - - /// - /// Get your SMS activity aggregated per day - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Filter on a tag (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// ApiResponse of GetTransacSmsReport - ApiResponse GetTransacSmsReportWithHttpInfo (string startDate = null, string endDate = null, long? days = null, string tag = null, string sort = null); - /// - /// Send SMS message to a mobile number - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to send a transactional SMS - /// SendSms - SendSms SendTransacSms (SendTransacSms sendTransacSms); - - /// - /// Send SMS message to a mobile number - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to send a transactional SMS - /// ApiResponse of SendSms - ApiResponse SendTransacSmsWithHttpInfo (SendTransacSms sendTransacSms); - #endregion Synchronous Operations - #region Asynchronous Operations - /// - /// Get all your SMS activity (unaggregated events) - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) - /// Index of the first document of the page (optional, default to 0) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Filter the report for a specific phone number (optional) - /// Filter the report for specific events (optional) - /// Filter the report for specific tags passed as a serialized urlencoded array (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of GetSmsEventReport - System.Threading.Tasks.Task GetSmsEventsAsync (long? limit = null, string startDate = null, string endDate = null, long? offset = null, long? days = null, string phoneNumber = null, string _event = null, string tags = null, string sort = null); - - /// - /// Get all your SMS activity (unaggregated events) - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) - /// Index of the first document of the page (optional, default to 0) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Filter the report for a specific phone number (optional) - /// Filter the report for specific events (optional) - /// Filter the report for specific tags passed as a serialized urlencoded array (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of ApiResponse (GetSmsEventReport) - System.Threading.Tasks.Task> GetSmsEventsAsyncWithHttpInfo (long? limit = null, string startDate = null, string endDate = null, long? offset = null, long? days = null, string phoneNumber = null, string _event = null, string tags = null, string sort = null); - /// - /// Get your SMS activity aggregated over a period of time - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) - /// Number of days in the past including today (positive integer). Not compatible with startDate and endDate (optional) - /// Filter on a tag (optional) - /// Task of GetTransacAggregatedSmsReport - System.Threading.Tasks.Task GetTransacAggregatedSmsReportAsync (string startDate = null, string endDate = null, long? days = null, string tag = null); - - /// - /// Get your SMS activity aggregated over a period of time - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) - /// Number of days in the past including today (positive integer). Not compatible with startDate and endDate (optional) - /// Filter on a tag (optional) - /// Task of ApiResponse (GetTransacAggregatedSmsReport) - System.Threading.Tasks.Task> GetTransacAggregatedSmsReportAsyncWithHttpInfo (string startDate = null, string endDate = null, long? days = null, string tag = null); - /// - /// Get your SMS activity aggregated per day - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Filter on a tag (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of GetTransacSmsReport - System.Threading.Tasks.Task GetTransacSmsReportAsync (string startDate = null, string endDate = null, long? days = null, string tag = null, string sort = null); - - /// - /// Get your SMS activity aggregated per day - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Filter on a tag (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of ApiResponse (GetTransacSmsReport) - System.Threading.Tasks.Task> GetTransacSmsReportAsyncWithHttpInfo (string startDate = null, string endDate = null, long? days = null, string tag = null, string sort = null); - /// - /// Send SMS message to a mobile number - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to send a transactional SMS - /// Task of SendSms - System.Threading.Tasks.Task SendTransacSmsAsync (SendTransacSms sendTransacSms); - - /// - /// Send SMS message to a mobile number - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to send a transactional SMS - /// Task of ApiResponse (SendSms) - System.Threading.Tasks.Task> SendTransacSmsAsyncWithHttpInfo (SendTransacSms sendTransacSms); - #endregion Asynchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public partial class TransactionalSMSApi : ITransactionalSMSApi - { - private sib_api_v3_sdk.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// - /// - public TransactionalSMSApi(String basePath) - { - this.Configuration = new sib_api_v3_sdk.Client.Configuration { BasePath = basePath }; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using Configuration object - /// - /// An instance of Configuration - /// - public TransactionalSMSApi(sib_api_v3_sdk.Client.Configuration configuration = null) - { - if (configuration == null) // use the default one in Configuration - this.Configuration = sib_api_v3_sdk.Client.Configuration.Default; - else - this.Configuration = configuration; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] - public void SetBasePath(String basePath) - { - // do nothing - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public sib_api_v3_sdk.Client.Configuration Configuration {get; set;} - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public sib_api_v3_sdk.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - /// - /// Gets the default header. - /// - /// Dictionary of HTTP header - [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] - public IDictionary DefaultHeader() - { - return new ReadOnlyDictionary(this.Configuration.DefaultHeader); - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] - public void AddDefaultHeader(string key, string value) - { - this.Configuration.AddDefaultHeader(key, value); - } - - /// - /// Get all your SMS activity (unaggregated events) - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) - /// Index of the first document of the page (optional, default to 0) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Filter the report for a specific phone number (optional) - /// Filter the report for specific events (optional) - /// Filter the report for specific tags passed as a serialized urlencoded array (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// GetSmsEventReport - public GetSmsEventReport GetSmsEvents (long? limit = null, string startDate = null, string endDate = null, long? offset = null, long? days = null, string phoneNumber = null, string _event = null, string tags = null, string sort = null) - { - ApiResponse localVarResponse = GetSmsEventsWithHttpInfo(limit, startDate, endDate, offset, days, phoneNumber, _event, tags, sort); - return localVarResponse.Data; - } - - /// - /// Get all your SMS activity (unaggregated events) - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) - /// Index of the first document of the page (optional, default to 0) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Filter the report for a specific phone number (optional) - /// Filter the report for specific events (optional) - /// Filter the report for specific tags passed as a serialized urlencoded array (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// ApiResponse of GetSmsEventReport - public ApiResponse< GetSmsEventReport > GetSmsEventsWithHttpInfo (long? limit = null, string startDate = null, string endDate = null, long? offset = null, long? days = null, string phoneNumber = null, string _event = null, string tags = null, string sort = null) - { - - var localVarPath = "./transactionalSMS/statistics/events"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (days != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "days", days)); // query parameter - if (phoneNumber != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "phoneNumber", phoneNumber)); // query parameter - if (_event != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "event", _event)); // query parameter - if (tags != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "tags", tags)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetSmsEvents", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetSmsEventReport) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSmsEventReport))); - } - - /// - /// Get all your SMS activity (unaggregated events) - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) - /// Index of the first document of the page (optional, default to 0) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Filter the report for a specific phone number (optional) - /// Filter the report for specific events (optional) - /// Filter the report for specific tags passed as a serialized urlencoded array (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of GetSmsEventReport - public async System.Threading.Tasks.Task GetSmsEventsAsync (long? limit = null, string startDate = null, string endDate = null, long? offset = null, long? days = null, string phoneNumber = null, string _event = null, string tags = null, string sort = null) - { - ApiResponse localVarResponse = await GetSmsEventsAsyncWithHttpInfo(limit, startDate, endDate, offset, days, phoneNumber, _event, tags, sort); - return localVarResponse.Data; - - } - - /// - /// Get all your SMS activity (unaggregated events) - /// - /// Thrown when fails to make API call - /// Number of documents per page (optional, default to 50) - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) - /// Index of the first document of the page (optional, default to 0) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Filter the report for a specific phone number (optional) - /// Filter the report for specific events (optional) - /// Filter the report for specific tags passed as a serialized urlencoded array (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of ApiResponse (GetSmsEventReport) - public async System.Threading.Tasks.Task> GetSmsEventsAsyncWithHttpInfo (long? limit = null, string startDate = null, string endDate = null, long? offset = null, long? days = null, string phoneNumber = null, string _event = null, string tags = null, string sort = null) - { - - var localVarPath = "./transactionalSMS/statistics/events"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - if (offset != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter - if (days != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "days", days)); // query parameter - if (phoneNumber != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "phoneNumber", phoneNumber)); // query parameter - if (_event != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "event", _event)); // query parameter - if (tags != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "tags", tags)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetSmsEvents", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetSmsEventReport) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSmsEventReport))); - } - - /// - /// Get your SMS activity aggregated over a period of time - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) - /// Number of days in the past including today (positive integer). Not compatible with startDate and endDate (optional) - /// Filter on a tag (optional) - /// GetTransacAggregatedSmsReport - public GetTransacAggregatedSmsReport GetTransacAggregatedSmsReport (string startDate = null, string endDate = null, long? days = null, string tag = null) - { - ApiResponse localVarResponse = GetTransacAggregatedSmsReportWithHttpInfo(startDate, endDate, days, tag); - return localVarResponse.Data; - } - - /// - /// Get your SMS activity aggregated over a period of time - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) - /// Number of days in the past including today (positive integer). Not compatible with startDate and endDate (optional) - /// Filter on a tag (optional) - /// ApiResponse of GetTransacAggregatedSmsReport - public ApiResponse< GetTransacAggregatedSmsReport > GetTransacAggregatedSmsReportWithHttpInfo (string startDate = null, string endDate = null, long? days = null, string tag = null) - { - - var localVarPath = "./transactionalSMS/statistics/aggregatedReport"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - if (days != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "days", days)); // query parameter - if (tag != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "tag", tag)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetTransacAggregatedSmsReport", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetTransacAggregatedSmsReport) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetTransacAggregatedSmsReport))); - } - - /// - /// Get your SMS activity aggregated over a period of time - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) - /// Number of days in the past including today (positive integer). Not compatible with startDate and endDate (optional) - /// Filter on a tag (optional) - /// Task of GetTransacAggregatedSmsReport - public async System.Threading.Tasks.Task GetTransacAggregatedSmsReportAsync (string startDate = null, string endDate = null, long? days = null, string tag = null) - { - ApiResponse localVarResponse = await GetTransacAggregatedSmsReportAsyncWithHttpInfo(startDate, endDate, days, tag); - return localVarResponse.Data; - - } - - /// - /// Get your SMS activity aggregated over a period of time - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) - /// Number of days in the past including today (positive integer). Not compatible with startDate and endDate (optional) - /// Filter on a tag (optional) - /// Task of ApiResponse (GetTransacAggregatedSmsReport) - public async System.Threading.Tasks.Task> GetTransacAggregatedSmsReportAsyncWithHttpInfo (string startDate = null, string endDate = null, long? days = null, string tag = null) - { - - var localVarPath = "./transactionalSMS/statistics/aggregatedReport"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - if (days != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "days", days)); // query parameter - if (tag != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "tag", tag)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetTransacAggregatedSmsReport", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetTransacAggregatedSmsReport) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetTransacAggregatedSmsReport))); - } - - /// - /// Get your SMS activity aggregated per day - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Filter on a tag (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// GetTransacSmsReport - public GetTransacSmsReport GetTransacSmsReport (string startDate = null, string endDate = null, long? days = null, string tag = null, string sort = null) - { - ApiResponse localVarResponse = GetTransacSmsReportWithHttpInfo(startDate, endDate, days, tag, sort); - return localVarResponse.Data; - } - - /// - /// Get your SMS activity aggregated per day - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Filter on a tag (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// ApiResponse of GetTransacSmsReport - public ApiResponse< GetTransacSmsReport > GetTransacSmsReportWithHttpInfo (string startDate = null, string endDate = null, long? days = null, string tag = null, string sort = null) - { - - var localVarPath = "./transactionalSMS/statistics/reports"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - if (days != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "days", days)); // query parameter - if (tag != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "tag", tag)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetTransacSmsReport", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetTransacSmsReport) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetTransacSmsReport))); - } - - /// - /// Get your SMS activity aggregated per day - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Filter on a tag (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of GetTransacSmsReport - public async System.Threading.Tasks.Task GetTransacSmsReportAsync (string startDate = null, string endDate = null, long? days = null, string tag = null, string sort = null) - { - ApiResponse localVarResponse = await GetTransacSmsReportAsyncWithHttpInfo(startDate, endDate, days, tag, sort); - return localVarResponse.Data; - - } - - /// - /// Get your SMS activity aggregated per day - /// - /// Thrown when fails to make API call - /// Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - /// Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) - /// Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) - /// Filter on a tag (optional) - /// Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) - /// Task of ApiResponse (GetTransacSmsReport) - public async System.Threading.Tasks.Task> GetTransacSmsReportAsyncWithHttpInfo (string startDate = null, string endDate = null, long? days = null, string tag = null, string sort = null) - { - - var localVarPath = "./transactionalSMS/statistics/reports"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (startDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "startDate", startDate)); // query parameter - if (endDate != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "endDate", endDate)); // query parameter - if (days != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "days", days)); // query parameter - if (tag != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "tag", tag)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetTransacSmsReport", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetTransacSmsReport) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetTransacSmsReport))); - } - - /// - /// Send SMS message to a mobile number - /// - /// Thrown when fails to make API call - /// Values to send a transactional SMS - /// SendSms - public SendSms SendTransacSms (SendTransacSms sendTransacSms) - { - ApiResponse localVarResponse = SendTransacSmsWithHttpInfo(sendTransacSms); - return localVarResponse.Data; - } - - /// - /// Send SMS message to a mobile number - /// - /// Thrown when fails to make API call - /// Values to send a transactional SMS - /// ApiResponse of SendSms - public ApiResponse< SendSms > SendTransacSmsWithHttpInfo (SendTransacSms sendTransacSms) - { - // verify the required parameter 'sendTransacSms' is set - if (sendTransacSms == null) - throw new ApiException(400, "Missing required parameter 'sendTransacSms' when calling TransactionalSMSApi->SendTransacSms"); - - var localVarPath = "./transactionalSMS/sms"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (sendTransacSms != null && sendTransacSms.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(sendTransacSms); // http body (model) parameter - } - else - { - localVarPostBody = sendTransacSms; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("SendTransacSms", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (SendSms) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(SendSms))); - } - - /// - /// Send SMS message to a mobile number - /// - /// Thrown when fails to make API call - /// Values to send a transactional SMS - /// Task of SendSms - public async System.Threading.Tasks.Task SendTransacSmsAsync (SendTransacSms sendTransacSms) - { - ApiResponse localVarResponse = await SendTransacSmsAsyncWithHttpInfo(sendTransacSms); - return localVarResponse.Data; - - } - - /// - /// Send SMS message to a mobile number - /// - /// Thrown when fails to make API call - /// Values to send a transactional SMS - /// Task of ApiResponse (SendSms) - public async System.Threading.Tasks.Task> SendTransacSmsAsyncWithHttpInfo (SendTransacSms sendTransacSms) - { - // verify the required parameter 'sendTransacSms' is set - if (sendTransacSms == null) - throw new ApiException(400, "Missing required parameter 'sendTransacSms' when calling TransactionalSMSApi->SendTransacSms"); - - var localVarPath = "./transactionalSMS/sms"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (sendTransacSms != null && sendTransacSms.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(sendTransacSms); // http body (model) parameter - } - else - { - localVarPostBody = sendTransacSms; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("SendTransacSms", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (SendSms) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(SendSms))); - } - - } -} diff --git a/src/sib_api_v3_sdk/Api/WebhooksApi.cs b/src/sib_api_v3_sdk/Api/WebhooksApi.cs deleted file mode 100644 index 2273760..0000000 --- a/src/sib_api_v3_sdk/Api/WebhooksApi.cs +++ /dev/null @@ -1,1159 +0,0 @@ -/* - * SendinBlue API - * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :- -- -- -- -- -- --: | - -- -- -- -- -- -- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | - * - * OpenAPI spec version: 3.0.0 - * Contact: contact@sendinblue.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using RestSharp.Portable; -using sib_api_v3_sdk.Client; -using sib_api_v3_sdk.Model; - -namespace sib_api_v3_sdk.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IWebhooksApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Create a webhook - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create a webhook - /// CreateModel - CreateModel CreateWebhook (CreateWebhook createWebhook); - - /// - /// Create a webhook - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create a webhook - /// ApiResponse of CreateModel - ApiResponse CreateWebhookWithHttpInfo (CreateWebhook createWebhook); - /// - /// Delete a webhook - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the webhook - /// - void DeleteWebhook (long? webhookId); - - /// - /// Delete a webhook - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the webhook - /// ApiResponse of Object(void) - ApiResponse DeleteWebhookWithHttpInfo (long? webhookId); - /// - /// Get a webhook details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the webhook - /// GetWebhook - GetWebhook GetWebhook (long? webhookId); - - /// - /// Get a webhook details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the webhook - /// ApiResponse of GetWebhook - ApiResponse GetWebhookWithHttpInfo (long? webhookId); - /// - /// Get all webhooks - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter on webhook type (optional, default to transactional) - /// Sort the results in the ascending/descending order of webhook creation (optional, default to desc) - /// GetWebhooks - GetWebhooks GetWebhooks (string type = null, string sort = null); - - /// - /// Get all webhooks - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter on webhook type (optional, default to transactional) - /// Sort the results in the ascending/descending order of webhook creation (optional, default to desc) - /// ApiResponse of GetWebhooks - ApiResponse GetWebhooksWithHttpInfo (string type = null, string sort = null); - /// - /// Update a webhook - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the webhook - /// Values to update a webhook - /// - void UpdateWebhook (long? webhookId, UpdateWebhook updateWebhook); - - /// - /// Update a webhook - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the webhook - /// Values to update a webhook - /// ApiResponse of Object(void) - ApiResponse UpdateWebhookWithHttpInfo (long? webhookId, UpdateWebhook updateWebhook); - #endregion Synchronous Operations - #region Asynchronous Operations - /// - /// Create a webhook - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create a webhook - /// Task of CreateModel - System.Threading.Tasks.Task CreateWebhookAsync (CreateWebhook createWebhook); - - /// - /// Create a webhook - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Values to create a webhook - /// Task of ApiResponse (CreateModel) - System.Threading.Tasks.Task> CreateWebhookAsyncWithHttpInfo (CreateWebhook createWebhook); - /// - /// Delete a webhook - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the webhook - /// Task of void - System.Threading.Tasks.Task DeleteWebhookAsync (long? webhookId); - - /// - /// Delete a webhook - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the webhook - /// Task of ApiResponse - System.Threading.Tasks.Task> DeleteWebhookAsyncWithHttpInfo (long? webhookId); - /// - /// Get a webhook details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the webhook - /// Task of GetWebhook - System.Threading.Tasks.Task GetWebhookAsync (long? webhookId); - - /// - /// Get a webhook details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the webhook - /// Task of ApiResponse (GetWebhook) - System.Threading.Tasks.Task> GetWebhookAsyncWithHttpInfo (long? webhookId); - /// - /// Get all webhooks - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter on webhook type (optional, default to transactional) - /// Sort the results in the ascending/descending order of webhook creation (optional, default to desc) - /// Task of GetWebhooks - System.Threading.Tasks.Task GetWebhooksAsync (string type = null, string sort = null); - - /// - /// Get all webhooks - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Filter on webhook type (optional, default to transactional) - /// Sort the results in the ascending/descending order of webhook creation (optional, default to desc) - /// Task of ApiResponse (GetWebhooks) - System.Threading.Tasks.Task> GetWebhooksAsyncWithHttpInfo (string type = null, string sort = null); - /// - /// Update a webhook - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the webhook - /// Values to update a webhook - /// Task of void - System.Threading.Tasks.Task UpdateWebhookAsync (long? webhookId, UpdateWebhook updateWebhook); - - /// - /// Update a webhook - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the webhook - /// Values to update a webhook - /// Task of ApiResponse - System.Threading.Tasks.Task> UpdateWebhookAsyncWithHttpInfo (long? webhookId, UpdateWebhook updateWebhook); - #endregion Asynchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public partial class WebhooksApi : IWebhooksApi - { - private sib_api_v3_sdk.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// - /// - public WebhooksApi(String basePath) - { - this.Configuration = new sib_api_v3_sdk.Client.Configuration { BasePath = basePath }; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using Configuration object - /// - /// An instance of Configuration - /// - public WebhooksApi(sib_api_v3_sdk.Client.Configuration configuration = null) - { - if (configuration == null) // use the default one in Configuration - this.Configuration = sib_api_v3_sdk.Client.Configuration.Default; - else - this.Configuration = configuration; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] - public void SetBasePath(String basePath) - { - // do nothing - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public sib_api_v3_sdk.Client.Configuration Configuration {get; set;} - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public sib_api_v3_sdk.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - /// - /// Gets the default header. - /// - /// Dictionary of HTTP header - [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] - public IDictionary DefaultHeader() - { - return new ReadOnlyDictionary(this.Configuration.DefaultHeader); - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] - public void AddDefaultHeader(string key, string value) - { - this.Configuration.AddDefaultHeader(key, value); - } - - /// - /// Create a webhook - /// - /// Thrown when fails to make API call - /// Values to create a webhook - /// CreateModel - public CreateModel CreateWebhook (CreateWebhook createWebhook) - { - ApiResponse localVarResponse = CreateWebhookWithHttpInfo(createWebhook); - return localVarResponse.Data; - } - - /// - /// Create a webhook - /// - /// Thrown when fails to make API call - /// Values to create a webhook - /// ApiResponse of CreateModel - public ApiResponse< CreateModel > CreateWebhookWithHttpInfo (CreateWebhook createWebhook) - { - // verify the required parameter 'createWebhook' is set - if (createWebhook == null) - throw new ApiException(400, "Missing required parameter 'createWebhook' when calling WebhooksApi->CreateWebhook"); - - var localVarPath = "./webhooks"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (createWebhook != null && createWebhook.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(createWebhook); // http body (model) parameter - } - else - { - localVarPostBody = createWebhook; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateWebhook", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateModel))); - } - - /// - /// Create a webhook - /// - /// Thrown when fails to make API call - /// Values to create a webhook - /// Task of CreateModel - public async System.Threading.Tasks.Task CreateWebhookAsync (CreateWebhook createWebhook) - { - ApiResponse localVarResponse = await CreateWebhookAsyncWithHttpInfo(createWebhook); - return localVarResponse.Data; - - } - - /// - /// Create a webhook - /// - /// Thrown when fails to make API call - /// Values to create a webhook - /// Task of ApiResponse (CreateModel) - public async System.Threading.Tasks.Task> CreateWebhookAsyncWithHttpInfo (CreateWebhook createWebhook) - { - // verify the required parameter 'createWebhook' is set - if (createWebhook == null) - throw new ApiException(400, "Missing required parameter 'createWebhook' when calling WebhooksApi->CreateWebhook"); - - var localVarPath = "./webhooks"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (createWebhook != null && createWebhook.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(createWebhook); // http body (model) parameter - } - else - { - localVarPostBody = createWebhook; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateWebhook", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (CreateModel) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateModel))); - } - - /// - /// Delete a webhook - /// - /// Thrown when fails to make API call - /// Id of the webhook - /// - public void DeleteWebhook (long? webhookId) - { - DeleteWebhookWithHttpInfo(webhookId); - } - - /// - /// Delete a webhook - /// - /// Thrown when fails to make API call - /// Id of the webhook - /// ApiResponse of Object(void) - public ApiResponse DeleteWebhookWithHttpInfo (long? webhookId) - { - // verify the required parameter 'webhookId' is set - if (webhookId == null) - throw new ApiException(400, "Missing required parameter 'webhookId' when calling WebhooksApi->DeleteWebhook"); - - var localVarPath = "./webhooks/{webhookId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (webhookId != null) localVarPathParams.Add("webhookId", this.Configuration.ApiClient.ParameterToString(webhookId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteWebhook", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete a webhook - /// - /// Thrown when fails to make API call - /// Id of the webhook - /// Task of void - public async System.Threading.Tasks.Task DeleteWebhookAsync (long? webhookId) - { - await DeleteWebhookAsyncWithHttpInfo(webhookId); - - } - - /// - /// Delete a webhook - /// - /// Thrown when fails to make API call - /// Id of the webhook - /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeleteWebhookAsyncWithHttpInfo (long? webhookId) - { - // verify the required parameter 'webhookId' is set - if (webhookId == null) - throw new ApiException(400, "Missing required parameter 'webhookId' when calling WebhooksApi->DeleteWebhook"); - - var localVarPath = "./webhooks/{webhookId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (webhookId != null) localVarPathParams.Add("webhookId", this.Configuration.ApiClient.ParameterToString(webhookId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteWebhook", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Get a webhook details - /// - /// Thrown when fails to make API call - /// Id of the webhook - /// GetWebhook - public GetWebhook GetWebhook (long? webhookId) - { - ApiResponse localVarResponse = GetWebhookWithHttpInfo(webhookId); - return localVarResponse.Data; - } - - /// - /// Get a webhook details - /// - /// Thrown when fails to make API call - /// Id of the webhook - /// ApiResponse of GetWebhook - public ApiResponse< GetWebhook > GetWebhookWithHttpInfo (long? webhookId) - { - // verify the required parameter 'webhookId' is set - if (webhookId == null) - throw new ApiException(400, "Missing required parameter 'webhookId' when calling WebhooksApi->GetWebhook"); - - var localVarPath = "./webhooks/{webhookId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (webhookId != null) localVarPathParams.Add("webhookId", this.Configuration.ApiClient.ParameterToString(webhookId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetWebhook", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetWebhook) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetWebhook))); - } - - /// - /// Get a webhook details - /// - /// Thrown when fails to make API call - /// Id of the webhook - /// Task of GetWebhook - public async System.Threading.Tasks.Task GetWebhookAsync (long? webhookId) - { - ApiResponse localVarResponse = await GetWebhookAsyncWithHttpInfo(webhookId); - return localVarResponse.Data; - - } - - /// - /// Get a webhook details - /// - /// Thrown when fails to make API call - /// Id of the webhook - /// Task of ApiResponse (GetWebhook) - public async System.Threading.Tasks.Task> GetWebhookAsyncWithHttpInfo (long? webhookId) - { - // verify the required parameter 'webhookId' is set - if (webhookId == null) - throw new ApiException(400, "Missing required parameter 'webhookId' when calling WebhooksApi->GetWebhook"); - - var localVarPath = "./webhooks/{webhookId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (webhookId != null) localVarPathParams.Add("webhookId", this.Configuration.ApiClient.ParameterToString(webhookId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetWebhook", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetWebhook) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetWebhook))); - } - - /// - /// Get all webhooks - /// - /// Thrown when fails to make API call - /// Filter on webhook type (optional, default to transactional) - /// Sort the results in the ascending/descending order of webhook creation (optional, default to desc) - /// GetWebhooks - public GetWebhooks GetWebhooks (string type = null, string sort = null) - { - ApiResponse localVarResponse = GetWebhooksWithHttpInfo(type, sort); - return localVarResponse.Data; - } - - /// - /// Get all webhooks - /// - /// Thrown when fails to make API call - /// Filter on webhook type (optional, default to transactional) - /// Sort the results in the ascending/descending order of webhook creation (optional, default to desc) - /// ApiResponse of GetWebhooks - public ApiResponse< GetWebhooks > GetWebhooksWithHttpInfo (string type = null, string sort = null) - { - - var localVarPath = "./webhooks"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (type != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "type", type)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetWebhooks", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetWebhooks) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetWebhooks))); - } - - /// - /// Get all webhooks - /// - /// Thrown when fails to make API call - /// Filter on webhook type (optional, default to transactional) - /// Sort the results in the ascending/descending order of webhook creation (optional, default to desc) - /// Task of GetWebhooks - public async System.Threading.Tasks.Task GetWebhooksAsync (string type = null, string sort = null) - { - ApiResponse localVarResponse = await GetWebhooksAsyncWithHttpInfo(type, sort); - return localVarResponse.Data; - - } - - /// - /// Get all webhooks - /// - /// Thrown when fails to make API call - /// Filter on webhook type (optional, default to transactional) - /// Sort the results in the ascending/descending order of webhook creation (optional, default to desc) - /// Task of ApiResponse (GetWebhooks) - public async System.Threading.Tasks.Task> GetWebhooksAsyncWithHttpInfo (string type = null, string sort = null) - { - - var localVarPath = "./webhooks"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (type != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "type", type)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetWebhooks", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetWebhooks) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetWebhooks))); - } - - /// - /// Update a webhook - /// - /// Thrown when fails to make API call - /// Id of the webhook - /// Values to update a webhook - /// - public void UpdateWebhook (long? webhookId, UpdateWebhook updateWebhook) - { - UpdateWebhookWithHttpInfo(webhookId, updateWebhook); - } - - /// - /// Update a webhook - /// - /// Thrown when fails to make API call - /// Id of the webhook - /// Values to update a webhook - /// ApiResponse of Object(void) - public ApiResponse UpdateWebhookWithHttpInfo (long? webhookId, UpdateWebhook updateWebhook) - { - // verify the required parameter 'webhookId' is set - if (webhookId == null) - throw new ApiException(400, "Missing required parameter 'webhookId' when calling WebhooksApi->UpdateWebhook"); - // verify the required parameter 'updateWebhook' is set - if (updateWebhook == null) - throw new ApiException(400, "Missing required parameter 'updateWebhook' when calling WebhooksApi->UpdateWebhook"); - - var localVarPath = "./webhooks/{webhookId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (webhookId != null) localVarPathParams.Add("webhookId", this.Configuration.ApiClient.ParameterToString(webhookId)); // path parameter - if (updateWebhook != null && updateWebhook.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(updateWebhook); // http body (model) parameter - } - else - { - localVarPostBody = updateWebhook; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UpdateWebhook", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Update a webhook - /// - /// Thrown when fails to make API call - /// Id of the webhook - /// Values to update a webhook - /// Task of void - public async System.Threading.Tasks.Task UpdateWebhookAsync (long? webhookId, UpdateWebhook updateWebhook) - { - await UpdateWebhookAsyncWithHttpInfo(webhookId, updateWebhook); - - } - - /// - /// Update a webhook - /// - /// Thrown when fails to make API call - /// Id of the webhook - /// Values to update a webhook - /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdateWebhookAsyncWithHttpInfo (long? webhookId, UpdateWebhook updateWebhook) - { - // verify the required parameter 'webhookId' is set - if (webhookId == null) - throw new ApiException(400, "Missing required parameter 'webhookId' when calling WebhooksApi->UpdateWebhook"); - // verify the required parameter 'updateWebhook' is set - if (updateWebhook == null) - throw new ApiException(400, "Missing required parameter 'updateWebhook' when calling WebhooksApi->UpdateWebhook"); - - var localVarPath = "./webhooks/{webhookId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (webhookId != null) localVarPathParams.Add("webhookId", this.Configuration.ApiClient.ParameterToString(webhookId)); // path parameter - if (updateWebhook != null && updateWebhook.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(updateWebhook); // http body (model) parameter - } - else - { - localVarPostBody = updateWebhook; // byte array - } - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UpdateWebhook", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - } -} diff --git a/src/sib_api_v3_sdk/Api/WhatsappCampaignsApi.cs b/src/sib_api_v3_sdk/Api/WhatsappCampaignsApi.cs deleted file mode 100644 index 44d82ae..0000000 --- a/src/sib_api_v3_sdk/Api/WhatsappCampaignsApi.cs +++ /dev/null @@ -1,522 +0,0 @@ -/* - * SendinBlue API - * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :- -- -- -- -- -- --: | - -- -- -- -- -- -- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | - * - * OpenAPI spec version: 3.0.0 - * Contact: contact@sendinblue.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using RestSharp.Portable; -using sib_api_v3_sdk.Client; -using sib_api_v3_sdk.Model; - -namespace sib_api_v3_sdk.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IWhatsappCampaignsApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Delete a whatsapp campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the campaign - /// - void DeleteWhatsappCampaign (Object campaignId); - - /// - /// Delete a whatsapp campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the campaign - /// ApiResponse of Object(void) - ApiResponse DeleteWhatsappCampaignWithHttpInfo (Object campaignId); - /// - /// Get Whatsapp campaign Overview - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// GetWhatsappCampaignOverview - GetWhatsappCampaignOverview GetWhatsappCampaign (Object campaignId); - - /// - /// Get Whatsapp campaign Overview - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// ApiResponse of GetWhatsappCampaignOverview - ApiResponse GetWhatsappCampaignWithHttpInfo (Object campaignId); - #endregion Synchronous Operations - #region Asynchronous Operations - /// - /// Delete a whatsapp campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Task of void - System.Threading.Tasks.Task DeleteWhatsappCampaignAsync (Object campaignId); - - /// - /// Delete a whatsapp campaign - /// - /// - /// - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Task of ApiResponse - System.Threading.Tasks.Task> DeleteWhatsappCampaignAsyncWithHttpInfo (Object campaignId); - /// - /// Get Whatsapp campaign Overview - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Task of GetWhatsappCampaignOverview - System.Threading.Tasks.Task GetWhatsappCampaignAsync (Object campaignId); - - /// - /// Get Whatsapp campaign Overview - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Task of ApiResponse (GetWhatsappCampaignOverview) - System.Threading.Tasks.Task> GetWhatsappCampaignAsyncWithHttpInfo (Object campaignId); - #endregion Asynchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public partial class WhatsappCampaignsApi : IWhatsappCampaignsApi - { - private sib_api_v3_sdk.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// - /// - public WhatsappCampaignsApi(String basePath) - { - this.Configuration = new sib_api_v3_sdk.Client.Configuration { BasePath = basePath }; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using Configuration object - /// - /// An instance of Configuration - /// - public WhatsappCampaignsApi(sib_api_v3_sdk.Client.Configuration configuration = null) - { - if (configuration == null) // use the default one in Configuration - this.Configuration = sib_api_v3_sdk.Client.Configuration.Default; - else - this.Configuration = configuration; - - ExceptionFactory = sib_api_v3_sdk.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] - public void SetBasePath(String basePath) - { - // do nothing - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public sib_api_v3_sdk.Client.Configuration Configuration {get; set;} - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public sib_api_v3_sdk.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - /// - /// Gets the default header. - /// - /// Dictionary of HTTP header - [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] - public IDictionary DefaultHeader() - { - return new ReadOnlyDictionary(this.Configuration.DefaultHeader); - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] - public void AddDefaultHeader(string key, string value) - { - this.Configuration.AddDefaultHeader(key, value); - } - - /// - /// Delete a whatsapp campaign - /// - /// Thrown when fails to make API call - /// id of the campaign - /// - public void DeleteWhatsappCampaign (Object campaignId) - { - DeleteWhatsappCampaignWithHttpInfo(campaignId); - } - - /// - /// Delete a whatsapp campaign - /// - /// Thrown when fails to make API call - /// id of the campaign - /// ApiResponse of Object(void) - public ApiResponse DeleteWhatsappCampaignWithHttpInfo (Object campaignId) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling WhatsappCampaignsApi->DeleteWhatsappCampaign"); - - var localVarPath = "./whatsappCampaigns/{campaignId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteWhatsappCampaign", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Delete a whatsapp campaign - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Task of void - public async System.Threading.Tasks.Task DeleteWhatsappCampaignAsync (Object campaignId) - { - await DeleteWhatsappCampaignAsyncWithHttpInfo(campaignId); - - } - - /// - /// Delete a whatsapp campaign - /// - /// Thrown when fails to make API call - /// id of the campaign - /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeleteWhatsappCampaignAsyncWithHttpInfo (Object campaignId) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling WhatsappCampaignsApi->DeleteWhatsappCampaign"); - - var localVarPath = "./whatsappCampaigns/{campaignId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteWhatsappCampaign", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - null); - } - - /// - /// Get Whatsapp campaign Overview - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// GetWhatsappCampaignOverview - public GetWhatsappCampaignOverview GetWhatsappCampaign (Object campaignId) - { - ApiResponse localVarResponse = GetWhatsappCampaignWithHttpInfo(campaignId); - return localVarResponse.Data; - } - - /// - /// Get Whatsapp campaign Overview - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// ApiResponse of GetWhatsappCampaignOverview - public ApiResponse< GetWhatsappCampaignOverview > GetWhatsappCampaignWithHttpInfo (Object campaignId) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling WhatsappCampaignsApi->GetWhatsappCampaign"); - - var localVarPath = "./whatsappCampaigns/{campaignId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetWhatsappCampaign", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetWhatsappCampaignOverview) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetWhatsappCampaignOverview))); - } - - /// - /// Get Whatsapp campaign Overview - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Task of GetWhatsappCampaignOverview - public async System.Threading.Tasks.Task GetWhatsappCampaignAsync (Object campaignId) - { - ApiResponse localVarResponse = await GetWhatsappCampaignAsyncWithHttpInfo(campaignId); - return localVarResponse.Data; - - } - - /// - /// Get Whatsapp campaign Overview - /// - /// Thrown when fails to make API call - /// Id of the campaign - /// Task of ApiResponse (GetWhatsappCampaignOverview) - public async System.Threading.Tasks.Task> GetWhatsappCampaignAsyncWithHttpInfo (Object campaignId) - { - // verify the required parameter 'campaignId' is set - if (campaignId == null) - throw new ApiException(400, "Missing required parameter 'campaignId' when calling WhatsappCampaignsApi->GetWhatsappCampaign"); - - var localVarPath = "./whatsappCampaigns/{campaignId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json" - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (campaignId != null) localVarPathParams.Add("campaignId", this.Configuration.ApiClient.ParameterToString(campaignId)); // path parameter - - // authentication (api-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key"))) - { - localVarHeaderParams["api-key"] = this.Configuration.GetApiKeyWithPrefix("api-key"); - } - // authentication (partner-key) required - if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("partner-key"))) - { - localVarHeaderParams["partner-key"] = this.Configuration.GetApiKeyWithPrefix("partner-key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetWhatsappCampaign", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (GetWhatsappCampaignOverview) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetWhatsappCampaignOverview))); - } - - } -} diff --git a/src/sib_api_v3_sdk/Client/ApiClient.cs b/src/sib_api_v3_sdk/Client/ApiClient.cs index e46159f..d295e55 100644 --- a/src/sib_api_v3_sdk/Client/ApiClient.cs +++ b/src/sib_api_v3_sdk/Client/ApiClient.cs @@ -9,17 +9,14 @@ */ using System; -using System.Collections; using System.Collections.Generic; -using System.Globalization; +using System.Net.Http.Headers; using System.Text.RegularExpressions; using System.IO; using System.Linq; -using System.Net; -using System.Text; +using System.Net.Http; +using Microsoft.AspNetCore.WebUtilities; using Newtonsoft.Json; -using RestSharp.Portable; -using RestSharp.Portable.HttpClient; namespace sib_api_v3_sdk.Client { @@ -33,19 +30,6 @@ public partial class ApiClient ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor }; - /// - /// Allows for extending request processing for generated code. - /// - /// The RestSharp request object - partial void InterceptRequest(IRestRequest request); - - /// - /// Allows for extending response processing for generated code. - /// - /// The RestSharp request object - /// The RestSharp response object - partial void InterceptResponse(IRestRequest request, IRestResponse response); - /// /// Initializes a new instance of the class /// with default configuration. @@ -53,8 +37,9 @@ public partial class ApiClient public ApiClient() { Configuration = sib_api_v3_sdk.Client.Configuration.Default; - RestClient = new RestClient("https://api.sendinblue.com/v3"); - RestClient.IgnoreResponseStatusCode = true; + RestClient = new HttpClient(); + RestClient.BaseAddress = new Uri("https://api.sendinblue.com/v3"); + // RestClient.IgnoreResponseStatusCode = true; } /// @@ -66,8 +51,8 @@ public ApiClient(Configuration config) { Configuration = config ?? sib_api_v3_sdk.Client.Configuration.Default; - RestClient = new RestClient(Configuration.BasePath); - RestClient.IgnoreResponseStatusCode = true; + RestClient = new HttpClient(); + RestClient.BaseAddress = new Uri(config.BasePath); } /// @@ -80,8 +65,8 @@ public ApiClient(String basePath = "https://api.sendinblue.com/v3") if (String.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); - RestClient = new RestClient(basePath); - RestClient.IgnoreResponseStatusCode = true; + RestClient = new HttpClient(); + RestClient.BaseAddress = new Uri(basePath); Configuration = Client.Configuration.Default; } @@ -107,175 +92,51 @@ public ApiClient(String basePath = "https://api.sendinblue.com/v3") /// Gets or sets the RestClient. /// /// An instance of the RestClient - public RestClient RestClient { get; set; } - - // Creates and sets up a RestRequest prior to a call. - private RestRequest PrepareRequest( - String path, Method method, List> queryParams, Object postBody, - Dictionary headerParams, Dictionary formParams, - Dictionary fileParams, Dictionary pathParams, - String contentType) - { - var request = new RestRequest(path, method); - // disable ResetSharp.Portable built-in serialization - request.Serializer = null; - - // add path parameter, if any - foreach(var param in pathParams) - request.AddParameter(param.Key, param.Value, ParameterType.UrlSegment); + public HttpClient RestClient { get; set; } - // add header parameter, if any - foreach(var param in headerParams) - request.AddHeader(param.Key, param.Value); + internal HttpRequestMessage PreparePostBodyRequest(string path, string acceptHeader, string postBody) + { + var request = GetBaseRequest(path, HttpMethod.Post); - // add query parameter, if any - foreach(var param in queryParams) - request.AddQueryParameter(param.Key, param.Value); + // Set Headers + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptHeader)); - // add form parameter, if any - foreach(var param in formParams) - request.AddParameter(param.Key, param.Value); + request.Content = new StringContent(postBody); - // add file parameter, if any - foreach(var param in fileParams) - { - request.AddFile(param.Value); - } + return request; + } - if (postBody != null) // http body (model or byte[]) parameter - { - request.AddParameter(new Parameter { Value = postBody, Type = ParameterType.RequestBody, ContentType = contentType }); - } + internal HttpRequestMessage PrepareJsonGetRequest( + string path, + string acceptHeader, + Dictionary queryParams = null) + { + var request = GetBaseRequest(path, HttpMethod.Get, queryParams); + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptHeader)); return request; } - /// - /// Makes the HTTP request (Sync). - /// - /// URL path. - /// HTTP method. - /// Query parameters. - /// HTTP body (POST request). - /// Header parameters. - /// Form parameters. - /// File parameters. - /// Path parameters. - /// Content Type of the request - /// Object - public Object CallApi( - String path, Method method, List> queryParams, Object postBody, - Dictionary headerParams, Dictionary formParams, - Dictionary fileParams, Dictionary pathParams, - String contentType) + private HttpRequestMessage GetBaseRequest(string path, HttpMethod method, Dictionary queryParams = null) { - var request = PrepareRequest( - path, method, queryParams, postBody, headerParams, formParams, fileParams, - pathParams, contentType); - - // set timeout - RestClient.Timeout = TimeSpan.FromMilliseconds(Configuration.Timeout); - - // set user agent - if (!Configuration.UserAgent.ToLower().StartsWith("sendinblue_")) - Configuration.UserAgent = "sendinblue_clientAPI/v4.0.2/c#"; + if (queryParams != null && queryParams.Any()) + path = QueryHelpers.AddQueryString(path, queryParams); - RestClient.UserAgent = Configuration.UserAgent; + var request = new HttpRequestMessage(method, path); - InterceptRequest(request); - var response = RestClient.Execute(request).Result; - InterceptResponse(request, response); + // Set headers + foreach (var header in this.Configuration.DefaultHeader) + request.Headers.Add(header.Key, header.Value); - return (Object) response; - } - /// - /// Makes the asynchronous HTTP request. - /// - /// URL path. - /// HTTP method. - /// Query parameters. - /// HTTP body (POST request). - /// Header parameters. - /// Form parameters. - /// File parameters. - /// Path parameters. - /// Content type. - /// The Task instance. - public async System.Threading.Tasks.Task CallApiAsync( - String path, Method method, List> queryParams, Object postBody, - Dictionary headerParams, Dictionary formParams, - Dictionary fileParams, Dictionary pathParams, - String contentType) - { - var request = PrepareRequest( - path, method, queryParams, postBody, headerParams, formParams, fileParams, - pathParams, contentType); - InterceptRequest(request); - var response = await RestClient.Execute(request); - InterceptResponse(request, response); - return (Object)response; - } + var apiKey = this.Configuration.GetApiKeyWithPrefix("api-key"); + var partnerKey = this.Configuration.GetApiKeyWithPrefix("partner-key"); + if (string.IsNullOrEmpty(apiKey)) + request.Headers.Add("api-key", apiKey); - /// - /// Escape string (url-encoded). - /// - /// String to be escaped. - /// Escaped string. - public string EscapeString(string str) - { - return UrlEncode(str); - } + if (string.IsNullOrEmpty(partnerKey)) + request.Headers.Add("partner-key", partnerKey); - /// - /// Create FileParameter based on Stream. - /// - /// Parameter name. - /// Input stream. - /// FileParameter. - public FileParameter ParameterToFile(string name, Stream stream) - { - if (stream is FileStream) - return FileParameter.Create(name, ReadAsBytes(stream), Path.GetFileName(((FileStream)stream).Name)); - else - return FileParameter.Create(name, ReadAsBytes(stream), "no_file_name_provided"); - } - - /// - /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. - /// If parameter is a list, join the list with ",". - /// Otherwise just return the string. - /// - /// The parameter (header, path, query, form). - /// Formatted string. - public string ParameterToString(object obj) - { - if (obj is DateTime) - // Return a formatted date string - Can be customized with Configuration.DateTimeFormat - // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") - // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 - // For example: 2009-06-15T13:45:30.0000000 - return ((DateTime)obj).ToString (Configuration.DateTimeFormat); - else if (obj is DateTimeOffset) - // Return a formatted date string - Can be customized with Configuration.DateTimeFormat - // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") - // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 - // For example: 2009-06-15T13:45:30.0000000 - return ((DateTimeOffset)obj).ToString (Configuration.DateTimeFormat); - else if (obj is IList) - { - var flattenedString = new StringBuilder(); - foreach (var param in (IList)obj) - { - if (flattenedString.Length > 0) - flattenedString.Append(","); - flattenedString.Append(param); - } - return flattenedString.ToString(); - } - else if (obj is bool) - return ((bool)obj).ToString().ToLower(); - else - return Convert.ToString (obj); + return request; } /// @@ -284,12 +145,13 @@ public string ParameterToString(object obj) /// The HTTP response. /// Object type. /// Object representation of the JSON string. - public object Deserialize(IRestResponse response, Type type) + public object Deserialize(HttpResponseMessage response, Type type) { - IHttpHeaders headers = response.Headers; + var headers = response.Headers; if (type == typeof(byte[])) // return byte array { - return response.RawBytes; + // TODO + return response.Content.ReadAsByteArrayAsync().Result; } // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) @@ -306,19 +168,21 @@ public object Deserialize(IRestResponse response, Type type) var match = regex.Match(header.ToString()); if (match.Success) { - string fileName = filePath + SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - File.WriteAllBytes(fileName, response.RawBytes); + var fileName = filePath + SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); + + // TODO: use async/await + File.WriteAllBytes(fileName, response.Content.ReadAsByteArrayAsync().Result); return new FileStream(fileName, FileMode.Open); } } } - var stream = new MemoryStream(response.RawBytes); + var stream = new MemoryStream(response.Content.ReadAsByteArrayAsync().Result); return stream; } if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object { - return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind); + return DateTime.Parse(response.Content.ToString(), null, System.Globalization.DateTimeStyles.RoundtripKind); } if (type == typeof(String) || type.Name.StartsWith("System.Nullable")) // return primitive type @@ -329,7 +193,7 @@ public object Deserialize(IRestResponse response, Type type) // at this point, it must be a model (json) try { - return JsonConvert.DeserializeObject(response.Content, type, serializerSettings); + return JsonConvert.DeserializeObject(response.Content.ToString(), type, serializerSettings); } catch (Exception e) { @@ -354,71 +218,6 @@ public String Serialize(object obj) } } - /// - ///Check if the given MIME is a JSON MIME. - ///JSON MIME examples: - /// application/json - /// application/json; charset=UTF8 - /// APPLICATION/JSON - /// application/vnd.company+json - /// - /// MIME - /// Returns True if MIME type is json. - public bool IsJsonMime(String mime) - { - var jsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); - return mime != null && (jsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json")); - } - - /// - /// Select the Content-Type header's value from the given content-type array: - /// if JSON type exists in the given array, use it; - /// otherwise use the first one defined in 'consumes' - /// - /// The Content-Type array to select from. - /// The Content-Type header to use. - public String SelectHeaderContentType(String[] contentTypes) - { - if (contentTypes.Length == 0) - return "application/json"; - - foreach (var contentType in contentTypes) - { - if (IsJsonMime(contentType.ToLower())) - return contentType; - } - - return contentTypes[0]; // use the first content type specified in 'consumes' - } - - /// - /// Select the Accept header's value from the given accepts array: - /// if JSON exists in the given array, use it; - /// otherwise use all of them (joining into a string) - /// - /// The accepts array to select from. - /// The Accept header to use. - public String SelectHeaderAccept(String[] accepts) - { - if (accepts.Length == 0) - return null; - - if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) - return "application/json"; - - return String.Join(",", accepts); - } - - /// - /// Encode string in base64 format. - /// - /// String to be encoded. - /// Encoded string. - public static string Base64Encode(string text) - { - return System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); - } - /// /// Dynamically cast the object into target type. /// @@ -430,60 +229,6 @@ public static dynamic ConvertType(dynamic fromObject, Type toObject) return Convert.ChangeType(fromObject, toObject); } - /// - /// Convert stream to byte array - /// - /// Input stream to be converted - /// Byte array - public static byte[] ReadAsBytes(Stream inputStream) - { - byte[] buf = new byte[16*1024]; - using (MemoryStream ms = new MemoryStream()) - { - int count; - while ((count = inputStream.Read(buf, 0, buf.Length)) > 0) - { - ms.Write(buf, 0, count); - } - return ms.ToArray(); - } - } - - /// - /// URL encode a string - /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 - /// - /// String to be URL encoded - /// Byte array - public static string UrlEncode(string input) - { - const int maxLength = 32766; - - if (input == null) - { - throw new ArgumentNullException("input"); - } - - if (input.Length <= maxLength) - { - return Uri.EscapeDataString(input); - } - - StringBuilder sb = new StringBuilder(input.Length * 2); - int index = 0; - - while (index < input.Length) - { - int length = Math.Min(input.Length - index, maxLength); - string subString = input.Substring(index, length); - - sb.Append(Uri.EscapeDataString(subString)); - index += subString.Length; - } - - return sb.ToString(); - } - /// /// Sanitize filename by removing the path /// @@ -491,7 +236,7 @@ public static string UrlEncode(string input) /// Filename public static string SanitizeFilename(string filename) { - Match match = Regex.Match(filename, @".*[/\\](.*)$"); + var match = Regex.Match(filename, @".*[/\\](.*)$"); if (match.Success) { @@ -502,39 +247,5 @@ public static string SanitizeFilename(string filename) return filename; } } - - /// - /// Convert params to key/value pairs. - /// Use collectionFormat to properly format lists and collections. - /// - /// Key name. - /// Value object. - /// A list of KeyValuePairs - public IEnumerable> ParameterToKeyValuePairs(string collectionFormat, string name, object value) - { - var parameters = new List>(); - - if (IsCollection(value) && collectionFormat == "multi") - { - var valueCollection = value as IEnumerable; - parameters.AddRange(from object item in valueCollection select new KeyValuePair(name, ParameterToString(item))); - } - else - { - parameters.Add(new KeyValuePair(name, ParameterToString(value))); - } - - return parameters; - } - - /// - /// Check if generic object is a collection. - /// - /// - /// True if object is a collection type - private static bool IsCollection(object value) - { - return value is IList || value is ICollection; - } } } diff --git a/src/sib_api_v3_sdk/Client/Configuration.cs b/src/sib_api_v3_sdk/Client/Configuration.cs index c2f2905..b122210 100644 --- a/src/sib_api_v3_sdk/Client/Configuration.cs +++ b/src/sib_api_v3_sdk/Client/Configuration.cs @@ -9,12 +9,9 @@ */ using System; -using System.Reflection; using System.Collections.Concurrent; using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; namespace sib_api_v3_sdk.Client { @@ -229,7 +226,7 @@ public virtual string BasePath { _basePath = value; // pass-through to ApiClient if it's set. if(_apiClient != null) { - _apiClient.RestClient.BaseUrl = new Uri(_basePath); + _apiClient.RestClient.BaseAddress = new Uri(_basePath); } } } @@ -244,7 +241,7 @@ public virtual string BasePath { /// public virtual int Timeout { - get { return (int)ApiClient.RestClient.Timeout.GetValueOrDefault(TimeSpan.FromSeconds(0)).TotalMilliseconds; } + get { return (int)ApiClient.RestClient.Timeout.TotalMilliseconds; } set { ApiClient.RestClient.Timeout = TimeSpan.FromMilliseconds(value); } } @@ -413,7 +410,7 @@ public ApiClient CreateApiClient() /// public static String ToDebugReport() { - String report = "C# SDK (sib_api_v3_sdk) Debug Report:\n"; + var report = "C# SDK (sib_api_v3_sdk) Debug Report:\n"; report += " OS: " + System.Runtime.InteropServices.RuntimeInformation.OSDescription + "\n"; report += " Version of the API: 3.0.0\n"; report += " SDK Package Version: " + Version + "\n"; diff --git a/src/sib_api_v3_sdk/Client/ExceptionFactory.cs b/src/sib_api_v3_sdk/Client/ExceptionFactory.cs index d17ca35..fae6b94 100644 --- a/src/sib_api_v3_sdk/Client/ExceptionFactory.cs +++ b/src/sib_api_v3_sdk/Client/ExceptionFactory.cs @@ -10,15 +10,16 @@ using System; -using RestSharp.Portable; namespace sib_api_v3_sdk.Client { + using System.Net.Http; + /// /// A delegate to ExceptionFactory method /// /// Method name /// Response /// Exceptions - public delegate Exception ExceptionFactory(string methodName, IRestResponse response); + public delegate Exception ExceptionFactory(string methodName, HttpResponseMessage response); } diff --git a/src/sib_api_v3_sdk/Client/IApiAccessor.cs b/src/sib_api_v3_sdk/Client/IApiAccessor.cs index d497924..77b01f9 100644 --- a/src/sib_api_v3_sdk/Client/IApiAccessor.cs +++ b/src/sib_api_v3_sdk/Client/IApiAccessor.cs @@ -10,10 +10,6 @@ using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using RestSharp.Portable; namespace sib_api_v3_sdk.Client { diff --git a/src/sib_api_v3_sdk/sib_api_v3_sdk.csproj b/src/sib_api_v3_sdk/sib_api_v3_sdk.csproj index 8cdba03..e3a593e 100644 --- a/src/sib_api_v3_sdk/sib_api_v3_sdk.csproj +++ b/src/sib_api_v3_sdk/sib_api_v3_sdk.csproj @@ -22,11 +22,11 @@ - - + +