cancelAgreementCancellationRequest method

Future<CancelAgreementCancellationRequestOutput> cancelAgreementCancellationRequest({
  1. required String agreementCancellationRequestId,
  2. required String agreementId,
  3. required String cancellationReason,
})

Allows sellers (proposers) to withdraw an existing agreement cancellation request that is in a pending state. Once cancelled, the cancellation request transitions to CANCELLED status and can no longer be approved or rejected by the buyer.

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

Parameter agreementCancellationRequestId : The unique identifier of the cancellation request to cancel.

Parameter agreementId : The unique identifier of the agreement associated with the cancellation request.

Parameter cancellationReason : A required message explaining why the cancellation request is being withdrawn (1-2000 characters).

Implementation

Future<CancelAgreementCancellationRequestOutput>
    cancelAgreementCancellationRequest({
  required String agreementCancellationRequestId,
  required String agreementId,
  required String cancellationReason,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target':
        'AWSMPCommerceService_v20200301.CancelAgreementCancellationRequest'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'agreementCancellationRequestId': agreementCancellationRequestId,
      'agreementId': agreementId,
      'cancellationReason': cancellationReason,
    },
  );

  return CancelAgreementCancellationRequestOutput.fromJson(jsonResponse.body);
}