rollbackStage method

Future<RollbackStageOutput> rollbackStage({
  1. required String pipelineName,
  2. required String stageName,
  3. required String targetPipelineExecutionId,
})

Rolls back a stage execution.

May throw ConflictException. May throw PipelineExecutionNotFoundException. May throw PipelineExecutionOutdatedException. May throw PipelineNotFoundException. May throw StageNotFoundException. May throw UnableToRollbackStageException. May throw ValidationException.

Parameter pipelineName : The name of the pipeline for which the stage will be rolled back.

Parameter stageName : The name of the stage in the pipeline to be rolled back.

Parameter targetPipelineExecutionId : The pipeline execution ID for the stage to be rolled back to.

Implementation

Future<RollbackStageOutput> rollbackStage({
  required String pipelineName,
  required String stageName,
  required String targetPipelineExecutionId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodePipeline_20150709.RollbackStage'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'pipelineName': pipelineName,
      'stageName': stageName,
      'targetPipelineExecutionId': targetPipelineExecutionId,
    },
  );

  return RollbackStageOutput.fromJson(jsonResponse.body);
}