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

from ...core.pydantic_utilities import UniversalBaseModel
import pydantic
import typing
from ...core.pydantic_utilities import IS_PYDANTIC_V2


class PostedCustomVoice(UniversalBaseModel):
    """
    A custom voice specifications posted to the server
    """

    name: str = pydantic.Field()
    """
    String with the name of the voice to use. Maximum length of 75 characters. Will be converted to all-uppercase.
    """

    base_voice: str = pydantic.Field()
    """
    The voice the custom voice is based off of.
    """

    speech_rate_multiplier: typing.Optional[float] = pydantic.Field(default=None)
    """
    The speech rate multiplier for this custom voice.
    """

    parameter_model: str = pydantic.Field()
    """
    The name of the parameter model used to define which attributes are used by `parameters`.
    """

    parameters: typing.Optional[typing.Dict[str, typing.Optional[float]]] = pydantic.Field(default=None)
    """
    Voice specification for a Config.
    """

    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
