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

import datetime as dt
import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.serialization import FieldMetadata
from ..core.unchecked_base_model import UncheckedBaseModel
from .legacy_document_processor_run_credits import LegacyDocumentProcessorRunCredits
from .legacy_processor_run_summary_type import LegacyProcessorRunSummaryType
from .legacy_processor_status import LegacyProcessorStatus


class LegacyProcessorRunSummary(UncheckedBaseModel):
    id: str = pydantic.Field()
    """
    The ID of the processor run.
    
    Example: `"exr_Zk9mNP12Qw4-yTv8BdR3H"`
    """

    status: LegacyProcessorStatus
    processor_id: typing_extensions.Annotated[str, FieldMetadata(alias="processorId")] = pydantic.Field(
        alias="processorId"
    )
    """
    The ID of the processor that was run. Will always start with "ex_".
    
    Example: `"ex_BMdfq_yWM3sT-ZzvCnA3f"`
    """

    processor_name: typing_extensions.Annotated[str, FieldMetadata(alias="processorName")] = pydantic.Field(
        alias="processorName"
    )
    """
    The name of the processor that was run.
    
    Example: `"Invoice Extractor"`
    """

    processor_version_id: typing_extensions.Annotated[str, FieldMetadata(alias="processorVersionId")] = pydantic.Field(
        alias="processorVersionId"
    )
    """
    The ID of the processor version that was run. Will always start with "exv_".
    
    Example: `"exv_Zk9mNP12Qw4-yTv8BdR3H"`
    """

    type: typing.Optional[LegacyProcessorRunSummaryType] = pydantic.Field(default=None)
    """
    The type of processor that was run:
    * `"EXTRACT"` - Extraction processor
    * `"SPLITTER"` - Splitting processor
    * `"CLASSIFY"` - Classification processor
    """

    created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field(
        alias="createdAt"
    )
    """
    The time (in UTC) at which the processor run was created. Will follow the RFC 3339 format.
    
    Example: `"2024-03-21T15:29:55Z"`
    """

    updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field(
        alias="updatedAt"
    )
    """
    The time (in UTC) at which the processor run was last updated. Will follow the RFC 3339 format.
    
    Example: `"2024-03-21T16:45:00Z"`
    """

    usage: typing.Optional[LegacyDocumentProcessorRunCredits] = 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
