コード例 #1
0
        /// <summary>
        /// Bulk Send Emails
        /// </summary>
        /// <exception cref="mailslurp.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="bulkSendEmailOptions"></param>
        /// <returns>ApiResponse of Object(void)</returns>
        public mailslurp.Client.ApiResponse <Object> BulkSendEmailsWithHttpInfo(BulkSendEmailOptions bulkSendEmailOptions)
        {
            // verify the required parameter 'bulkSendEmailOptions' is set
            if (bulkSendEmailOptions == null)
            {
                throw new mailslurp.Client.ApiException(400, "Missing required parameter 'bulkSendEmailOptions' when calling BulkActionsControllerApi->BulkSendEmails");
            }

            mailslurp.Client.RequestOptions localVarRequestOptions = new mailslurp.Client.RequestOptions();

            String[] _contentTypes = new String[] {
                "application/json"
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
            };

            var localVarContentType = mailslurp.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = mailslurp.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.Data = bulkSendEmailOptions;

            // authentication (API_KEY) required
            if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("x-api-key")))
            {
                localVarRequestOptions.HeaderParameters.Add("x-api-key", this.Configuration.GetApiKeyWithPrefix("x-api-key"));
            }

            // make the HTTP request
            var localVarResponse = this.Client.Post <Object>("/bulk/send", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("BulkSendEmails", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
コード例 #2
0
        /// <summary>
        /// Bulk Send Emails
        /// </summary>
        /// <exception cref="mailslurp.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="bulkSendEmailOptions"></param>
        /// <returns>Task of ApiResponse</returns>
        public async System.Threading.Tasks.Task <mailslurp.Client.ApiResponse <Object> > BulkSendEmailsAsyncWithHttpInfo(BulkSendEmailOptions bulkSendEmailOptions)
        {
            // verify the required parameter 'bulkSendEmailOptions' is set
            if (bulkSendEmailOptions == null)
            {
                throw new mailslurp.Client.ApiException(400, "Missing required parameter 'bulkSendEmailOptions' when calling BulkActionsControllerApi->BulkSendEmails");
            }


            mailslurp.Client.RequestOptions localVarRequestOptions = new mailslurp.Client.RequestOptions();

            String[] _contentTypes = new String[] {
                "application/json"
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }

            localVarRequestOptions.Data = bulkSendEmailOptions;

            // authentication (API_KEY) required
            if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("x-api-key")))
            {
                localVarRequestOptions.HeaderParameters.Add("x-api-key", this.Configuration.GetApiKeyWithPrefix("x-api-key"));
            }

            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.PostAsync <Object>("/bulk/send", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("BulkSendEmails", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
コード例 #3
0
 /// <summary>
 /// Bulk Send Emails
 /// </summary>
 /// <exception cref="mailslurp.Client.ApiException">Thrown when fails to make API call</exception>
 /// <param name="bulkSendEmailOptions"></param>
 /// <returns>Task of void</returns>
 public async System.Threading.Tasks.Task BulkSendEmailsAsync(BulkSendEmailOptions bulkSendEmailOptions)
 {
     await BulkSendEmailsAsyncWithHttpInfo(bulkSendEmailOptions);
 }
コード例 #4
0
 /// <summary>
 /// Bulk Send Emails
 /// </summary>
 /// <exception cref="mailslurp.Client.ApiException">Thrown when fails to make API call</exception>
 /// <param name="bulkSendEmailOptions"></param>
 /// <returns></returns>
 public void BulkSendEmails(BulkSendEmailOptions bulkSendEmailOptions)
 {
     BulkSendEmailsWithHttpInfo(bulkSendEmailOptions);
 }