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

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class DatePartExprDatePart(str, enum.Enum):
    """
    ℹ️ This enum is non-exhaustive.
    """

    MINUTE = "minute"
    HOUR = "hour"
    DAY = "day"
    WEEK = "week"
    MONTH = "month"
    YEAR = "year"
    WEEKDAY = "weekday"
    WEEK_OF_YEAR = "week_of_year"
    DAY_OF_YEAR = "day_of_year"
    _UNKNOWN = "__DATEPARTEXPRDATEPART_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) -> "DatePartExprDatePart":
        unknown = cls._UNKNOWN
        unknown._value_ = value
        return unknown

    def visit(
        self,
        minute: typing.Callable[[], T_Result],
        hour: typing.Callable[[], T_Result],
        day: typing.Callable[[], T_Result],
        week: typing.Callable[[], T_Result],
        month: typing.Callable[[], T_Result],
        year: typing.Callable[[], T_Result],
        weekday: typing.Callable[[], T_Result],
        week_of_year: typing.Callable[[], T_Result],
        day_of_year: typing.Callable[[], T_Result],
        _unknown_member: typing.Callable[[str], T_Result],
    ) -> T_Result:
        if self is DatePartExprDatePart.MINUTE:
            return minute()
        if self is DatePartExprDatePart.HOUR:
            return hour()
        if self is DatePartExprDatePart.DAY:
            return day()
        if self is DatePartExprDatePart.WEEK:
            return week()
        if self is DatePartExprDatePart.MONTH:
            return month()
        if self is DatePartExprDatePart.YEAR:
            return year()
        if self is DatePartExprDatePart.WEEKDAY:
            return weekday()
        if self is DatePartExprDatePart.WEEK_OF_YEAR:
            return week_of_year()
        if self is DatePartExprDatePart.DAY_OF_YEAR:
            return day_of_year()
        return _unknown_member(self._value_)
