cancelAgreement method

Future<void> cancelAgreement({
  1. required String agreementId,
})

Allows an acceptor to cancel an active agreement. Not all agreements are eligible for cancellation. Use the error response to determine why a cancellation request was rejected.

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

Parameter agreementId : The unique identifier of the agreement.

Implementation

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