Skip to content

list_entitlements async

list_entitlements(
    application_arn: ApplicationArn,
    filter: EntitlementFilter,
    *,
    config_overrides: Optional[AsyncAccountAccessClientConfig] = None,
    next_token: Optional[str] = None,
    max_results: Optional[int] = None,
) -> ListEntitlementsResponse

Lists the entitlements for a specified account access manager application. You can filter results by principal, IAM role, or account. Use pagination to ensure that the operation returns quickly and successfully.

Parameters:

  • application_arn (ApplicationArn) –

    Specifies the ARN of the application to list entitlements for.

  • filter (EntitlementFilter) –

    Specifies filter criteria to narrow the entitlements returned. You can filter by principal, IAM role, or account.

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

    Specifies the pagination token from a previous call to retrieve the next set of results.

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

    Specifies the maximum number of results to return in a single call.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this operation.

  • InternalServerException –

    An internal service error occurred. Try your request again later.

  • ResourceNotFoundException –

    The specified resource does not exist. Verify that the resource identifier is correct and that the resource exists in the current Region.

  • ThrottlingException –

    The request was denied due to request throttling. Try your request again later.

  • ValidationException –

    The input does not satisfy the constraints specified by the service. Check your request parameters and retry the request.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_account_access/_services/async_account_access.py
async def list_entitlements(
    self,
    application_arn: "capo_account_access.types.application_arn.ApplicationArn",
    filter: "capo_account_access.types.entitlement_filter.EntitlementFilter",
    *,
    config_overrides: Optional[AsyncAccountAccessClientConfig] = None,
    next_token: Optional[str] = None,
    max_results: Optional[int] = None,
) -> (
    "capo_account_access.types.list_entitlements_response.ListEntitlementsResponse"
):
    """<p>Lists the entitlements for a specified account access manager application. You can filter results by principal, IAM role, or account. Use pagination to ensure that the operation returns quickly and successfully.</p>

    Args:
        application_arn: <p>Specifies the ARN of the application to list entitlements for.</p>
        filter: <p>Specifies filter criteria to narrow the entitlements returned. You can filter by principal, IAM role, or account.</p>
        next_token: <p>Specifies the pagination token from a previous call to retrieve the next set of results.</p>
        max_results: <p>Specifies the maximum number of results to return in a single call.</p>

    Raises:
        capo_account_access.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this operation.</p>
        capo_account_access.errors.internal_server_exception.InternalServerException: <p>An internal service error occurred. Try your request again later.</p>
        capo_account_access.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist. Verify that the resource identifier is correct and that the resource exists in the current Region.</p>
        capo_account_access.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Try your request again later.</p>
        capo_account_access.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by the service. Check your request parameters and retry the request.</p>
        capo_account_access.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_account_access.types.list_entitlements_request.ListEntitlementsRequest]",
    ) -> AsyncOperationResponse[
        "capo_account_access.types.list_entitlements_response.ListEntitlementsResponse"
    ]:
        import capo_account_access._operations.aws_account_access.list_entitlements

        (
            output,
            http_response,
        ) = await capo_account_access._operations.aws_account_access.list_entitlements.async_list_entitlements(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListEntitlements")
    )
    input_: capo_account_access.types.list_entitlements_request.ListEntitlementsRequest = {
        "application_arn": application_arn,
        "filter": filter,
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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