Skip to content

list_organization_recommendation_accounts

list_organization_recommendation_accounts(
    organization_recommendation_identifier: OrganizationRecommendationIdentifier,
    *,
    config_overrides: Optional[TrustedAdvisorClientConfig] = None,
    next_token: Optional[str] = None,
    max_results: Optional[int] = None,
    affected_account_id: Optional[AccountId] = None,
) -> ListOrganizationRecommendationAccountsResponse

Lists the accounts that own the resources for an organization aggregate recommendation. This API only supports prioritized recommendations and provides global priority recommendations, eliminating the need to call the API in each AWS Region.

Parameters:

  • next_token (Optional[str], default: None ) –

    The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

  • max_results (Optional[int], default: None ) –

    The maximum number of results to return per page.

  • organization_recommendation_identifier (OrganizationRecommendationIdentifier) –

    The Recommendation identifier

  • affected_account_id (Optional[AccountId], default: None ) –

    An account affected by this organization recommendation

Raises:

Examples:

List all Accounts for an AWS Organization's Recommendation

>>> client.list_organization_recommendation_accounts(organization_recommendation_identifier='arn:aws:trustedadvisor:::organization-recommendation/9534ec9b-bf3a-44e8-8213-2ed68b39d9d5')
Source code in docs_src/capo_trustedadvisor/_services/trusted_advisor.py
def list_organization_recommendation_accounts(
    self,
    organization_recommendation_identifier: "capo_trustedadvisor.types.organization_recommendation_identifier.OrganizationRecommendationIdentifier",
    *,
    config_overrides: Optional[TrustedAdvisorClientConfig] = None,
    next_token: Optional[str] = None,
    max_results: Optional[int] = None,
    affected_account_id: Optional[
        "capo_trustedadvisor.types.account_id.AccountId"
    ] = None,
) -> "capo_trustedadvisor.types.list_organization_recommendation_accounts_response.ListOrganizationRecommendationAccountsResponse":
    """<p>Lists the accounts that own the resources for an organization aggregate recommendation. This API only supports prioritized recommendations and provides global priority recommendations, eliminating the need to call the API in each AWS Region. </p>

    Args:
        next_token: <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results. </p>
        max_results: <p>The maximum number of results to return per page.</p>
        organization_recommendation_identifier: <p>The Recommendation identifier</p>
        affected_account_id: <p>An account affected by this organization recommendation</p>

    Raises:
        capo_trustedadvisor.errors.access_denied_exception.AccessDeniedException: <p>Exception that access has been denied due to insufficient access</p>
        capo_trustedadvisor.errors.internal_server_exception.InternalServerException: <p>Exception to notify that an unexpected internal error occurred during processing of the request</p>
        capo_trustedadvisor.errors.resource_not_found_exception.ResourceNotFoundException: <p>Exception that the requested resource has not been found</p>
        capo_trustedadvisor.errors.throttling_exception.ThrottlingException: <p>Exception to notify that requests are being throttled</p>
        capo_trustedadvisor.errors.validation_exception.ValidationException: <p>Exception that the request failed to satisfy service constraints</p>
        capo_trustedadvisor.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        List all Accounts for an AWS Organization's Recommendation

        >>> client.list_organization_recommendation_accounts(organization_recommendation_identifier='arn:aws:trustedadvisor:::organization-recommendation/9534ec9b-bf3a-44e8-8213-2ed68b39d9d5')
    """

    def _handler(
        req: "OperationRequest[capo_trustedadvisor.types.list_organization_recommendation_accounts_request.ListOrganizationRecommendationAccountsRequest]",
    ) -> OperationResponse[
        "capo_trustedadvisor.types.list_organization_recommendation_accounts_response.ListOrganizationRecommendationAccountsResponse"
    ]:
        import capo_trustedadvisor._operations.trusted_advisor.list_organization_recommendation_accounts

        output, http_response = (
            capo_trustedadvisor._operations.trusted_advisor.list_organization_recommendation_accounts.list_organization_recommendation_accounts(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_trustedadvisor.types.list_organization_recommendation_accounts_response.ListOrganizationRecommendationAccountsResponse",
    ) -> dict[str, Any]:
        import capo_trustedadvisor.types.list_organization_recommendation_accounts_response

        return capo_trustedadvisor.types.list_organization_recommendation_accounts_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "ListOrganizationRecommendationAccounts", redact_output=_redact_output
        ),
    )
    input_: capo_trustedadvisor.types.list_organization_recommendation_accounts_request.ListOrganizationRecommendationAccountsRequest = {
        "organization_recommendation_identifier": organization_recommendation_identifier
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if affected_account_id is not None:
        input_["affected_account_id"] = affected_account_id

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output