stopDeployment method

Future<StopDeploymentOutput> stopDeployment({
  1. required String deploymentId,
  2. bool? autoRollbackEnabled,
})

Attempts to stop an ongoing deployment.

May throw DeploymentIdRequiredException. May throw DeploymentDoesNotExistException. May throw DeploymentGroupDoesNotExistException. May throw DeploymentAlreadyCompletedException. May throw InvalidDeploymentIdException. May throw UnsupportedActionForDeploymentTypeException.

Parameter deploymentId : The unique ID of a deployment.

Parameter autoRollbackEnabled : Indicates, when a deployment is stopped, whether instances that have been updated should be rolled back to the previous version of the application revision.

Implementation

Future<StopDeploymentOutput> stopDeployment({
  required String deploymentId,
  bool? autoRollbackEnabled,
}) async {
  ArgumentError.checkNotNull(deploymentId, 'deploymentId');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodeDeploy_20141006.StopDeployment'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'deploymentId': deploymentId,
      if (autoRollbackEnabled != null)
        'autoRollbackEnabled': autoRollbackEnabled,
    },
  );

  return StopDeploymentOutput.fromJson(jsonResponse.body);
}