Skip to content

list_entitlements

list_entitlements(
    *,
    config_overrides: Optional[MediaConnectClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[str] = None,
) -> ListEntitlementsResponse

Displays a list of all entitlements that have been granted to this account. This request returns 20 results per page.

Parameters:

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

    The maximum number of results to return per API request.

    For example, you submit a ListEntitlements request with set at 5. Although 20 items match your request, the service returns no more than the first 5 items. (The service also returns a NextToken value that you can use to fetch the next batch of results.)

    The service might return fewer results than the MaxResults value. If MaxResults is not included in the request, the service defaults to pagination with a maximum of 20 results per page.

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

    The token that identifies the batch of results that you want to see.

    For example, you submit a ListEntitlements request with MaxResults set at 5. The service returns the first batch of results (up to 5) and a NextToken value. To see the next batch of results, you can submit the ListEntitlements request a second time and specify the NextToken value.

Raises:

Source code in docs_src/capo_mediaconnect/_services/media_connect.py
def list_entitlements(
    self,
    *,
    config_overrides: Optional[MediaConnectClientConfig] = None,
    max_results: Optional["capo_mediaconnect.types.max_results.MaxResults"] = None,
    next_token: Optional[str] = None,
) -> "capo_mediaconnect.types.list_entitlements_response.ListEntitlementsResponse":
    """<p> Displays a list of all entitlements that have been granted to this account. This request returns 20 results per page.</p>

    Args:
        max_results: <p> The maximum number of results to return per API request. </p> <p>For example, you submit a <code>ListEntitlements</code> request with set at 5. Although 20 items match your request, the service returns no more than the first 5 items. (The service also returns a NextToken value that you can use to fetch the next batch of results.) </p> <p>The service might return fewer results than the <code>MaxResults</code> value. If <code>MaxResults</code> is not included in the request, the service defaults to pagination with a maximum of 20 results per page.</p>
        next_token: <p> The token that identifies the batch of results that you want to see. </p> <p>For example, you submit a <code>ListEntitlements</code> request with <code>MaxResults</code> set at 5. The service returns the first batch of results (up to 5) and a <code>NextToken</code> value. To see the next batch of results, you can submit the <code>ListEntitlements</code> request a second time and specify the <code>NextToken</code> value.</p>

    Raises:
        capo_mediaconnect.errors.bad_request_exception.BadRequestException: <p>This exception is thrown if the request contains a semantic error. The precise meaning depends on the API, and is documented in the error message. </p>
        capo_mediaconnect.errors.internal_server_error_exception.InternalServerErrorException: <p>The server encountered an internal error and is unable to complete the request. </p>
        capo_mediaconnect.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is currently unavailable or busy. </p>
        capo_mediaconnect.errors.too_many_requests_exception.TooManyRequestsException: <p>The request was denied due to request throttling. </p>
        capo_mediaconnect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_mediaconnect.types.list_entitlements_request.ListEntitlementsRequest]",
    ) -> OperationResponse[
        "capo_mediaconnect.types.list_entitlements_response.ListEntitlementsResponse"
    ]:
        import capo_mediaconnect._operations.media_connect.list_entitlements

        output, http_response = (
            capo_mediaconnect._operations.media_connect.list_entitlements.list_entitlements(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

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

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