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

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


class UpdateAttribute(UniversalBaseModel):
    """
    Examples
    --------
    from sayari.attributes import UpdateAttribute

    UpdateAttribute(
        value={
            "street1": "1600 Pennsylvania Avenue NW",
            "city": "Washington DC",
            "state": "Washington DC",
            "postalCode": "20500",
            "country": "US",
        },
        to_date="2024-04-30",
        from_date="2024-01-01",
        date="2024-02-15",
    )
    """

    value: typing.Optional[typing.Any] = pydantic.Field(default=None)
    """
    value of additional information in JSON format
    """

    date: typing.Optional[str] = pydantic.Field(default=None)
    """
    as of date of the attribute
    """

    from_date: typing.Optional[str] = pydantic.Field(default=None)
    """
    start date of the attribute
    """

    to_date: typing.Optional[str] = pydantic.Field(default=None)
    """
    end date of the attribute
    """

    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
