deleteUser method
Allows a user to delete himself or herself.
May throw ResourceNotFoundException. May throw InvalidParameterException. May throw NotAuthorizedException. May throw TooManyRequestsException. May throw PasswordResetRequiredException. May throw UserNotFoundException. May throw UserNotConfirmedException. May throw InternalErrorException.
Parameter accessToken
:
The access token from a request to delete a user.
Implementation
Future<void> deleteUser({
required String accessToken,
}) async {
ArgumentError.checkNotNull(accessToken, 'accessToken');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSCognitoIdentityProviderService.DeleteUser'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
signed: false,
// TODO queryParams
headers: headers,
payload: {
'AccessToken': accessToken,
},
);
}