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

import datetime as dt
import typing

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


class UpsertCompanyRequestBody(UniversalBaseModel):
    id: typing.Optional[str] = pydantic.Field(default=None)
    """
    If you know the Schematic ID, you can use that here instead of keys
    """

    keys: typing.Dict[str, str] = pydantic.Field()
    """
    See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information
    """

    last_seen_at: typing.Optional[dt.datetime] = None
    name: typing.Optional[str] = None
    traits: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
    """
    A map of trait names to trait values
    """

    update_only: typing.Optional[bool] = 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
