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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .auth_field_schema import AuthFieldSchema


class AuthSchemaResponse(UniversalBaseModel):
    """
    Response for auth schema endpoint.
    """

    connector_type: str = pydantic.Field()
    """
    Connector type key
    """

    auth_type: str = pydantic.Field()
    """
    Authentication type: oauth, credentials
    """

    display_name: str = pydantic.Field()
    """
    Human-readable connector name
    """

    fields: typing.Optional[typing.List[AuthFieldSchema]] = pydantic.Field(default=None)
    """
    Required credential fields (empty for OAuth)
    """

    submit_endpoint: typing.Optional[str] = pydantic.Field(default=None)
    """
    API endpoint to POST credentials to (for credentials auth type)
    """

    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
