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

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class MimecastApiGatewayRegion(str, enum.Enum):
    GLOBAL = "global"
    """
    Global API Gateway.
    This value maps to the `https://api.services.mimecast.com` endpoint.
    """

    US = "us"
    """
    US API Gateway.
    This value maps to the `https://us-api.services.mimecast.com` endpoint.
    """

    UK = "uk"
    """
    UK API Gateway.
    This value maps to the `https://uk-api.services.mimecast.com` endpoint.
    """

    CUSTOM = "custom"
    """
    Custom API Gateway. Requires setting the **Base URL** field.
    """

    _UNKNOWN = "__MIMECASTAPIGATEWAYREGION_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) -> "MimecastApiGatewayRegion":
        unknown = cls._UNKNOWN
        unknown._value_ = value
        return unknown

    def visit(
        self,
        global_: typing.Callable[[], T_Result],
        us: typing.Callable[[], T_Result],
        uk: typing.Callable[[], T_Result],
        custom: typing.Callable[[], T_Result],
        _unknown_member: typing.Callable[[str], T_Result],
    ) -> T_Result:
        if self is MimecastApiGatewayRegion.GLOBAL:
            return global_()
        if self is MimecastApiGatewayRegion.US:
            return us()
        if self is MimecastApiGatewayRegion.UK:
            return uk()
        if self is MimecastApiGatewayRegion.CUSTOM:
            return custom()
        return _unknown_member(self._value_)
