ListUserPoliciesAsync() public method

Initiates the asynchronous execution of the ListUserPolicies operation.
public ListUserPoliciesAsync ( ListUserPoliciesRequest request, System cancellationToken = default(CancellationToken) ) : Task
request ListUserPoliciesRequest Container for the necessary parameters to execute the ListUserPolicies operation.
cancellationToken System /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. ///
return Task
Ejemplo n.º 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();
     }
 }