# 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 .forms_person_object_response_body_entry_type import FormsPersonObjectResponseBodyEntryType
from .forms_polymorphic_user_object_response_body import FormsPolymorphicUserObjectResponseBody


class FormsPersonObjectResponseBody(UniversalBaseModel):
    """
    Tracked or untracked (i.e. manually entered) person object.
    """

    entry_type: typing_extensions.Annotated[
        FormsPersonObjectResponseBodyEntryType,
        FieldMetadata(alias="entryType"),
        pydantic.Field(
            alias="entryType", description="The type of entry for the person.  Valid values: `tracked`, `untracked`"
        ),
    ]
    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Name of an untracked (i.e. manually entered) person.
    """

    polymorphic_user_id: typing_extensions.Annotated[
        typing.Optional[FormsPolymorphicUserObjectResponseBody],
        FieldMetadata(alias="polymorphicUserId"),
        pydantic.Field(alias="polymorphicUserId"),
    ] = 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
