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

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class ApiRegion(str, enum.Enum):
    EUROPE = "eu"
    GERMANY = "de"
    UNITED_STATES = "us"
    CANADA = "ca"
    JAPAN = "jpn"
    _UNKNOWN = "__APIREGION_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) -> "ApiRegion":
        unknown = cls._UNKNOWN
        unknown._value_ = value
        return unknown

    def visit(
        self,
        europe: typing.Callable[[], T_Result],
        germany: typing.Callable[[], T_Result],
        united_states: typing.Callable[[], T_Result],
        canada: typing.Callable[[], T_Result],
        japan: typing.Callable[[], T_Result],
        _unknown_member: typing.Callable[[str], T_Result],
    ) -> T_Result:
        if self is ApiRegion.EUROPE:
            return europe()
        if self is ApiRegion.GERMANY:
            return germany()
        if self is ApiRegion.UNITED_STATES:
            return united_states()
        if self is ApiRegion.CANADA:
            return canada()
        if self is ApiRegion.JAPAN:
            return japan()
        return _unknown_member(self._value_)
