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

import datetime as dt
import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata


class Provenance(UniversalBaseModel):
    """
    Data provenance.
    """

    integration_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="integrationName")] = (
        pydantic.Field(default=None)
    )
    """
    Name of the integration that produced this entity
    """

    data_type: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="dataType")] = pydantic.Field(
        default=None
    )
    """
    Source data type of this entity. Examples: ADSB, Link16, etc.
    """

    source_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="sourceId")] = pydantic.Field(
        default=None
    )
    """
    An ID that allows an element from a source to be uniquely identified
    """

    source_update_time: typing_extensions.Annotated[
        typing.Optional[dt.datetime], FieldMetadata(alias="sourceUpdateTime")
    ] = pydantic.Field(default=None)
    """
    The time, according to the source system, that the data in the entity was last modified. Generally, this should
     be the time that the source-reported time of validity of the data in the entity. This field must be
     updated with every change to the entity or else Entity Manager will discard the update.
    """

    source_description: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="sourceDescription")] = (
        pydantic.Field(default=None)
    )
    """
    Description of the modification source. In the case of a user this is the email address.
    """

    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
