# This file was auto-generated by Fern from our API Definition.

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class ToolType(str, enum.Enum):
    """
    Whether this tool is a `function` or a `webhook` (Only `function` tool supported right now)
    """

    FUNCTION = "function"
    WEBHOOK = "webhook"

    def visit(
        self,
        function: typing.Callable[[], T_Result],
        webhook: typing.Callable[[], T_Result],
    ) -> T_Result:
        if self is ToolType.FUNCTION:
            return function()
        if self is ToolType.WEBHOOK:
            return webhook()
