Ejemplo n.º 1
0
        /// <summary>
        /// Verify the existence of an email address at a given mail server.
        /// </summary>
        /// <exception cref="mailslurp.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="verifyEmailAddressOptions"></param>
        /// <returns>Task of EmailVerificationResult</returns>
        public async System.Threading.Tasks.Task <EmailVerificationResult> VerifyEmailAddressAsync(VerifyEmailAddressOptions verifyEmailAddressOptions)
        {
            mailslurp.Client.ApiResponse <EmailVerificationResult> localVarResponse = await VerifyEmailAddressAsyncWithHttpInfo(verifyEmailAddressOptions);

            return(localVarResponse.Data);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Verify the existence of an email address at a given mail server.
        /// </summary>
        /// <exception cref="mailslurp.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="verifyEmailAddressOptions"></param>
        /// <returns>Task of ApiResponse (EmailVerificationResult)</returns>
        public async System.Threading.Tasks.Task <mailslurp.Client.ApiResponse <EmailVerificationResult> > VerifyEmailAddressAsyncWithHttpInfo(VerifyEmailAddressOptions verifyEmailAddressOptions)
        {
            // verify the required parameter 'verifyEmailAddressOptions' is set
            if (verifyEmailAddressOptions == null)
            {
                throw new mailslurp.Client.ApiException(400, "Missing required parameter 'verifyEmailAddressOptions' when calling MailServerControllerApi->VerifyEmailAddress");
            }


            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 = verifyEmailAddressOptions;

            // 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 <EmailVerificationResult>("/mail-server/verify/email-address", localVarRequestOptions, this.Configuration);

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

            return(localVarResponse);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Verify the existence of an email address at a given mail server.
 /// </summary>
 /// <exception cref="mailslurp.Client.ApiException">Thrown when fails to make API call</exception>
 /// <param name="verifyEmailAddressOptions"></param>
 /// <returns>EmailVerificationResult</returns>
 public EmailVerificationResult VerifyEmailAddress(VerifyEmailAddressOptions verifyEmailAddressOptions)
 {
     mailslurp.Client.ApiResponse <EmailVerificationResult> localVarResponse = VerifyEmailAddressWithHttpInfo(verifyEmailAddressOptions);
     return(localVarResponse.Data);
 }