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

from ..core.unchecked_base_model import UncheckedBaseModel
from .app_auth_scheme_auth_mode import AppAuthSchemeAuthMode
import typing
from .auth_scheme_field import AuthSchemeField
from ..core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic


class AppAuthScheme(UncheckedBaseModel):
    """
    App authenticatio scheme.
    """

    scheme_name: str
    auth_mode: AppAuthSchemeAuthMode
    fields: typing.List[AuthSchemeField]
    proxy: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
    authorization_url: typing.Optional[str] = None
    token_url: typing.Optional[str] = None
    default_scopes: typing.Optional[typing.List[typing.Optional[typing.Any]]] = None
    token_response_metadata: typing.Optional[typing.List[typing.Optional[typing.Any]]] = None
    client_id: typing.Optional[str] = None
    client_secret: typing.Optional[str] = None

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
