updateConnectionPreferences method

Future<UpdateConnectionPreferencesResponse> updateConnectionPreferences({
  1. required AccessType accessType,
  2. required String catalog,
  3. required int revision,
  4. List<String>? excludedParticipantIdentifiers,
})

Updates the connection preferences for a partner account, modifying access settings and exclusions.

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

Parameter accessType : The access type setting for connections (e.g., open, restricted, invitation-only).

Parameter catalog : The catalog identifier for the partner account.

Parameter revision : The revision number of the connection preferences for optimistic locking.

Parameter excludedParticipantIdentifiers : The updated list of participant identifiers to exclude from connections.

Implementation

Future<UpdateConnectionPreferencesResponse> updateConnectionPreferences({
  required AccessType accessType,
  required String catalog,
  required int revision,
  List<String>? excludedParticipantIdentifiers,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'PartnerCentralAccount.UpdateConnectionPreferences'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AccessType': accessType.value,
      'Catalog': catalog,
      'Revision': revision,
      if (excludedParticipantIdentifiers != null)
        'ExcludedParticipantIdentifiers': excludedParticipantIdentifiers,
    },
  );

  return UpdateConnectionPreferencesResponse.fromJson(jsonResponse.body);
}