rejectConnectionInvitation method

Future<RejectConnectionInvitationResponse> rejectConnectionInvitation({
  1. required String catalog,
  2. required String identifier,
  3. String? clientToken,
  4. String? reason,
})

Rejects a connection invitation from another partner, declining the partnership request.

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

Parameter catalog : The catalog identifier where the connection invitation exists.

Parameter identifier : The unique identifier of the connection invitation to reject.

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

Parameter reason : The reason for rejecting the connection invitation.

Implementation

Future<RejectConnectionInvitationResponse> rejectConnectionInvitation({
  required String catalog,
  required String identifier,
  String? clientToken,
  String? reason,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'PartnerCentralAccount.RejectConnectionInvitation'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Catalog': catalog,
      'Identifier': identifier,
      'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
      if (reason != null) 'Reason': reason,
    },
  );

  return RejectConnectionInvitationResponse.fromJson(jsonResponse.body);
}