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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .music_upload_response_composition_plan import MusicUploadResponseCompositionPlan
from .word_timestamp import WordTimestamp


class MusicUploadResponse(UncheckedBaseModel):
    """
    Response model for music upload endpoint.
    """

    song_id: str = pydantic.Field()
    """
    Unique identifier for the uploaded song
    """

    composition_plan: typing.Optional[MusicUploadResponseCompositionPlan] = pydantic.Field(default=None)
    """
    The composition plan extracted from the uploaded song. Only present if `extract_composition_plan` was provided in the request body.
    """

    words_timestamps: typing.Optional[typing.List[WordTimestamp]] = pydantic.Field(default=None)
    """
    Word-level timestamps transcribed from the uploaded song. Only present if `with_timestamps` was True in the request body
    """

    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
