ListAccessKeysAsync() public method

Initiates the asynchronous execution of the ListAccessKeys operation.
public ListAccessKeysAsync ( ListAccessKeysRequest request, System cancellationToken = default(CancellationToken) ) : Task
request ListAccessKeysRequest Container for the necessary parameters to execute the ListAccessKeys operation.
cancellationToken System /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. ///
return Task
Exemplo n.º 1
0
 public static void DeleteAccessKeysForUser(AmazonIdentityManagementServiceClient client, string username)
 {
     ListAccessKeysResponse response = client.ListAccessKeysAsync(new ListAccessKeysRequest() { UserName = username }).Result;
     foreach (AccessKeyMetadata akm in response.AccessKeyMetadata)
     {
         client.DeleteAccessKeyAsync(new DeleteAccessKeyRequest() { UserName = username, AccessKeyId = akm.AccessKeyId }).Wait();
     }
 }