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

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .finetune_created_by import FinetuneCreatedBy
from .finetune_visibility import FinetuneVisibility
from .music_finetune_failure_reason import MusicFinetuneFailureReason
from .music_finetune_status import MusicFinetuneStatus


class MusicFinetuneResponseModel(UncheckedBaseModel):
    id: str = pydantic.Field()
    """
    Unique identifier of the finetune.
    """

    name: str = pydantic.Field()
    """
    Name of the finetune.
    """

    tags: typing.List[str] = pydantic.Field()
    """
    Tags associated with the finetune.
    """

    primary_genre: typing.Optional[str] = pydantic.Field(default=None)
    """
    Primary musical genre of the finetune.
    """

    model_id: str = pydantic.Field()
    """
    The base music model the finetune was trained on.
    """

    created_at: dt.datetime = pydantic.Field()
    """
    When the finetune was created (UTC).
    """

    visibility: FinetuneVisibility = pydantic.Field()
    """
    Who can access this finetune: `private` (only you), `workspace` (members of your workspace), `public` (ElevenLabs-curated, available to everyone).
    """

    created_by: FinetuneCreatedBy = pydantic.Field()
    """
    Who created the finetune: `self`, `workspace`, or `elevenlabs`.
    """

    status: MusicFinetuneStatus = pydantic.Field()
    """
    Training lifecycle status: pending, in_progress, completed, failed, and blocked.
    """

    training_progress: float = pydantic.Field()
    """
    Training progress from 0.0 to 1.0.
    """

    failure_reason: typing.Optional[MusicFinetuneFailureReason] = pydantic.Field(default=None)
    """
    Reason the finetune failed or was blocked, if applicable.
    """

    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
