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

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class CreateUserPortalUrlBodyContext(str, enum.Enum):
    """
    `launch`: Generates a short-lived (minutes) portal URL that is intended for launching a user from your
    authenticated web context directly into the Junction User Portal. This URL is not suitable for asynchronous
    communications due to its verbosity as well as short-lived nature.

    `communications`: Generates a long-lived (weeks) but shortened portal URL that is suitable for Emails, SMS
    messages and other communication channels. Users may be asked to verify their identity with Email and SMS
    authentication, e.g., when they open a short link on a new device. ℹ️ This enum is non-exhaustive.
    """

    LAUNCH = "launch"
    COMMUNICATIONS = "communications"
    _UNKNOWN = "__CREATEUSERPORTALURLBODYCONTEXT_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) -> "CreateUserPortalUrlBodyContext":
        unknown = cls._UNKNOWN
        unknown._value_ = value
        return unknown

    def visit(
        self,
        launch: typing.Callable[[], T_Result],
        communications: typing.Callable[[], T_Result],
        _unknown_member: typing.Callable[[str], T_Result],
    ) -> T_Result:
        if self is CreateUserPortalUrlBodyContext.LAUNCH:
            return launch()
        if self is CreateUserPortalUrlBodyContext.COMMUNICATIONS:
            return communications()
        return _unknown_member(self._value_)
