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

from ...core.pydantic_utilities import UniversalBaseModel
from .resource_type import ResourceType
import pydantic
import typing
from ...core.pydantic_utilities import IS_PYDANTIC_V2


class SaveEntityRequest(UniversalBaseModel):
    """
    Examples
    --------
    from sayari.resource import SaveEntityRequest

    SaveEntityRequest(
        type="entity",
        project="GNJbkG",
        entity_id="Zk0qOaM2SSYg_ZhsljykMQ",
        custom_fields={"properties": {"custom_name": "Victoria Beckham"}},
    )
    """

    type: ResourceType
    project: str = pydantic.Field()
    """
    The project identifier.
    """

    entity_id: str = pydantic.Field()
    """
    The entity identifier.
    """

    custom_fields: typing.Optional[typing.Any] = pydantic.Field(default=None)
    """
    <Warning>This property is in beta and is subject to change. It is provided for early access and testing purposes only.</Warning> custom user key/value pairs (key must be prefixed with "custom\_" and value must be "string" 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
