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

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class HttpReceiverOAuthStyle(str, enum.Enum):
    """
    How to send client credentials when requesting OAuth access tokens:

    - `in_header`: Send client credentials via HTTP Basic authentication. This is the **recommended and most secure method**, used by most modern OAuth 2.0 providers.
    - `in_params`: Send client credentials URL-encoded in the request body as form parameters. Required by some legacy OAuth servers and specific provider implementations. Consult your OAuth provider documentation for details.
    """

    IN_HEADER = "in_header"
    IN_PARAMS = "in_params"
    _UNKNOWN = "__HTTPRECEIVEROAUTHSTYLE_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) -> "HttpReceiverOAuthStyle":
        unknown = cls._UNKNOWN
        unknown._value_ = value
        return unknown

    def visit(
        self,
        in_header: typing.Callable[[], T_Result],
        in_params: typing.Callable[[], T_Result],
        _unknown_member: typing.Callable[[str], T_Result],
    ) -> T_Result:
        if self is HttpReceiverOAuthStyle.IN_HEADER:
            return in_header()
        if self is HttpReceiverOAuthStyle.IN_PARAMS:
            return in_params()
        return _unknown_member(self._value_)
