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

DeleteLoginProfileAsync() public method

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

            return InvokeAsync<DeleteLoginProfileRequest,DeleteLoginProfileResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }

Same methods

AmazonIdentityManagementServiceClient::DeleteLoginProfileAsync ( DeleteLoginProfileRequest request, DeleteLoginProfileResponse>.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