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

AttachUserPolicyAsync() public method

Initiates the asynchronous execution of the AttachUserPolicy operation.
public AttachUserPolicyAsync ( AttachUserPolicyRequest request, AttachUserPolicyResponse>.AmazonServiceCallback callback, AsyncOptions options = null ) : void
request Amazon.IdentityManagement.Model.AttachUserPolicyRequest Container for the necessary parameters to execute the AttachUserPolicy operation on AmazonIdentityManagementServiceClient.
callback AttachUserPolicyResponse>.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 AttachUserPolicyAsync(AttachUserPolicyRequest request, AmazonServiceCallback<AttachUserPolicyRequest, AttachUserPolicyResponse> callback, AsyncOptions options = null)
        {
            options = options == null?new AsyncOptions():options;
            var marshaller = new AttachUserPolicyRequestMarshaller();
            var unmarshaller = AttachUserPolicyResponseUnmarshaller.Instance;
            Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
            if(callback !=null )
                callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { 
                    AmazonServiceResult<AttachUserPolicyRequest,AttachUserPolicyResponse> responseObject 
                            = new AmazonServiceResult<AttachUserPolicyRequest,AttachUserPolicyResponse>((AttachUserPolicyRequest)req, (AttachUserPolicyResponse)res, ex , ao.State);    
                        callback(responseObject); 
                };
            BeginInvoke<AttachUserPolicyRequest>(request, marshaller, unmarshaller, options, callbackHelper);
        }

Same methods

AmazonIdentityManagementServiceClient::AttachUserPolicyAsync ( AttachUserPolicyRequest request, System cancellationToken = default(CancellationToken) ) : Task
AmazonIdentityManagementServiceClient