# 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 .evaluator_item_public import EvaluatorItemPublic
from .execution_policy_public import ExecutionPolicyPublic


class DatasetVersionPublic(UniversalBaseModel):
    id: typing.Optional[str] = None
    dataset_id: typing.Optional[str] = None
    version_hash: typing.Optional[str] = None
    tags: typing.Optional[typing.List[str]] = None
    is_latest: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Indicates whether this is the latest version of the dataset
    """

    version_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Sequential version name formatted as 'v1', 'v2', etc.
    """

    items_total: typing.Optional[int] = pydantic.Field(default=None)
    """
    Total number of items in this version
    """

    items_added: typing.Optional[int] = pydantic.Field(default=None)
    """
    Number of items added since last version
    """

    items_modified: typing.Optional[int] = pydantic.Field(default=None)
    """
    Number of items modified since last version
    """

    items_deleted: typing.Optional[int] = pydantic.Field(default=None)
    """
    Number of items deleted since last version
    """

    change_description: typing.Optional[str] = None
    metadata: typing.Optional[typing.Dict[str, str]] = None
    evaluators: typing.Optional[typing.List[EvaluatorItemPublic]] = pydantic.Field(default=None)
    """
    Default evaluators for items in this version
    """

    execution_policy: typing.Optional[ExecutionPolicyPublic] = 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

    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
