listPipelineExecutions method

Future<ListPipelineExecutionsOutput> listPipelineExecutions({
  1. required String pipelineName,
  2. int? maxResults,
  3. String? nextToken,
})

Gets a summary of the most recent executions for a pipeline.

May throw ValidationException. May throw PipelineNotFoundException. May throw InvalidNextTokenException.

Parameter pipelineName : The name of the pipeline for which you want to get execution summary information.

Parameter maxResults : The maximum number of results to return in a single call. To retrieve the remaining results, make another call with the returned nextToken value. Pipeline history is limited to the most recent 12 months, based on pipeline execution start times. Default value is 100.

Parameter nextToken : The token that was returned from the previous ListPipelineExecutions call, which can be used to return the next set of pipeline executions in the list.

Implementation

Future<ListPipelineExecutionsOutput> listPipelineExecutions({
  required String pipelineName,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(pipelineName, 'pipelineName');
  _s.validateStringLength(
    'pipelineName',
    pipelineName,
    1,
    100,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    1,
    2048,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodePipeline_20150709.ListPipelineExecutions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'pipelineName': pipelineName,
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return ListPipelineExecutionsOutput.fromJson(jsonResponse.body);
}