Skip to content

list_channels

list_channels(
    *,
    config_overrides: Optional[MediaTailorClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[__string] = None,
) -> ListChannelsResponse

Retrieves information about the channels that are associated with the current AWS account.

Parameters:

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

    The maximum number of channels that you want MediaTailor to return in response to the current request. If there are more than MaxResults channels, use the value of NextToken in the response to get the next page of results.

    The default value is 100. MediaTailor uses DynamoDB-based pagination, which means that a response might contain fewer than MaxResults items, including 0 items, even when more results are available. To retrieve all results, you must continue making requests using the NextToken value from each response until the response no longer includes a NextToken value.

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

    Pagination token returned by the list request when results exceed the maximum allowed. Use the token to fetch the next page of results.

    For the first ListChannels request, omit this value. For subsequent requests, get the value of NextToken from the previous response and specify that value for NextToken in the request. Continue making requests until the response no longer includes a NextToken value, which indicates that all results have been retrieved.

Raises:

Source code in docs_src/capo_mediatailor/_services/media_tailor.py
def list_channels(
    self,
    *,
    config_overrides: Optional[MediaTailorClientConfig] = None,
    max_results: Optional["capo_mediatailor.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_mediatailor.types.__string.__string"] = None,
) -> "capo_mediatailor.types.list_channels_response.ListChannelsResponse":
    """<p>Retrieves information about the channels that are associated with the current AWS account.</p>

    Args:
        max_results: <p>The maximum number of channels that you want MediaTailor to return in response to the current request. If there are more than <code>MaxResults</code> channels, use the value of <code>NextToken</code> in the response to get the next page of results.</p> <p>The default value is 100. MediaTailor uses DynamoDB-based pagination, which means that a response might contain fewer than <code>MaxResults</code> items, including 0 items, even when more results are available. To retrieve all results, you must continue making requests using the <code>NextToken</code> value from each response until the response no longer includes a <code>NextToken</code> value.</p>
        next_token: <p>Pagination token returned by the list request when results exceed the maximum allowed. Use the token to fetch the next page of results.</p> <p>For the first <code>ListChannels</code> request, omit this value. For subsequent requests, get the value of <code>NextToken</code> from the previous response and specify that value for <code>NextToken</code> in the request. Continue making requests until the response no longer includes a <code>NextToken</code> value, which indicates that all results have been retrieved.</p>

    Raises:
        capo_mediatailor.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_mediatailor.types.list_channels_request.ListChannelsRequest]",
    ) -> OperationResponse[
        "capo_mediatailor.types.list_channels_response.ListChannelsResponse"
    ]:
        import capo_mediatailor._operations.media_tailor.list_channels

        output, http_response = (
            capo_mediatailor._operations.media_tailor.list_channels.list_channels(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListChannels")
    )
    input_: capo_mediatailor.types.list_channels_request.ListChannelsRequest = {}
    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