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

from __future__ import annotations
from .predictttsdurationrequest import (
    PredictTTSDurationRequest,
    PredictTTSDurationRequestTypedDict,
)
from supertone.types import BaseModel
from supertone.utils import FieldMetadata, PathParamMetadata, RequestMetadata
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class PredictDurationRequestTypedDict(TypedDict):
    voice_id: str
    predict_tts_duration_request: PredictTTSDurationRequestTypedDict


class PredictDurationRequest(BaseModel):
    voice_id: Annotated[
        str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
    ]

    predict_tts_duration_request: Annotated[
        PredictTTSDurationRequest,
        FieldMetadata(request=RequestMetadata(media_type="application/json")),
    ]


class PredictDurationResponseTypedDict(TypedDict):
    r"""Returns predicted duration of the audio in seconds"""

    duration: NotRequired[float]


class PredictDurationResponse(BaseModel):
    r"""Returns predicted duration of the audio in seconds"""

    duration: Optional[float] = None
