describeProjectVersions method

Future<DescribeProjectVersionsResponse> describeProjectVersions({
  1. required String projectArn,
  2. int? maxResults,
  3. String? nextToken,
  4. List<String>? versionNames,
})

Lists and describes the models in an Amazon Rekognition Custom Labels project. You can specify up to 10 model versions in ProjectVersionArns. If you don't specify a value, descriptions for all models are returned.

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

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

Parameter projectArn : The Amazon Resource Name (ARN) of the project that contains the models you want to describe.

Parameter maxResults : The maximum number of results to return per paginated call. The largest value you can specify is 100. If you specify a value greater than 100, a ValidationException error occurs. The default value is 100.

Parameter nextToken : If the previous response was incomplete (because there is more results to retrieve), Amazon Rekognition Custom Labels returns a pagination token in the response. You can use this pagination token to retrieve the next set of results.

Parameter versionNames : A list of model version names that you want to describe. You can add up to 10 model version names to the list. If you don't specify a value, all model descriptions are returned. A version name is part of a model (ProjectVersion) ARN. For example, my-model.2020-01-21T09.10.15 is the version name in the following ARN. arn:aws:rekognition:us-east-1:123456789012:project/getting-started/version/my-model.2020-01-21T09.10.15/1234567890123.

Implementation

Future<DescribeProjectVersionsResponse> describeProjectVersions({
  required String projectArn,
  int? maxResults,
  String? nextToken,
  List<String>? versionNames,
}) async {
  ArgumentError.checkNotNull(projectArn, 'projectArn');
  _s.validateStringLength(
    'projectArn',
    projectArn,
    20,
    2048,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    1024,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'RekognitionService.DescribeProjectVersions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ProjectArn': projectArn,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (versionNames != null) 'VersionNames': versionNames,
    },
  );

  return DescribeProjectVersionsResponse.fromJson(jsonResponse.body);
}