# This file was auto-generated by Fern from our API Definition.

from __future__ import annotations

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata
from .analysis_scope import AnalysisScope


class AgentAnalysisItemsInputDataCollectionItem_System(UncheckedBaseModel):
    source: typing.Literal["system"] = "system"
    analysis_item_id: typing.Literal["__system_data_collection_topic"] = "__system_data_collection_topic"
    scope: typing.Optional[AnalysisScope] = 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


class AgentAnalysisItemsInputDataCollectionItem_User(UncheckedBaseModel):
    source: typing.Literal["user"] = "user"
    analysis_item_id: str
    version_id: typing.Optional[str] = None
    scope: typing.Optional[AnalysisScope] = 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


AgentAnalysisItemsInputDataCollectionItem = typing_extensions.Annotated[
    typing.Union[AgentAnalysisItemsInputDataCollectionItem_System, AgentAnalysisItemsInputDataCollectionItem_User],
    UnionMetadata(discriminant="source"),
]
