deleteUser method
Deletes the specified UserID within the collection. Faces that are
associated with the UserID are disassociated from the UserID before
deleting the specified UserID. If the specified Collection or
UserID is already deleted or not found, a
ResourceNotFoundException will be thrown. If the action is
successful with a 200 response, an empty HTTP body is returned.
May throw AccessDeniedException.
May throw ConflictException.
May throw IdempotentParameterMismatchException.
May throw InternalServerError.
May throw InvalidParameterException.
May throw ProvisionedThroughputExceededException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
Parameter collectionId :
The ID of an existing collection from which the UserID needs to be
deleted.
Parameter userId :
ID for the UserID to be deleted.
Parameter clientRequestToken :
Idempotent token used to identify the request to DeleteUser.
If you use the same token with multiple DeleteUser requests,
the same response is returned. Use ClientRequestToken to prevent the same
request from being processed more than once.
Implementation
Future<void> deleteUser({
required String collectionId,
required String userId,
String? clientRequestToken,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'RekognitionService.DeleteUser'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'CollectionId': collectionId,
'UserId': userId,
'ClientRequestToken':
clientRequestToken ?? _s.generateIdempotencyToken(),
},
);
}