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

from __future__ import annotations

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata


class ProjectExternalAudioResponseModelSourceContext_MusicExploreSong(UncheckedBaseModel):
    source_type: typing.Literal["music_explore_song"] = "music_explore_song"
    music_explore_song_id: str
    title: typing.Optional[str] = None
    description: typing.Optional[str] = None
    bpm: typing.Optional[int] = None
    vocals: typing.Optional[str] = None
    lyrics: typing.Optional[str] = None

    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


class ProjectExternalAudioResponseModelSourceContext_Sfx(UncheckedBaseModel):
    source_type: typing.Literal["sfx"] = "sfx"
    sound_generation_history_item_id: typing.Optional[str] = None
    text: typing.Optional[str] = None
    generation_config: typing.Optional[typing.Dict[str, typing.Any]] = None

    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


class ProjectExternalAudioResponseModelSourceContext_Song(UncheckedBaseModel):
    source_type: typing.Literal["song"] = "song"
    song_id: str
    chat_id: typing.Optional[str] = None
    title: typing.Optional[str] = None
    description: typing.Optional[str] = None
    genres: typing.Optional[typing.List[str]] = None
    languages: typing.Optional[typing.List[str]] = None
    is_explicit: typing.Optional[bool] = None
    bpm: typing.Optional[int] = None
    generation_settings: typing.Optional[typing.Dict[str, typing.Any]] = None

    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


ProjectExternalAudioResponseModelSourceContext = typing_extensions.Annotated[
    typing.Union[
        ProjectExternalAudioResponseModelSourceContext_MusicExploreSong,
        ProjectExternalAudioResponseModelSourceContext_Sfx,
        ProjectExternalAudioResponseModelSourceContext_Song,
    ],
    UnionMetadata(discriminant="source_type"),
]
