"""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 APIConvertTextToSpeechUsingCharacterRequestLanguage(str, Enum):
    r"""The language code of the text"""

    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 APIConvertTextToSpeechUsingCharacterRequestModel(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_2_FLASH = "sona_speech_2_flash"
    SONA_SPEECH_2T = "sona_speech_2t"
    SUPERTONIC_API_1 = "supertonic_api_1"


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

    WAV = "wav"
    MP3 = "mp3"


class APIConvertTextToSpeechUsingCharacterRequestTypedDict(TypedDict):
    text: str
    r"""The text to convert to speech"""
    language: APIConvertTextToSpeechUsingCharacterRequestLanguage
    r"""The language code of the text"""
    style: NotRequired[str]
    r"""The style of character to use for the text-to-speech conversion"""
    model: NotRequired[APIConvertTextToSpeechUsingCharacterRequestModel]
    r"""The model type to use for the text-to-speech conversion"""
    output_format: NotRequired[APIConvertTextToSpeechUsingCharacterRequestOutputFormat]
    r"""The desired output format of the audio file (wav, mp3). Default is wav."""
    voice_settings: NotRequired[ConvertTextToSpeechParametersTypedDict]
    include_phonemes: NotRequired[bool]
    r"""Return phoneme timing data with the audio"""
    normalized_text: NotRequired[str]
    r"""Pre-normalized text for TTS. Only used with sona_speech_2 and sona_speech_2_flash models."""


class APIConvertTextToSpeechUsingCharacterRequest(BaseModel):
    text: str
    r"""The text to convert to speech"""

    language: APIConvertTextToSpeechUsingCharacterRequestLanguage
    r"""The language code of the text"""

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

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

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

    voice_settings: Optional[ConvertTextToSpeechParameters] = None

    include_phonemes: Optional[bool] = False
    r"""Return phoneme timing data with the audio"""

    normalized_text: Optional[str] = None
    r"""Pre-normalized text for TTS. Only used with sona_speech_2 and sona_speech_2_flash models."""
