"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from .converttexttospeechparameters import (
    ConvertTextToSpeechParameters,
    ConvertTextToSpeechParametersTypedDict,
)
from enum import Enum
from supertone.types import BaseModel
from typing import Optional
from typing_extensions import NotRequired, TypedDict


class PredictTTSDurationRequestLanguage(str, Enum):
    r"""Language code of the voice"""

    EN = "en"
    KO = "ko"
    JA = "ja"
    BG = "bg"
    CS = "cs"
    DA = "da"
    EL = "el"
    ES = "es"
    ET = "et"
    FI = "fi"
    HU = "hu"
    IT = "it"
    NL = "nl"
    PL = "pl"
    PT = "pt"
    RO = "ro"
    AR = "ar"
    DE = "de"
    FR = "fr"
    HI = "hi"
    ID = "id"
    RU = "ru"
    VI = "vi"


class PredictTTSDurationRequestModel(str, Enum):
    r"""The model type to use for the text-to-speech conversion"""

    SONA_SPEECH_1 = "sona_speech_1"
    SONA_SPEECH_2 = "sona_speech_2"
    SONA_SPEECH_2T = "sona_speech_2t"
    SONA_SPEECH_2_FLASH = "sona_speech_2_flash"
    SUPERTONIC_API_1 = "supertonic_api_1"


class PredictTTSDurationRequestOutputFormat(str, Enum):
    r"""The desired output format of the audio file (wav, mp3). Default is wav."""

    WAV = "wav"
    MP3 = "mp3"


class PredictTTSDurationRequestTypedDict(TypedDict):
    text: str
    r"""The text to convert to speech. Max length is 300 characters."""
    language: PredictTTSDurationRequestLanguage
    r"""Language code of the voice"""
    style: NotRequired[str]
    r"""The style of character to use for the text-to-speech conversion"""
    model: NotRequired[PredictTTSDurationRequestModel]
    r"""The model type to use for the text-to-speech conversion"""
    output_format: NotRequired[PredictTTSDurationRequestOutputFormat]
    r"""The desired output format of the audio file (wav, mp3). Default is wav."""
    voice_settings: NotRequired[ConvertTextToSpeechParametersTypedDict]


class PredictTTSDurationRequest(BaseModel):
    text: str
    r"""The text to convert to speech. Max length is 300 characters."""

    language: PredictTTSDurationRequestLanguage
    r"""Language code of the voice"""

    style: Optional[str] = None
    r"""The style of character to use for the text-to-speech conversion"""

    model: Optional[PredictTTSDurationRequestModel] = (
        PredictTTSDurationRequestModel.SONA_SPEECH_1
    )
    r"""The model type to use for the text-to-speech conversion"""

    output_format: Optional[PredictTTSDurationRequestOutputFormat] = (
        PredictTTSDurationRequestOutputFormat.WAV
    )
    r"""The desired output format of the audio file (wav, mp3). Default is wav."""

    voice_settings: Optional[ConvertTextToSpeechParameters] = None
