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

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class FilterType(str, enum.Enum):
    STRING = "string"
    DATETIME = "datetime"
    ENUM = "enum"
    BOOLEAN = "boolean"
    NUMBER = "number"
    _UNKNOWN = "__FILTERTYPE_UNKNOWN__"
    """
    This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`.
    """

    @classmethod
    def _missing_(cls, value: typing.Any) -> "FilterType":
        unknown = cls._UNKNOWN
        unknown._value_ = value
        return unknown

    def visit(
        self,
        string: typing.Callable[[], T_Result],
        datetime: typing.Callable[[], T_Result],
        enum: typing.Callable[[], T_Result],
        boolean: typing.Callable[[], T_Result],
        number: typing.Callable[[], T_Result],
        _unknown_member: typing.Callable[[str], T_Result],
    ) -> T_Result:
        if self is FilterType.STRING:
            return string()
        if self is FilterType.DATETIME:
            return datetime()
        if self is FilterType.ENUM:
            return enum()
        if self is FilterType.BOOLEAN:
            return boolean()
        if self is FilterType.NUMBER:
            return number()
        return _unknown_member(self._value_)
