disableStageTransition method

Future<void> disableStageTransition({
  1. required String pipelineName,
  2. required String reason,
  3. required String stageName,
  4. required StageTransitionType transitionType,
})

Prevents artifacts in a pipeline from transitioning to the next stage in the pipeline.

May throw ValidationException. May throw PipelineNotFoundException. May throw StageNotFoundException.

Parameter pipelineName : The name of the pipeline in which you want to disable the flow of artifacts from one stage to another.

Parameter reason : The reason given to the user that a stage is disabled, such as waiting for manual approval or manual tests. This message is displayed in the pipeline console UI.

Parameter stageName : The name of the stage where you want to disable the inbound or outbound transition of artifacts.

Parameter transitionType : Specifies whether artifacts are prevented from transitioning into the stage and being processed by the actions in that stage (inbound), or prevented from transitioning from the stage after they have been processed by the actions in that stage (outbound).

Implementation

Future<void> disableStageTransition({
  required String pipelineName,
  required String reason,
  required String stageName,
  required StageTransitionType transitionType,
}) async {
  ArgumentError.checkNotNull(pipelineName, 'pipelineName');
  _s.validateStringLength(
    'pipelineName',
    pipelineName,
    1,
    100,
    isRequired: true,
  );
  ArgumentError.checkNotNull(reason, 'reason');
  _s.validateStringLength(
    'reason',
    reason,
    1,
    300,
    isRequired: true,
  );
  ArgumentError.checkNotNull(stageName, 'stageName');
  _s.validateStringLength(
    'stageName',
    stageName,
    1,
    100,
    isRequired: true,
  );
  ArgumentError.checkNotNull(transitionType, 'transitionType');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodePipeline_20150709.DisableStageTransition'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'pipelineName': pipelineName,
      'reason': reason,
      'stageName': stageName,
      'transitionType': transitionType.toValue(),
    },
  );
}