# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import List, Union, Optional
from datetime import datetime
from typing_extensions import Literal, TypeAlias

from ..._models import BaseModel
from .artifact_schema_generation import ArtifactSchemaGeneration
from .generation_test_case_schema import GenerationTestCaseSchema
from ..auto_generated_draft_test_case_missing_chunk_info import AutoGeneratedDraftTestCaseMissingChunkInfo

__all__ = ["AutoGeneratedDraftTestCasesList", "Item", "ItemTestCaseData"]

ItemTestCaseData: TypeAlias = Union[ArtifactSchemaGeneration, GenerationTestCaseSchema]


class Item(BaseModel):
    id: str
    """The unique identifier of the entity."""

    account_id: str
    """The ID of the account that owns the given entity."""

    approved: bool
    """Boolean to track whether or not the draft test case is approved"""

    content_metadata: object
    """
    Metadata for the chunks and artifacts that were used to generate this draft test
    case.
    """

    created_at: datetime
    """The date and time when the entity was created in ISO format."""

    created_by_user_id: str
    """The user who originally created the entity."""

    evaluation_dataset_id: str
    """The ID of the associated evaluation dataset."""

    schema_type: Literal["GENERATION", "FLEXIBLE"]
    """An enumeration."""

    test_case_data: ItemTestCaseData
    """The data for the test case in a format matching the provided schema_type"""

    updated_at: datetime
    """The date and time when the entity was last updated in ISO format."""

    missing_chunks: Optional[List[AutoGeneratedDraftTestCaseMissingChunkInfo]] = None

    topic_str: Optional[str] = None


class AutoGeneratedDraftTestCasesList(BaseModel):
    current_page: int
    """The current page number."""

    items: List[Item]
    """The data returned for the current page."""

    items_per_page: int
    """The number of items per page."""

    total_item_count: int
    """The total number of items of the query"""
