cancelImageCreation method

Future<CancelImageCreationResponse> cancelImageCreation({
  1. required String imageBuildVersionArn,
  2. String? clientToken,
})

CancelImageCreation cancels the creation of Image. This operation can only be used on images in a non-terminal state.

May throw ServiceException. May throw ClientException. May throw ServiceUnavailableException. May throw InvalidRequestException. May throw IdempotentParameterMismatchException. May throw ForbiddenException. May throw CallRateLimitExceededException. May throw ResourceInUseException.

Parameter imageBuildVersionArn : The Amazon Resource Name (ARN) of the image whose creation you want to cancel.

Parameter clientToken : The idempotency token used to make this request idempotent.

Implementation

Future<CancelImageCreationResponse> cancelImageCreation({
  required String imageBuildVersionArn,
  String? clientToken,
}) async {
  ArgumentError.checkNotNull(imageBuildVersionArn, 'imageBuildVersionArn');
  _s.validateStringLength(
    'clientToken',
    clientToken,
    1,
    36,
  );
  final $payload = <String, dynamic>{
    'imageBuildVersionArn': imageBuildVersionArn,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/CancelImageCreation',
    exceptionFnMap: _exceptionFns,
  );
  return CancelImageCreationResponse.fromJson(response);
}