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

from ...core.pydantic_utilities import UniversalBaseModel
import pydantic
from .posted_custom_voice_base_voice import PostedCustomVoiceBaseVoice
import typing
from .posted_custom_voice_parameters import PostedCustomVoiceParameters
from ...core.pydantic_utilities import IS_PYDANTIC_V2


class PostedCustomVoice(UniversalBaseModel):
    """
    A Custom Voice specification to be associated with this Config.

    If a Custom Voice specification is not provided then the [name](/reference/empathic-voice-interface-evi/configs/create-config#request.body.voice.name) of a base voice or previously created Custom Voice must be provided.

    See our [Voices guide](/docs/empathic-voice-interface-evi/voices) for a tutorial on how to craft a Custom Voice.
    """

    name: str = pydantic.Field()
    """
    The name of the Custom Voice. Maximum length of 75 characters. Will be converted to all-uppercase. (e.g., "sample voice" becomes "SAMPLE VOICE")
    """

    base_voice: PostedCustomVoiceBaseVoice = pydantic.Field()
    """
    Specifies the base voice used to create the Custom Voice.
    """

    parameter_model: typing.Literal["20241004-11parameter"] = pydantic.Field(default="20241004-11parameter")
    """
    The name of the parameter model used to define which attributes are used by the `parameters` field. Currently, only `20241004-11parameter` is supported as the parameter model.
    """

    parameters: typing.Optional[PostedCustomVoiceParameters] = pydantic.Field(default=None)
    """
    The specified attributes of a Custom Voice.
    
    If no parameters are specified then all attributes will be set to their defaults, meaning no modfications will be made to the base voice.
    """

    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
