listRelationships method

Future<ListRelationshipsResponse> listRelationships({
  1. required String catalog,
  2. List<String>? associatedAccountIds,
  3. List<AssociationType>? associationTypes,
  4. List<String>? displayNames,
  5. int? maxResults,
  6. String? nextToken,
  7. List<String>? programManagementAccountIdentifiers,
  8. ListRelationshipsSortBase? sort,
})

Lists partner relationships based on specified criteria.

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

Parameter catalog : The catalog identifier to filter relationships.

Parameter associatedAccountIds : Filter by associated AWS account IDs.

Parameter associationTypes : Filter by association types.

Parameter displayNames : Filter by display names.

Parameter maxResults : The maximum number of results to return in a single call.

Parameter nextToken : Token for retrieving the next page of results.

Parameter programManagementAccountIdentifiers : Filter by program management account identifiers.

Parameter sort : Sorting options for the results.

Implementation

Future<ListRelationshipsResponse> listRelationships({
  required String catalog,
  List<String>? associatedAccountIds,
  List<AssociationType>? associationTypes,
  List<String>? displayNames,
  int? maxResults,
  String? nextToken,
  List<String>? programManagementAccountIdentifiers,
  ListRelationshipsSortBase? sort,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'PartnerCentralChannel.ListRelationships'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'catalog': catalog,
      if (associatedAccountIds != null)
        'associatedAccountIds': associatedAccountIds,
      if (associationTypes != null)
        'associationTypes': associationTypes.map((e) => e.value).toList(),
      if (displayNames != null) 'displayNames': displayNames,
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
      if (programManagementAccountIdentifiers != null)
        'programManagementAccountIdentifiers':
            programManagementAccountIdentifiers,
      if (sort != null) 'sort': sort,
    },
  );

  return ListRelationshipsResponse.fromJson(jsonResponse.body);
}