Skip to content

delete_function

delete_function(
    function_id: __string, *, config_overrides: Optional[MediaTailorClientConfig] = None
) -> DeleteFunctionResponse

Deletes a function. MediaTailor prevents deletion of a function that is still referenced by a playback configuration or by another function. Remove all references before deleting. For more information about functions, see Working with functions in the MediaTailor User Guide.

Parameters:

  • function_id (__string) –

    The identifier of the function to delete.

Raises:

Source code in docs_src/capo_mediatailor/_services/media_tailor.py
def delete_function(
    self,
    function_id: "capo_mediatailor.types.__string.__string",
    *,
    config_overrides: Optional[MediaTailorClientConfig] = None,
) -> "capo_mediatailor.types.delete_function_response.DeleteFunctionResponse":
    """<p>Deletes a function. MediaTailor prevents deletion of a function that is still referenced by a playback configuration or by another function. Remove all references before deleting. 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:
        function_id: <p>The identifier of the function to delete.</p>

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

    def _handler(
        req: "OperationRequest[capo_mediatailor.types.delete_function_request.DeleteFunctionRequest]",
    ) -> OperationResponse[
        "capo_mediatailor.types.delete_function_response.DeleteFunctionResponse"
    ]:
        import capo_mediatailor._operations.media_tailor.delete_function

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteFunction")
    )
    input_: capo_mediatailor.types.delete_function_request.DeleteFunctionRequest = {
        "function_id": function_id
    }

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