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

import enum
import typing

T_Result = typing.TypeVar("T_Result")


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

    MINUTE = "minute"
    HOUR = "hour"
    DAY = "day"
    WEEK = "week"
    MONTH = "month"
    YEAR = "year"

    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],
    ) -> T_Result:
        if self is PeriodUnit.MINUTE:
            return minute()
        if self is PeriodUnit.HOUR:
            return hour()
        if self is PeriodUnit.DAY:
            return day()
        if self is PeriodUnit.WEEK:
            return week()
        if self is PeriodUnit.MONTH:
            return month()
        if self is PeriodUnit.YEAR:
            return year()
