listPipelineExecutions method

Future<ListPipelineExecutionsResponse> listPipelineExecutions({
  1. required String pipelineName,
  2. DateTime? createdAfter,
  3. DateTime? createdBefore,
  4. int? maxResults,
  5. String? nextToken,
  6. SortPipelineExecutionsBy? sortBy,
  7. SortOrder? sortOrder,
})

Gets a list of the pipeline executions.

May throw ResourceNotFound.

Parameter pipelineName : The name of the pipeline.

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

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

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

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

Parameter sortBy : The field by which to sort results. The default is CreatedTime.

Parameter sortOrder : The sort order for results.

Implementation

Future<ListPipelineExecutionsResponse> listPipelineExecutions({
  required String pipelineName,
  DateTime? createdAfter,
  DateTime? createdBefore,
  int? maxResults,
  String? nextToken,
  SortPipelineExecutionsBy? sortBy,
  SortOrder? sortOrder,
}) async {
  ArgumentError.checkNotNull(pipelineName, 'pipelineName');
  _s.validateStringLength(
    'pipelineName',
    pipelineName,
    1,
    256,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    8192,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.ListPipelineExecutions'
  };
  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 (sortBy != null) 'SortBy': sortBy.toValue(),
      if (sortOrder != null) 'SortOrder': sortOrder.toValue(),
    },
  );

  return ListPipelineExecutionsResponse.fromJson(jsonResponse.body);
}