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

import typing

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


class TimestampMessage(UniversalBaseModel):
    """
    A word or phoneme level timestamp for the generated audio.
    """

    generation_id: str = pydantic.Field()
    """
    The generation ID of the parent snippet that this chunk corresponds to.
    """

    request_id: str = pydantic.Field()
    """
    ID of the initiating request.
    """

    snippet_id: str = pydantic.Field()
    """
    The ID of the parent snippet that this chunk corresponds to.
    """

    timestamp: Timestamp = pydantic.Field()
    """
    A word or phoneme level timestamp for the generated audio.
    """

    type: typing.Literal["timestamp"] = "timestamp"

    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
