Skip to content

list_functions async

list_functions(
    *,
    config_overrides: Optional[AsyncCloudFrontClientConfig] = None,
    marker: Optional[string] = None,
    max_items: Optional[integer] = None,
    stage: Optional[FunctionStage] = None,
) -> ListFunctionsResult

Gets a list of all CloudFront functions in your Amazon Web Services account.

You can optionally apply a filter to return only the functions that are in the specified stage, either DEVELOPMENT or LIVE.

You can optionally specify the maximum number of items to receive in the response. If the total number of items in the list exceeds the maximum that you specify, or the default maximum, the response is paginated. To get the next page of items, send a subsequent request that specifies the NextMarker value from the current response as the Marker value in the subsequent request.

Parameters:

  • marker (Optional[string], default: None ) –

    Use this field when paginating results to indicate where to begin in your list of functions. The response includes functions in the list that occur after the marker. To get the next page of the list, set this field's value to the value of NextMarker from the current page's response.

  • max_items (Optional[integer], default: None ) –

    The maximum number of functions that you want in the response.

  • stage (Optional[FunctionStage], default: None ) –

    An optional filter to return only the functions that are in the specified stage, either DEVELOPMENT or LIVE.

Raises:

Source code in docs_src/capo_cloudfront/_services/async_cloud_front.py
async def list_functions(
    self,
    *,
    config_overrides: Optional[AsyncCloudFrontClientConfig] = None,
    marker: Optional["capo_cloudfront.types.string.string"] = None,
    max_items: Optional["capo_cloudfront.types.integer.integer"] = None,
    stage: Optional["capo_cloudfront.types.function_stage.FunctionStage"] = None,
) -> "capo_cloudfront.types.list_functions_result.ListFunctionsResult":
    """<p>Gets a list of all CloudFront functions in your Amazon Web Services account.</p> <p>You can optionally apply a filter to return only the functions that are in the specified stage, either <code>DEVELOPMENT</code> or <code>LIVE</code>.</p> <p>You can optionally specify the maximum number of items to receive in the response. If the total number of items in the list exceeds the maximum that you specify, or the default maximum, the response is paginated. To get the next page of items, send a subsequent request that specifies the <code>NextMarker</code> value from the current response as the <code>Marker</code> value in the subsequent request.</p>

    Args:
        marker: <p>Use this field when paginating results to indicate where to begin in your list of functions. The response includes functions in the list that occur after the marker. To get the next page of the list, set this field's value to the value of <code>NextMarker</code> from the current page's response.</p>
        max_items: <p>The maximum number of functions that you want in the response.</p>
        stage: <p>An optional filter to return only the functions that are in the specified stage, either <code>DEVELOPMENT</code> or <code>LIVE</code>.</p>

    Raises:
        capo_cloudfront.errors.invalid_argument.InvalidArgument: <p>An argument is invalid.</p>
        capo_cloudfront.errors.unsupported_operation.UnsupportedOperation: <p>This operation is not supported in this Amazon Web Services Region.</p>
        capo_cloudfront.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudfront.types.list_functions_request.ListFunctionsRequest]",
    ) -> AsyncOperationResponse[
        "capo_cloudfront.types.list_functions_result.ListFunctionsResult"
    ]:
        import capo_cloudfront._operations.cloudfront2020_05_31.list_functions

        (
            output,
            http_response,
        ) = await capo_cloudfront._operations.cloudfront2020_05_31.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_cloudfront.types.list_functions_request.ListFunctionsRequest = {}
    if marker is not None:
        input_["marker"] = marker
    if max_items is not None:
        input_["max_items"] = max_items
    if stage is not None:
        input_["stage"] = stage

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