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

from ..core.pydantic_utilities import UniversalBaseModel
import pydantic
import typing
from .extract_agent_data_schema_value import ExtractAgentDataSchemaValue
from .extract_config import ExtractConfig
import datetime as dt
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class ExtractAgent(UniversalBaseModel):
    """
    Schema and configuration for creating an extraction agent.
    """

    id: str = pydantic.Field()
    """
    The id of the extraction agent.
    """

    name: str = pydantic.Field()
    """
    The name of the extraction agent.
    """

    project_id: str = pydantic.Field()
    """
    The ID of the project that the extraction agent belongs to.
    """

    data_schema: typing.Dict[str, typing.Optional[ExtractAgentDataSchemaValue]] = pydantic.Field()
    """
    The schema of the data.
    """

    config: ExtractConfig = pydantic.Field()
    """
    The configuration parameters for the extraction agent.
    """

    created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    The creation time of the extraction agent.
    """

    updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    The last update time of the extraction agent.
    """

    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
