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

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class EncounterSortOptions(str, enum.Enum):
    CREATED_AT_ASC = "created_at:asc"
    CREATED_AT_DESC = "created_at:desc"
    DATE_OF_SERVICE_ASC = "date_of_service:asc"
    DATE_OF_SERVICE_DESC = "date_of_service:desc"
    _UNKNOWN = "__ENCOUNTERSORTOPTIONS_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) -> "EncounterSortOptions":
        unknown = cls._UNKNOWN
        unknown._value_ = value
        return unknown

    def visit(
        self,
        created_at_asc: typing.Callable[[], T_Result],
        created_at_desc: typing.Callable[[], T_Result],
        date_of_service_asc: typing.Callable[[], T_Result],
        date_of_service_desc: typing.Callable[[], T_Result],
        _unknown_member: typing.Callable[[str], T_Result],
    ) -> T_Result:
        if self is EncounterSortOptions.CREATED_AT_ASC:
            return created_at_asc()
        if self is EncounterSortOptions.CREATED_AT_DESC:
            return created_at_desc()
        if self is EncounterSortOptions.DATE_OF_SERVICE_ASC:
            return date_of_service_asc()
        if self is EncounterSortOptions.DATE_OF_SERVICE_DESC:
            return date_of_service_desc()
        return _unknown_member(self._value_)
