listTrainedModelVersions method

Future<ListTrainedModelVersionsResponse> listTrainedModelVersions({
  1. required String membershipIdentifier,
  2. required String trainedModelArn,
  3. int? maxResults,
  4. String? nextToken,
  5. TrainedModelStatus? status,
})

Returns a list of trained model versions for a specified trained model. This operation allows you to view all versions of a trained model, including information about their status and creation details. You can use this to track the evolution of your trained models and select specific versions for inference or further training.

May throw AccessDeniedException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter membershipIdentifier : The membership identifier for the collaboration that contains the trained model.

Parameter trainedModelArn : The Amazon Resource Name (ARN) of the trained model for which to list versions.

Parameter maxResults : The maximum number of trained model versions to return in a single page. The default value is 10, and the maximum value is 100.

Parameter nextToken : The pagination token from a previous ListTrainedModelVersions request. Use this token to retrieve the next page of results.

Parameter status : Filter the results to only include trained model versions with the specified status. Valid values include CREATE_PENDING, CREATE_IN_PROGRESS, ACTIVE, CREATE_FAILED, and others.

Implementation

Future<ListTrainedModelVersionsResponse> listTrainedModelVersions({
  required String membershipIdentifier,
  required String trainedModelArn,
  int? maxResults,
  String? nextToken,
  TrainedModelStatus? status,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
    if (status != null) 'status': [status.value],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/memberships/${Uri.encodeComponent(membershipIdentifier)}/trained-models/${Uri.encodeComponent(trainedModelArn)}/versions',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListTrainedModelVersionsResponse.fromJson(response);
}