Skip to content

list_relationships async

list_relationships(
    catalog: Catalog,
    *,
    config_overrides: Optional[AsyncPartnerCentralChannelClientConfig] = None,
    max_results: Optional[int] = None,
    associated_account_ids: Optional[AccountIdList] = None,
    association_types: Optional[AssociationTypeList] = None,
    display_names: Optional[RelationshipDisplayNameList] = None,
    program_management_account_identifiers: Optional[
        ProgramManagementAccountIdentifierList
    ] = None,
    sort: Optional[ListRelationshipsSortBase] = None,
    next_token: Optional[NextToken] = None,
) -> ListRelationshipsResponse

Lists partner relationships based on specified criteria.

Parameters:

Raises:

Examples:

Example for ListRelationships

>>> await client.list_relationships(catalog='AWS', max_results=100, associated_account_ids=['123456789012'], association_types=['DOWNSTREAM_SELLER'], display_names=['TestDisplayName'], program_management_account_identifiers=['pma-u8ic702rtzng8'], sort={'sortBy': 'UpdatedAt', 'sortOrder': 'Descending'}, next_token='nextToken')
Source code in docs_src/capo_partnercentral_channel/_services/async_partner_central_channel.py
async def list_relationships(
    self,
    catalog: "capo_partnercentral_channel.types.catalog.Catalog",
    *,
    config_overrides: Optional[AsyncPartnerCentralChannelClientConfig] = None,
    max_results: Optional[int] = None,
    associated_account_ids: Optional[
        "capo_partnercentral_channel.types.account_id_list.AccountIdList"
    ] = None,
    association_types: Optional[
        "capo_partnercentral_channel.types.association_type_list.AssociationTypeList"
    ] = None,
    display_names: Optional[
        "capo_partnercentral_channel.types.relationship_display_name_list.RelationshipDisplayNameList"
    ] = None,
    program_management_account_identifiers: Optional[
        "capo_partnercentral_channel.types.program_management_account_identifier_list.ProgramManagementAccountIdentifierList"
    ] = None,
    sort: Optional[
        "capo_partnercentral_channel.types.list_relationships_sort_base.ListRelationshipsSortBase"
    ] = None,
    next_token: Optional[
        "capo_partnercentral_channel.types.next_token.NextToken"
    ] = None,
) -> "capo_partnercentral_channel.types.list_relationships_response.ListRelationshipsResponse":
    """<p>Lists partner relationships based on specified criteria.</p>

    Args:
        catalog: <p>The catalog identifier to filter relationships.</p>
        max_results: <p>The maximum number of results to return in a single call.</p>
        associated_account_ids: <p>Filter by associated AWS account IDs.</p>
        association_types: <p>Filter by association types.</p>
        display_names: <p>Filter by display names.</p>
        program_management_account_identifiers: <p>Filter by program management account identifiers.</p>
        sort: <p>Sorting options for the results.</p>
        next_token: <p>Token for retrieving the next page of results.</p>

    Raises:
        capo_partnercentral_channel.errors.access_denied_exception.AccessDeniedException: <p>The request was denied due to insufficient permissions.</p>
        capo_partnercentral_channel.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred while processing the request.</p>
        capo_partnercentral_channel.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_partnercentral_channel.errors.throttling_exception.ThrottlingException: <p>The request was throttled due to too many requests being sent in a short period.</p>
        capo_partnercentral_channel.errors.validation_exception.ValidationException: <p>The request failed validation due to invalid input parameters.</p>
        capo_partnercentral_channel.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Example for ListRelationships

        >>> await client.list_relationships(catalog='AWS', max_results=100, associated_account_ids=['123456789012'], association_types=['DOWNSTREAM_SELLER'], display_names=['TestDisplayName'], program_management_account_identifiers=['pma-u8ic702rtzng8'], sort={'sortBy': 'UpdatedAt', 'sortOrder': 'Descending'}, next_token='nextToken')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_partnercentral_channel.types.list_relationships_request.ListRelationshipsRequest]",
    ) -> AsyncOperationResponse[
        "capo_partnercentral_channel.types.list_relationships_response.ListRelationshipsResponse"
    ]:
        import capo_partnercentral_channel._operations.partner_central_channel.list_relationships

        (
            output,
            http_response,
        ) = await capo_partnercentral_channel._operations.partner_central_channel.list_relationships.async_list_relationships(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListRelationships")
    )
    input_: capo_partnercentral_channel.types.list_relationships_request.ListRelationshipsRequest = {
        "catalog": catalog
    }
    if max_results is not None:
        input_["max_results"] = max_results
    if associated_account_ids is not None:
        input_["associated_account_ids"] = associated_account_ids
    if association_types is not None:
        input_["association_types"] = association_types
    if display_names is not None:
        input_["display_names"] = display_names
    if program_management_account_identifiers is not None:
        input_["program_management_account_identifiers"] = (
            program_management_account_identifiers
        )
    if sort is not None:
        input_["sort"] = sort
    if next_token is not None:
        input_["next_token"] = next_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output