Amazon.IdentityManagement.AmazonIdentityManagementServiceClient.EnableMFADeviceAsync C# (CSharp) Method

EnableMFADeviceAsync() public method

Initiates the asynchronous execution of the EnableMFADevice operation.
public EnableMFADeviceAsync ( EnableMFADeviceRequest request, EnableMFADeviceResponse>.AmazonServiceCallback callback, AsyncOptions options = null ) : void
request Amazon.IdentityManagement.Model.EnableMFADeviceRequest Container for the necessary parameters to execute the EnableMFADevice operation on AmazonIdentityManagementServiceClient.
callback EnableMFADeviceResponse>.AmazonServiceCallback An Action delegate that is invoked when the operation completes.
options Amazon.Runtime.AsyncOptions A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.
return void
        public void EnableMFADeviceAsync(EnableMFADeviceRequest request, AmazonServiceCallback<EnableMFADeviceRequest, EnableMFADeviceResponse> callback, AsyncOptions options = null)
        {
            options = options == null?new AsyncOptions():options;
            var marshaller = new EnableMFADeviceRequestMarshaller();
            var unmarshaller = EnableMFADeviceResponseUnmarshaller.Instance;
            Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
            if(callback !=null )
                callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { 
                    AmazonServiceResult<EnableMFADeviceRequest,EnableMFADeviceResponse> responseObject 
                            = new AmazonServiceResult<EnableMFADeviceRequest,EnableMFADeviceResponse>((EnableMFADeviceRequest)req, (EnableMFADeviceResponse)res, ex , ao.State);    
                        callback(responseObject); 
                };
            BeginInvoke<EnableMFADeviceRequest>(request, marshaller, unmarshaller, options, callbackHelper);
        }

Same methods

AmazonIdentityManagementServiceClient::EnableMFADeviceAsync ( EnableMFADeviceRequest request, System cancellationToken = default(CancellationToken) ) : Task
AmazonIdentityManagementServiceClient