deleteProjectVersion method

Future<DeleteProjectVersionResponse> deleteProjectVersion({
  1. required String projectVersionArn,
})

Deletes an Amazon Rekognition Custom Labels model.

You can't delete a model if it is running or if it is training. To check the status of a model, use the Status field returned from DescribeProjectVersions. To stop a running model call StopProjectVersion. If the model is training, wait until it finishes.

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

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

Parameter projectVersionArn : The Amazon Resource Name (ARN) of the model version that you want to delete.

Implementation

Future<DeleteProjectVersionResponse> deleteProjectVersion({
  required String projectVersionArn,
}) async {
  ArgumentError.checkNotNull(projectVersionArn, 'projectVersionArn');
  _s.validateStringLength(
    'projectVersionArn',
    projectVersionArn,
    20,
    2048,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'RekognitionService.DeleteProjectVersion'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ProjectVersionArn': projectVersionArn,
    },
  );

  return DeleteProjectVersionResponse.fromJson(jsonResponse.body);
}