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

import datetime as dt
import typing

from ..core.datetime_utils import serialize_datetime
from .fine_tuning_response_model import FineTuningResponseModel
from .voice_sample import VoiceSample
from .voice_settings import VoiceSettings
from .voice_sharing_response_model import VoiceSharingResponseModel

try:
    import pydantic.v1 as pydantic  # type: ignore
except ImportError:
    import pydantic  # type: ignore


class VoiceResponse(pydantic.BaseModel):
    voice_id: str
    name: str
    category: str
    labels: typing.Dict[str, str]
    available_for_tiers: typing.List[str]
    high_quality_base_model_ids: typing.List[str]
    samples: typing.Optional[typing.List[VoiceSample]]
    fine_tuning: typing.Optional[FineTuningResponseModel]
    description: typing.Optional[str]
    preview_url: typing.Optional[str]
    settings: typing.Optional[VoiceSettings]
    sharing: typing.Optional[VoiceSharingResponseModel]

    def json(self, **kwargs: typing.Any) -> str:
        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
        return super().json(**kwargs_with_defaults)

    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
        return super().dict(**kwargs_with_defaults)

    class Config:
        frozen = True
        smart_union = True
        json_encoders = {dt.datetime: serialize_datetime}
