public DeleteAccessKeyAsync ( |
||
request | Container for the necessary parameters to execute the DeleteAccessKey operation. | |
cancellationToken | System | /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// |
return | Task |
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(); } }