cancelEnvironmentDeployment method

Future<CancelEnvironmentDeploymentOutput> cancelEnvironmentDeployment({
  1. required String environmentName,
})

Attempts to cancel an environment deployment on an UpdateEnvironment action, if the deployment is IN_PROGRESS. For more information, see Update an environment in the Proton User guide.

The following list includes potential cancellation scenarios.

  • If the cancellation attempt succeeds, the resulting deployment state is CANCELLED.
  • If the cancellation attempt fails, the resulting deployment state is FAILED.
  • If the current UpdateEnvironment action succeeds before the cancellation attempt starts, the resulting deployment state is SUCCEEDED and the cancellation attempt has no effect.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter environmentName : The name of the environment with the deployment to cancel.

Implementation

Future<CancelEnvironmentDeploymentOutput> cancelEnvironmentDeployment({
  required String environmentName,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AwsProton20200720.CancelEnvironmentDeployment'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'environmentName': environmentName,
    },
  );

  return CancelEnvironmentDeploymentOutput.fromJson(jsonResponse.body);
}