createRenewal method

Future<CreateRenewalOutput> createRenewal({
  1. required String outpostIdentifier,
  2. required PaymentOption paymentOption,
  3. required PaymentTerm paymentTerm,
  4. String? clientToken,
})

Creates a renewal contract for the specified Outpost.

May throw AccessDeniedException. May throw InternalServerException. May throw NotFoundException. May throw ValidationException.

Parameter outpostIdentifier : The ID or ARN of the Outpost.

Parameter paymentOption : The payment option.

Parameter paymentTerm : The payment term.

Parameter clientToken : A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

Implementation

Future<CreateRenewalOutput> createRenewal({
  required String outpostIdentifier,
  required PaymentOption paymentOption,
  required PaymentTerm paymentTerm,
  String? clientToken,
}) async {
  final $payload = <String, dynamic>{
    'OutpostIdentifier': outpostIdentifier,
    'PaymentOption': paymentOption.value,
    'PaymentTerm': paymentTerm.value,
    'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/renewals',
    exceptionFnMap: _exceptionFns,
  );
  return CreateRenewalOutput.fromJson(response);
}