# 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
from .entity_status import EntityStatus


class Entity(UniversalBaseModel):
    """
    An object that represents an entity with associated assets.
    """

    id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="_id")] = pydantic.Field(default=None)
    """
    The unique identifier of the entity.
    """

    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    The name of the entity.
    """

    description: typing.Optional[str] = pydantic.Field(default=None)
    """
    A description of the entity.
    """

    metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
    """
    Custom metadata for the entity.
    """

    asset_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    An array of asset IDs associated with the entity.
    """

    status: typing.Optional[EntityStatus] = pydantic.Field(default=None)
    """
    The current status of the entity creation process.
    
    **Values**:
    - `processing`: The entity is being processed and is not yet ready for use in searches.
    - `ready`: The entity is fully processed and can be used in search queries.
    """

    created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    The date and time, in RFC 3339 format (“YYYY-MM-DDTHH:mm:ssZ”), when the entity was created.
    """

    updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    The date and time, in RFC 3339 format (“YYYY-MM-DDTHH:mm:ssZ”), when the entity was last updated.
    """

    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
