# 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 .additional_data_string import AdditionalDataString
from .attestation_date import AttestationDate
from .email import Email
from .pci_attestation import PciAttestation
from .sign_date import SignDate
from .signer_acceptance import SignerAcceptance
from .signer_address_1 import SignerAddress1
from .signer_city import SignerCity
from .signer_country import SignerCountry
from .signer_dob import SignerDob
from .signer_name import SignerName
from .signer_phone import SignerPhone
from .signer_ssn import SignerSsn
from .signer_state import SignerState
from .signer_zip import SignerZip
from .signeraddress import Signeraddress


class SignerData(UniversalBaseModel):
    """
    Information about the application's signer.

    Examples
    --------
    from payabli import SignerData

    SignerData(
        address="33 North St",
        address_1="STE 900",
        city="Bristol",
        country="US",
        dob="01/01/1976",
        email="test@email.com",
        name="John Smith",
        phone="555888111",
        ssn="123456789",
        state="TN",
        zip="55555",
        pci_attestation=True,
        signed_document_reference="https://example.com/signed-document.pdf",
        attestation_date="04/20/2025",
        sign_date="04/20/2025",
        additional_data='{"deviceId":"499585-389fj484-3jcj8hj3","session":"fifji4-fiu443-fn4843","timeWithCompany":"6 Years"}',
    )
    """

    signer_uuid: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="signerUuid")] = pydantic.Field(
        default=None
    )
    """
    The signer's ID. This is automatically generated by Payabli.
    """

    name: typing.Optional[SignerName] = None
    ssn: typing.Optional[SignerSsn] = None
    dob: typing.Optional[SignerDob] = None
    phone: typing.Optional[SignerPhone] = None
    email: typing.Optional[Email] = pydantic.Field(default=None)
    """
    The signer's email address.
    """

    address: typing.Optional[Signeraddress] = None
    address_1: typing_extensions.Annotated[typing.Optional[SignerAddress1], FieldMetadata(alias="address1")] = None
    city: typing.Optional[SignerCity] = None
    state: typing.Optional[SignerState] = None
    zip: typing.Optional[SignerZip] = None
    country: typing.Optional[SignerCountry] = None
    acceptance: typing.Optional[SignerAcceptance] = None
    signed_document_reference: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="signedDocumentReference")
    ] = pydantic.Field(default=None)
    """
    Reference to the signed document.
    """

    pci_attestation: typing_extensions.Annotated[
        typing.Optional[PciAttestation], FieldMetadata(alias="pciAttestation")
    ] = None
    attestation_date: typing_extensions.Annotated[
        typing.Optional[AttestationDate], FieldMetadata(alias="attestationDate")
    ] = None
    sign_date: typing_extensions.Annotated[typing.Optional[SignDate], FieldMetadata(alias="signDate")] = None
    additional_data: typing_extensions.Annotated[
        typing.Optional[AdditionalDataString], FieldMetadata(alias="additionalData")
    ] = 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
