public bool DeleteEmailAddress(string email) { client = new AmazonSimpleEmailServiceClient(AccessKey, SecretKey); bool result = false; Amazon.SimpleEmail.Model.DeleteVerifiedEmailAddressRequest request = new Amazon.SimpleEmail.Model.DeleteVerifiedEmailAddressRequest(); Amazon.SimpleEmail.Model.DeleteVerifiedEmailAddressResponse response = new Amazon.SimpleEmail.Model.DeleteVerifiedEmailAddressResponse(); if (client != null) { request.EmailAddress = email.Trim(); response = client.DeleteVerifiedEmailAddress(request); if (!string.IsNullOrEmpty(response.ResponseMetadata.RequestId)) { result = true; } } return result; }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.SimpleEmail.Model.DeleteVerifiedEmailAddressRequest(); if (cmdletContext.EmailAddress != null) { request.EmailAddress = cmdletContext.EmailAddress; } CmdletOutput output; // issue call var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; pipelineOutput = cmdletContext.Select(response, this); output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } return(output); }
/// <summary> /// <para>Deletes the specified email address from the list of verified addresses.</para> <para><b>IMPORTANT:</b>The DeleteVerifiedEmailAddress /// action is deprecated as of the May 15, 2012 release of Domain Verification. The DeleteIdentity action is now preferred.</para> <para>This /// action is throttled at one request per second.</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteVerifiedEmailAddress service /// method on AmazonSimpleEmailService.</param> public DeleteVerifiedEmailAddressResponse DeleteVerifiedEmailAddress(DeleteVerifiedEmailAddressRequest request) { var task = DeleteVerifiedEmailAddressAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// Deletes the specified email address from the list of verified addresses. /// /// <important> /// <para> /// The DeleteVerifiedEmailAddress action is deprecated as of the May 15, 2012 release /// of Domain Verification. The DeleteIdentity action is now preferred. /// </para> /// </important> /// <para> /// This action is throttled at one request per second. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteVerifiedEmailAddress service method.</param> /// /// <returns>The response from the DeleteVerifiedEmailAddress service method, as returned by SimpleEmailService.</returns> public DeleteVerifiedEmailAddressResponse DeleteVerifiedEmailAddress(DeleteVerifiedEmailAddressRequest request) { var marshaller = new DeleteVerifiedEmailAddressRequestMarshaller(); var unmarshaller = DeleteVerifiedEmailAddressResponseUnmarshaller.Instance; return Invoke<DeleteVerifiedEmailAddressRequest,DeleteVerifiedEmailAddressResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the DeleteVerifiedEmailAddress operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteVerifiedEmailAddress operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task<DeleteVerifiedEmailAddressResponse> DeleteVerifiedEmailAddressAsync(DeleteVerifiedEmailAddressRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteVerifiedEmailAddressRequestMarshaller(); var unmarshaller = DeleteVerifiedEmailAddressResponseUnmarshaller.Instance; return InvokeAsync<DeleteVerifiedEmailAddressRequest,DeleteVerifiedEmailAddressResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the DeleteVerifiedEmailAddress operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteVerifiedEmailAddress operation on AmazonSimpleEmailServiceClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteVerifiedEmailAddress /// operation.</returns> public IAsyncResult BeginDeleteVerifiedEmailAddress(DeleteVerifiedEmailAddressRequest request, AsyncCallback callback, object state) { var marshaller = new DeleteVerifiedEmailAddressRequestMarshaller(); var unmarshaller = DeleteVerifiedEmailAddressResponseUnmarshaller.Instance; return BeginInvoke<DeleteVerifiedEmailAddressRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// <para>Deletes the specified email address from the list of verified addresses.</para> <para><b>IMPORTANT:</b>The DeleteVerifiedEmailAddress /// action is deprecated as of the May 15, 2012 release of Domain Verification. The DeleteIdentity action is now preferred.</para> /// </summary> /// /// <param name="deleteVerifiedEmailAddressRequest">Container for the necessary parameters to execute the DeleteVerifiedEmailAddress service /// method on AmazonSimpleEmailService.</param> /// public DeleteVerifiedEmailAddressResponse DeleteVerifiedEmailAddress(DeleteVerifiedEmailAddressRequest deleteVerifiedEmailAddressRequest) { IAsyncResult asyncResult = invokeDeleteVerifiedEmailAddress(deleteVerifiedEmailAddressRequest, null, null, true); return EndDeleteVerifiedEmailAddress(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the DeleteVerifiedEmailAddress operation. /// <seealso cref="Amazon.SimpleEmail.AmazonSimpleEmailService.DeleteVerifiedEmailAddress"/> /// </summary> /// /// <param name="deleteVerifiedEmailAddressRequest">Container for the necessary parameters to execute the DeleteVerifiedEmailAddress operation /// on AmazonSimpleEmailService.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> public IAsyncResult BeginDeleteVerifiedEmailAddress(DeleteVerifiedEmailAddressRequest deleteVerifiedEmailAddressRequest, AsyncCallback callback, object state) { return invokeDeleteVerifiedEmailAddress(deleteVerifiedEmailAddressRequest, callback, state, false); }
public static void SESDeleteVerifiedEmailAddress() { #region SESDeleteVerifiedEmailAddress var sesClient = new AmazonSimpleEmailServiceClient(); var request = new DeleteVerifiedEmailAddressRequest { EmailAddress = "*****@*****.**" }; sesClient.DeleteVerifiedEmailAddress(request); #endregion }
private Amazon.SimpleEmail.Model.DeleteVerifiedEmailAddressResponse CallAWSServiceOperation(IAmazonSimpleEmailService client, Amazon.SimpleEmail.Model.DeleteVerifiedEmailAddressRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Simple Email Service (SES)", "DeleteVerifiedEmailAddress"); try { #if DESKTOP return(client.DeleteVerifiedEmailAddress(request)); #elif CORECLR return(client.DeleteVerifiedEmailAddressAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }
IAsyncResult invokeDeleteVerifiedEmailAddress(DeleteVerifiedEmailAddressRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new DeleteVerifiedEmailAddressRequestMarshaller(); var unmarshaller = DeleteVerifiedEmailAddressResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }
/// <summary> /// Initiates the asynchronous execution of the DeleteVerifiedEmailAddress operation. /// <seealso cref="Amazon.SimpleEmail.IAmazonSimpleEmailService.DeleteVerifiedEmailAddress"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteVerifiedEmailAddress operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public async Task<DeleteVerifiedEmailAddressResponse> DeleteVerifiedEmailAddressAsync(DeleteVerifiedEmailAddressRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteVerifiedEmailAddressRequestMarshaller(); var unmarshaller = DeleteVerifiedEmailAddressResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, DeleteVerifiedEmailAddressRequest, DeleteVerifiedEmailAddressResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// <para>Deletes the specified email address from the list of verified /// addresses.</para> /// </summary> /// /// <param name="deleteVerifiedEmailAddressRequest">Container for the /// necessary parameters to execute the DeleteVerifiedEmailAddress service /// method on AmazonSimpleEmailService.</param> /// public DeleteVerifiedEmailAddressResponse DeleteVerifiedEmailAddress(DeleteVerifiedEmailAddressRequest deleteVerifiedEmailAddressRequest) { IRequest<DeleteVerifiedEmailAddressRequest> request = new DeleteVerifiedEmailAddressRequestMarshaller().Marshall(deleteVerifiedEmailAddressRequest); DeleteVerifiedEmailAddressResponse response = Invoke<DeleteVerifiedEmailAddressRequest, DeleteVerifiedEmailAddressResponse> (request, this.signer, DeleteVerifiedEmailAddressResponseUnmarshaller.GetInstance()); return response; }
/// <summary> /// Initiates the asynchronous execution of the DeleteVerifiedEmailAddress operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteVerifiedEmailAddress operation on AmazonSimpleEmailServiceClient.</param> /// <param name="callback">An Action delegate that is invoked when the operation completes.</param> /// <param name="options">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> public void DeleteVerifiedEmailAddressAsync(DeleteVerifiedEmailAddressRequest request, AmazonServiceCallback<DeleteVerifiedEmailAddressRequest, DeleteVerifiedEmailAddressResponse> callback, AsyncOptions options = null) { options = options == null?new AsyncOptions():options; var marshaller = new DeleteVerifiedEmailAddressRequestMarshaller(); var unmarshaller = DeleteVerifiedEmailAddressResponseUnmarshaller.Instance; Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null; if(callback !=null ) callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { AmazonServiceResult<DeleteVerifiedEmailAddressRequest,DeleteVerifiedEmailAddressResponse> responseObject = new AmazonServiceResult<DeleteVerifiedEmailAddressRequest,DeleteVerifiedEmailAddressResponse>((DeleteVerifiedEmailAddressRequest)req, (DeleteVerifiedEmailAddressResponse)res, ex , ao.State); callback(responseObject); }; BeginInvoke<DeleteVerifiedEmailAddressRequest>(request, marshaller, unmarshaller, options, callbackHelper); }
/// <summary> /// <para>Deletes the specified email address from the list of verified addresses.</para> <para><b>IMPORTANT:</b>The DeleteVerifiedEmailAddress /// action is deprecated as of the May 15, 2012 release of Domain Verification. The DeleteIdentity action is now preferred.</para> <para>This /// action is throttled at one request per second.</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteVerifiedEmailAddress service /// method on AmazonSimpleEmailService.</param> public DeleteVerifiedEmailAddressResponse DeleteVerifiedEmailAddress(DeleteVerifiedEmailAddressRequest request) { var task = DeleteVerifiedEmailAddressAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
IAsyncResult invokeDeleteVerifiedEmailAddress(DeleteVerifiedEmailAddressRequest deleteVerifiedEmailAddressRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new DeleteVerifiedEmailAddressRequestMarshaller().Marshall(deleteVerifiedEmailAddressRequest); var unmarshaller = DeleteVerifiedEmailAddressResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the DeleteVerifiedEmailAddress operation. /// <seealso cref="Amazon.SimpleEmail.IAmazonSimpleEmailService.DeleteVerifiedEmailAddress"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteVerifiedEmailAddress operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task<DeleteVerifiedEmailAddressResponse> DeleteVerifiedEmailAddressAsync(DeleteVerifiedEmailAddressRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteVerifiedEmailAddressRequestMarshaller(); var unmarshaller = DeleteVerifiedEmailAddressResponseUnmarshaller.GetInstance(); return Invoke<IRequest, DeleteVerifiedEmailAddressRequest, DeleteVerifiedEmailAddressResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Deletes the verified email address. This disables this email address from being a "sender" in SES /// </summary> /// <param name="emailAddress">Email Address to Remove</param> /// <returns></returns> public bool deleteVerifiedEmail(string emailAddress) { bool ret = false; using (AmazonSimpleEmailServiceClient client = new AmazonSimpleEmailServiceClient(_accessKeyID, _secretAccessKeyID)) { DeleteVerifiedEmailAddressRequest request = new DeleteVerifiedEmailAddressRequest(); request.EmailAddress = emailAddress; DeleteVerifiedEmailAddressResponse response = client.DeleteVerifiedEmailAddress(request); ret = true; } return ret; }