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

AddRoleToInstanceProfileAsync() public method

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

Same methods

AmazonIdentityManagementServiceClient::AddRoleToInstanceProfileAsync ( AddRoleToInstanceProfileRequest request, System cancellationToken = default(CancellationToken) ) : Task
AmazonIdentityManagementServiceClient