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

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .bank_section import BankSection
from .document_section_terms_and_conditions import DocumentSectionTermsAndConditions
from .signer_section import SignerSection
from .sub_footer import SubFooter
from .sub_header import SubHeader
from .visible import Visible


class DocumentSection(UniversalBaseModel):
    visble: typing.Optional[Visible] = None
    sub_footer: typing_extensions.Annotated[typing.Optional[SubFooter], FieldMetadata(alias="subFooter")] = None
    sub_header: typing_extensions.Annotated[typing.Optional[SubHeader], FieldMetadata(alias="subHeader")] = None
    deposit_bank: typing_extensions.Annotated[typing.Optional[BankSection], FieldMetadata(alias="depositBank")] = None
    minimum_documents: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="minimumDocuments")] = (
        pydantic.Field(default=None)
    )
    """
    The minimum number of documents the applicant must upload with the application.
    """

    upload_documents: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="uploadDocuments")] = (
        pydantic.Field(default=None)
    )
    """
    When `true`, allows the applicant to upload documents to the application.
    """

    bank_data: typing_extensions.Annotated[typing.Optional[BankSection], FieldMetadata(alias="bankData")] = None
    terms_and_conditions: typing_extensions.Annotated[
        typing.Optional[DocumentSectionTermsAndConditions], FieldMetadata(alias="termsAndConditions")
    ] = None
    signer: typing.Optional[SignerSection] = None
    visible: typing.Optional[Visible] = None
    withdrawal_bank: typing_extensions.Annotated[
        typing.Optional[BankSection], FieldMetadata(alias="withdrawalBank")
    ] = 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
