deleteUserAttributes method
Deletes the attributes for a user.
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 used in the request to delete user attributes.
Parameter userAttributeNames
:
An array of strings representing the user attribute names you wish to
delete.
For custom attributes, you must prepend the custom:
prefix to
the attribute name.
Implementation
Future<void> deleteUserAttributes({
required String accessToken,
required List<String> userAttributeNames,
}) async {
ArgumentError.checkNotNull(accessToken, 'accessToken');
ArgumentError.checkNotNull(userAttributeNames, 'userAttributeNames');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSCognitoIdentityProviderService.DeleteUserAttributes'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
signed: false,
// TODO queryParams
headers: headers,
payload: {
'AccessToken': accessToken,
'UserAttributeNames': userAttributeNames,
},
);
}