Skip to content

list_functions async

list_functions(
    *,
    config_overrides: Optional[AsyncMediaTailorClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[__string] = None,
) -> ListFunctionsResponse

Retrieves all functions associated with your AWS account in the current Region. For more information about functions, see Working with functions in the MediaTailor User Guide.

Parameters:

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

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

    The default value is 100. MediaTailor uses token-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 ListFunctions 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/async_media_tailor.py
async def list_functions(
    self,
    *,
    config_overrides: Optional[AsyncMediaTailorClientConfig] = None,
    max_results: Optional["capo_mediatailor.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_mediatailor.types.__string.__string"] = None,
) -> "capo_mediatailor.types.list_functions_response.ListFunctionsResponse":
    """<p>Retrieves all functions associated with your AWS account in the current Region. For more information about functions, see <a href="https://docs.aws.amazon.com/mediatailor/latest/ug/monetization-functions.html">Working with functions</a> in the <i>MediaTailor User Guide</i>.</p>

    Args:
        max_results: <p>The maximum number of functions that you want MediaTailor to return in response to the current request. If there are more than <code>MaxResults</code> functions, 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 token-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>ListFunctions</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_mediatailor.types.list_functions_request.ListFunctionsRequest]",
    ) -> AsyncOperationResponse[
        "capo_mediatailor.types.list_functions_response.ListFunctionsResponse"
    ]:
        import capo_mediatailor._operations.media_tailor.list_functions

        (
            output,
            http_response,
        ) = await capo_mediatailor._operations.media_tailor.list_functions.async_list_functions(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListFunctions")
    )
    input_: capo_mediatailor.types.list_functions_request.ListFunctionsRequest = {}
    if max_results is not None:
        input_["max_results"] = max_results
    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