listConnections method

Future<ListConnectionsResponse> listConnections({
  1. required String catalog,
  2. String? connectionType,
  3. int? maxResults,
  4. String? nextToken,
  5. List<String>? otherParticipantIdentifiers,
})

Lists active connections for the partner account, with optional filtering by connection type and participant.

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

Parameter catalog : The catalog identifier for the partner account.

Parameter connectionType : Filter results by connection type (e.g., reseller, distributor, technology partner).

Parameter maxResults : The maximum number of connections to return in a single response.

Parameter nextToken : The token for retrieving the next page of results in paginated responses.

Parameter otherParticipantIdentifiers : Filter results by specific participant identifiers.

Implementation

Future<ListConnectionsResponse> listConnections({
  required String catalog,
  String? connectionType,
  int? maxResults,
  String? nextToken,
  List<String>? otherParticipantIdentifiers,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'PartnerCentralAccount.ListConnections'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Catalog': catalog,
      if (connectionType != null) 'ConnectionType': connectionType,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (otherParticipantIdentifiers != null)
        'OtherParticipantIdentifiers': otherParticipantIdentifiers,
    },
  );

  return ListConnectionsResponse.fromJson(jsonResponse.body);
}