# 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
from ..core.unchecked_base_model import UncheckedBaseModel
from .dubbing_media_metadata import DubbingMediaMetadata


class DubbingMetadataResponse(UncheckedBaseModel):
    dubbing_id: str = pydantic.Field()
    """
    The ID of the dubbing project.
    """

    name: str = pydantic.Field()
    """
    The name of the dubbing project.
    """

    status: str = pydantic.Field()
    """
    The state this dub is in.
    """

    source_language: typing.Optional[str] = pydantic.Field(default=None)
    """
    Once dubbing has completed, the ISO-639-1 code of the original media's source language.
    """

    target_languages: typing.List[str] = pydantic.Field()
    """
    The ISO-639-1 code of the languages this media has been dubbed into.
    """

    editable: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether this dubbing project is editable in Dubbing Studio.
    """

    created_at: dt.datetime = pydantic.Field()
    """
    Timestamp this dub was created.
    """

    media_metadata: typing.Optional[DubbingMediaMetadata] = pydantic.Field(default=None)
    """
    Metadata, such as the length in seconds and content type, of the dubbed content.
    """

    error: typing.Optional[str] = pydantic.Field(default=None)
    """
    Error message indicate, if this dub has failed, what happened.
    """

    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
