deleteCollection method

Future<DeleteCollectionResponse> deleteCollection({
  1. required String collectionId,
})

Deletes the specified collection. Note that this operation removes all faces in the collection. For an example, see delete-collection-procedure.

This operation requires permissions to perform the rekognition:DeleteCollection action.

May throw InvalidParameterException. May throw AccessDeniedException. May throw InternalServerError. May throw ThrottlingException. May throw ProvisionedThroughputExceededException. May throw ResourceNotFoundException.

Parameter collectionId : ID of the collection to delete.

Implementation

Future<DeleteCollectionResponse> deleteCollection({
  required String collectionId,
}) async {
  ArgumentError.checkNotNull(collectionId, 'collectionId');
  _s.validateStringLength(
    'collectionId',
    collectionId,
    1,
    255,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'RekognitionService.DeleteCollection'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'CollectionId': collectionId,
    },
  );

  return DeleteCollectionResponse.fromJson(jsonResponse.body);
}