# 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 .dataset_public_status import DatasetPublicStatus
from .dataset_public_type import DatasetPublicType
from .dataset_public_visibility import DatasetPublicVisibility
from .dataset_version_summary_public import DatasetVersionSummaryPublic


class DatasetPublic(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.
    """

    type: typing.Optional[DatasetPublicType] = None
    visibility: typing.Optional[DatasetPublicVisibility] = None
    tags: typing.Optional[typing.List[str]] = None
    description: typing.Optional[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
    experiment_count: typing.Optional[int] = None
    dataset_items_count: typing.Optional[int] = None
    optimization_count: typing.Optional[int] = None
    most_recent_experiment_at: typing.Optional[dt.datetime] = None
    last_created_experiment_at: typing.Optional[dt.datetime] = None
    most_recent_optimization_at: typing.Optional[dt.datetime] = None
    last_created_optimization_at: typing.Optional[dt.datetime] = None
    status: typing.Optional[DatasetPublicStatus] = None
    latest_version: typing.Optional[DatasetVersionSummaryPublic] = 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
