# 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, UniversalBaseModel
from .prompt_detail_template_structure import PromptDetailTemplateStructure
from .prompt_version_detail import PromptVersionDetail


class PromptDetail(UniversalBaseModel):
    id: typing.Optional[str] = None
    name: str
    project_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Project ID. Takes precedence over project_name when both are provided.
    """

    description: typing.Optional[str] = None
    template_structure: typing.Optional[PromptDetailTemplateStructure] = pydantic.Field(default=None)
    """
    Template structure type: 'text' or 'chat'. Immutable after creation.
    """

    tags: typing.Optional[typing.List[str]] = None
    created_at: typing.Optional[dt.datetime] = None
    created_by: typing.Optional[str] = None
    last_updated_at: typing.Optional[dt.datetime] = None
    last_updated_by: typing.Optional[str] = None
    version_count: typing.Optional[int] = None
    latest_version: typing.Optional[PromptVersionDetail] = None
    requested_version: typing.Optional[PromptVersionDetail] = None

    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
