startPipelineExecution method

Future<StartPipelineExecutionOutput> startPipelineExecution({
  1. required String name,
  2. String? clientRequestToken,
})

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

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

Parameter name : The name of the pipeline to start.

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

Implementation

Future<StartPipelineExecutionOutput> startPipelineExecution({
  required String name,
  String? clientRequestToken,
}) async {
  ArgumentError.checkNotNull(name, 'name');
  _s.validateStringLength(
    'name',
    name,
    1,
    100,
    isRequired: true,
  );
  _s.validateStringLength(
    'clientRequestToken',
    clientRequestToken,
    1,
    128,
  );
  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(),
    },
  );

  return StartPipelineExecutionOutput.fromJson(jsonResponse.body);
}