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

DeleteUserAsync() public method

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

            return InvokeAsync<DeleteUserRequest,DeleteUserResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }

Same methods

AmazonIdentityManagementServiceClient::DeleteUserAsync ( DeleteUserRequest request, DeleteUserResponse>.AmazonServiceCallback callback, AsyncOptions options = null ) : void

Usage Example

示例#1
0
        public static void DeleteTestUsers(AmazonIdentityManagementServiceClient client, params string[] usernames)
        {
            UtilityMethods.WaitUntilSuccess(() => {
                foreach (string s in usernames)
                {
                    DeleteAccessKeysForUser(client, s);
                    DeleteUserPoliciesForUser(client, s);
                    DeleteCertificatesForUser(client, s);
                    try 
                    {
                        client.DeleteLoginProfileAsync(new DeleteLoginProfileRequest() { UserName = s }).Wait(); 
                    } catch { }

                    client.DeleteUserAsync(new DeleteUserRequest() { UserName = s }).Wait();
                }
            });
        }
AmazonIdentityManagementServiceClient