# 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
from .amazon_tts_params import AmazonTtsParams
from .cartesia_tts_params import CartesiaTtsParams
from .eleven_labs_tts_params import ElevenLabsTtsParams
from .fish_audio_tts_params import FishAudioTtsParams
from .google_tts_params import GoogleTtsParams
from .hume_ai_tts_params import HumeAiTtsParams
from .microsoft_tts_params import MicrosoftTtsParams
from .minimax_tts_params import MinimaxTtsParams
from .murf_tts_params import MurfTtsParams
from .open_ai_tts_params import OpenAiTtsParams
from .rime_tts_params import RimeTtsParams
from .sarvam_tts_params import SarvamTtsParams


class Tts_Microsoft(UncheckedBaseModel):
    vendor: typing.Literal["microsoft"] = "microsoft"
    params: MicrosoftTtsParams
    skip_patterns: typing.Optional[typing.List[int]] = 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 Tts_Elevenlabs(UncheckedBaseModel):
    vendor: typing.Literal["elevenlabs"] = "elevenlabs"
    params: ElevenLabsTtsParams
    skip_patterns: typing.Optional[typing.List[int]] = 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 Tts_Minimax(UncheckedBaseModel):
    vendor: typing.Literal["minimax"] = "minimax"
    params: MinimaxTtsParams
    skip_patterns: typing.Optional[typing.List[int]] = 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 Tts_Murf(UncheckedBaseModel):
    vendor: typing.Literal["murf"] = "murf"
    params: MurfTtsParams
    skip_patterns: typing.Optional[typing.List[int]] = 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 Tts_Cartesia(UncheckedBaseModel):
    vendor: typing.Literal["cartesia"] = "cartesia"
    params: CartesiaTtsParams
    skip_patterns: typing.Optional[typing.List[int]] = 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 Tts_Openai(UncheckedBaseModel):
    vendor: typing.Literal["openai"] = "openai"
    params: OpenAiTtsParams
    skip_patterns: typing.Optional[typing.List[int]] = 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 Tts_Humeai(UncheckedBaseModel):
    vendor: typing.Literal["humeai"] = "humeai"
    params: HumeAiTtsParams
    skip_patterns: typing.Optional[typing.List[int]] = 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 Tts_Rime(UncheckedBaseModel):
    vendor: typing.Literal["rime"] = "rime"
    params: RimeTtsParams
    skip_patterns: typing.Optional[typing.List[int]] = 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 Tts_Fishaudio(UncheckedBaseModel):
    vendor: typing.Literal["fishaudio"] = "fishaudio"
    params: FishAudioTtsParams
    skip_patterns: typing.Optional[typing.List[int]] = 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 Tts_Google(UncheckedBaseModel):
    vendor: typing.Literal["google"] = "google"
    params: GoogleTtsParams
    skip_patterns: typing.Optional[typing.List[int]] = 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 Tts_Amazon(UncheckedBaseModel):
    vendor: typing.Literal["amazon"] = "amazon"
    params: AmazonTtsParams
    skip_patterns: typing.Optional[typing.List[int]] = 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 Tts_Sarvam(UncheckedBaseModel):
    vendor: typing.Literal["sarvam"] = "sarvam"
    params: SarvamTtsParams
    skip_patterns: typing.Optional[typing.List[int]] = 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


Tts = typing_extensions.Annotated[
    typing.Union[
        Tts_Microsoft,
        Tts_Elevenlabs,
        Tts_Minimax,
        Tts_Murf,
        Tts_Cartesia,
        Tts_Openai,
        Tts_Humeai,
        Tts_Rime,
        Tts_Fishaudio,
        Tts_Google,
        Tts_Amazon,
        Tts_Sarvam,
    ],
    UnionMetadata(discriminant="vendor"),
]
