cancelSubscriptionChange method

Future<CancelSubscriptionChangeOutput> cancelSubscriptionChange({
  1. required String arn,
  2. required String ifMatch,
  3. String? clientToken,
})

Cancels a pending scheduled change on a subscription, such as a pending downgrade or cancellation. The subscription returns to its state before the change was scheduled.

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

Parameter arn : The ARN of the subscription whose pending change you want to cancel.

Parameter ifMatch : The ETag value from a previous GetSubscription or ListSubscriptions response.

Parameter clientToken : A unique, case-sensitive identifier that you provide to ensure the request is handled only once.

Implementation

Future<CancelSubscriptionChangeOutput> cancelSubscriptionChange({
  required String arn,
  required String ifMatch,
  String? clientToken,
}) async {
  final headers = <String, String>{
    'If-Match': ifMatch.toString(),
  };
  final $payload = <String, dynamic>{
    'arn': arn,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
  };
  final response = await _protocol.sendRaw(
    payload: $payload,
    method: 'POST',
    requestUri: '/v1/CancelSubscriptionChange',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  final $json = await _s.jsonFromResponse(response);
  return CancelSubscriptionChangeOutput(
    subscription: Subscription.fromJson($json),
    eTag: _s.extractHeaderStringValue(response.headers, 'ETag')!,
  );
}