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

DeleteUserPolicyAsync() public method

Initiates the asynchronous execution of the DeleteUserPolicy operation.
public DeleteUserPolicyAsync ( DeleteUserPolicyRequest request, System cancellationToken = default(CancellationToken) ) : Task
request Amazon.IdentityManagement.Model.DeleteUserPolicyRequest Container for the necessary parameters to execute the DeleteUserPolicy operation.
cancellationToken System /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. ///
return Task
        public Task<DeleteUserPolicyResponse> DeleteUserPolicyAsync(DeleteUserPolicyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new DeleteUserPolicyRequestMarshaller();
            var unmarshaller = DeleteUserPolicyResponseUnmarshaller.Instance;

            return InvokeAsync<DeleteUserPolicyRequest,DeleteUserPolicyResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }

Same methods

AmazonIdentityManagementServiceClient::DeleteUserPolicyAsync ( DeleteUserPolicyRequest request, DeleteUserPolicyResponse>.AmazonServiceCallback callback, AsyncOptions options = null ) : void

Usage Example

示例#1
0
 public static void DeleteUserPoliciesForUser(AmazonIdentityManagementServiceClient client, string username)
 {
     ListUserPoliciesResponse response =
         client.ListUserPoliciesAsync(new ListUserPoliciesRequest() { UserName = username }).Result;
     foreach (string pName in response.PolicyNames)
     {
         client.DeleteUserPolicyAsync(new DeleteUserPolicyRequest() { UserName = username, PolicyName = pName }).Wait();
     }
 }
AmazonIdentityManagementServiceClient