listPipelineVersions method

Future<ListPipelineVersionsResponse> listPipelineVersions({
  1. required String pipelineName,
  2. DateTime? createdAfter,
  3. DateTime? createdBefore,
  4. int? maxResults,
  5. String? nextToken,
  6. SortOrder? sortOrder,
})

Gets a list of all versions of the pipeline.

May throw ResourceNotFound.

Parameter pipelineName : The Amazon Resource Name (ARN) of the pipeline.

Parameter createdAfter : A filter that returns the pipeline versions that were created after a specified time.

Parameter createdBefore : A filter that returns the pipeline versions that were created before a specified time.

Parameter maxResults : The maximum number of pipeline versions to return in the response.

Parameter nextToken : If the result of the previous ListPipelineVersions request was truncated, the response includes a NextToken. To retrieve the next set of pipeline versions, use this token in your next request.

Parameter sortOrder : The sort order for the results.

Implementation

Future<ListPipelineVersionsResponse> listPipelineVersions({
  required String pipelineName,
  DateTime? createdAfter,
  DateTime? createdBefore,
  int? maxResults,
  String? nextToken,
  SortOrder? sortOrder,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.ListPipelineVersions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'PipelineName': pipelineName,
      if (createdAfter != null)
        'CreatedAfter': unixTimestampToJson(createdAfter),
      if (createdBefore != null)
        'CreatedBefore': unixTimestampToJson(createdBefore),
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (sortOrder != null) 'SortOrder': sortOrder.value,
    },
  );

  return ListPipelineVersionsResponse.fromJson(jsonResponse.body);
}