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

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .created_at import CreatedAt
from .media_embedding_task_audio_embedding import MediaEmbeddingTaskAudioEmbedding
from .media_embedding_task_video_embedding import MediaEmbeddingTaskVideoEmbedding
from .updated_at import UpdatedAt


class MediaEmbeddingTask(UniversalBaseModel):
    """
    An embedding task that describes the status of the task and the metadata about the media.
    """

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

    model_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    The name of the video understanding model the platform used to create the embedding.
    """

    status: typing.Optional[str] = pydantic.Field(default=None)
    """
    A string indicating the status of the emedding task. It can take one of the following values: `processing`, `ready` or `failed`.
    """

    created_at: typing.Optional[CreatedAt] = None
    updated_at: typing.Optional[UpdatedAt] = None
    video_embedding: typing.Optional[MediaEmbeddingTaskVideoEmbedding] = pydantic.Field(default=None)
    """
    An object containing the metadata associated with the embedding.
    """

    audio_embedding: typing.Optional[MediaEmbeddingTaskAudioEmbedding] = pydantic.Field(default=None)
    """
    An object containing the metadata associated with the embedding.
    """

    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
