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

from ..core.pydantic_utilities import UniversalBaseModel
import pydantic
import typing
from .data import Data
from .extract_resultset_extraction_metadata_value import ExtractResultsetExtractionMetadataValue
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class ExtractResultset(UniversalBaseModel):
    """
    Schema for an extraction resultset.
    """

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

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

    data: typing.Optional[Data] = pydantic.Field(default=None)
    """
    The data extracted from the file
    """

    extraction_metadata: typing.Dict[str, typing.Optional[ExtractResultsetExtractionMetadataValue]] = pydantic.Field()
    """
    The metadata extracted from the file
    """

    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
