# 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_item_source import DatasetItemSource
from .experiment_item import ExperimentItem
from .json_node import JsonNode


class DatasetItem(UniversalBaseModel):
    id: typing.Optional[str] = None
    dataset_item_id: typing.Optional[str] = None
    trace_id: typing.Optional[str] = None
    span_id: typing.Optional[str] = None
    source: DatasetItemSource
    data: JsonNode
    tags: typing.Optional[typing.List[str]] = None
    experiment_items: typing.Optional[typing.List[ExperimentItem]] = None
    dataset_id: typing.Optional[str] = None
    created_at: typing.Optional[dt.datetime] = None
    last_updated_at: typing.Optional[dt.datetime] = None
    created_by: typing.Optional[str] = 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
