deleteUser method

Future<void> deleteUser({
  1. required AuthenticationType authenticationType,
  2. required String userName,
})

Deletes a user from the user pool.

May throw ResourceNotFoundException.

Parameter authenticationType : The authentication type for the user. You must specify USERPOOL.

Parameter userName : The email address of the user.

Implementation

Future<void> deleteUser({
  required AuthenticationType authenticationType,
  required String userName,
}) async {
  ArgumentError.checkNotNull(authenticationType, 'authenticationType');
  ArgumentError.checkNotNull(userName, 'userName');
  _s.validateStringLength(
    'userName',
    userName,
    1,
    128,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'PhotonAdminProxyService.DeleteUser'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AuthenticationType': authenticationType.toValue(),
      'UserName': userName,
    },
  );
}