startPipelineExecution method

Future<StartPipelineExecutionOutput> startPipelineExecution({
  1. required String name,
  2. String? clientRequestToken,
  3. List<SourceRevisionOverride>? sourceRevisions,
  4. List<PipelineVariable>? variables,
})

Starts the specified pipeline. Specifically, it begins processing the latest commit to the source location specified as part of the pipeline.

May throw ConcurrentPipelineExecutionsLimitExceededException. May throw ConflictException. May throw PipelineNotFoundException. May throw ValidationException.

Parameter name : The name of the pipeline to start.

Parameter clientRequestToken : The system-generated unique ID used to identify a unique execution request.

Parameter sourceRevisions : A list that allows you to specify, or override, the source revision for a pipeline execution that's being started. A source revision is the version with all the changes to your application code, or source artifact, for the pipeline execution.

Parameter variables : A list that overrides pipeline variables for a pipeline execution that's being started. Variable names must match [A-Za-z0-9@-_]+, and the values can be anything except an empty string.

Implementation

Future<StartPipelineExecutionOutput> startPipelineExecution({
  required String name,
  String? clientRequestToken,
  List<SourceRevisionOverride>? sourceRevisions,
  List<PipelineVariable>? variables,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodePipeline_20150709.StartPipelineExecution'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'name': name,
      'clientRequestToken':
          clientRequestToken ?? _s.generateIdempotencyToken(),
      if (sourceRevisions != null) 'sourceRevisions': sourceRevisions,
      if (variables != null) 'variables': variables,
    },
  );

  return StartPipelineExecutionOutput.fromJson(jsonResponse.body);
}