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

import datetime as dt

import typing_extensions
from ..core.serialization import FieldMetadata
from ..types.batch_processor_run_source import BatchProcessorRunSource
from ..types.batch_processor_run_status import BatchProcessorRunStatus
from .batch_processor_run_metrics import BatchProcessorRunMetricsParams
from .batch_processor_run_options import BatchProcessorRunOptionsParams


class BatchProcessorRunParams(typing_extensions.TypedDict):
    object: str
    """
    The type of response. In this case, it will always be `"batch_processor_run"`.
    """

    id: str
    """
    The unique identifier for this batch processor run.
    
    Example: `"batch_processor_run_Xj8mK2pL9nR4vT7qY5wZ"`
    """

    processor_id: typing_extensions.Annotated[str, FieldMetadata(alias="processorId")]
    """
    The ID of the processor used for this run.
    
    Example: `"ex_Xj8mK2pL9nR4vT7qY5wZ"`
    """

    processor_version_id: typing_extensions.Annotated[str, FieldMetadata(alias="processorVersionId")]
    """
    The ID of the specific processor version used.
    
    Example: `"exv_xK9mLPqRtN3vS8wF5hB2cQ"`
    """

    processor_name: typing_extensions.Annotated[str, FieldMetadata(alias="processorName")]
    """
    The name of the processor.
    
    Example: `"Invoice Processor"`
    """

    metrics: BatchProcessorRunMetricsParams
    status: BatchProcessorRunStatus
    """
    The current status of the batch processor run:
    * `"PENDING"` - The batch processor run is waiting to start
    * `"PROCESSING"` - The batch processor run is in progress
    * `"PROCESSED"` - The batch processor run completed successfully
    * `"FAILED"` - The batch processor run encountered an error
    """

    source: BatchProcessorRunSource
    """
    The source of the batch processor run:
    * `"EVAL_SET"` - The batch processor run was made from an evaluation set. The `sourceId` will be the ID of the evaluation set (e.g., `"ev_1234"`)
    * `"PLAYGROUND"` - The batch processor run was made from the playground. The `sourceId` will not be set
    * `"STUDIO"` - The batch processor run was made for a processor in Studio. The `sourceId` will be the ID of the processor (e.g., `"ex_1234"`)
    """

    source_id: typing_extensions.NotRequired[typing_extensions.Annotated[str, FieldMetadata(alias="sourceId")]]
    """
    The ID of the source of the batch processor run. See the `source` field for more details.
    Example: `"ev_1234"` for EVAL_SET source, `"ex_1234"` for STUDIO source
    """

    run_count: typing_extensions.Annotated[int, FieldMetadata(alias="runCount")]
    """
    The number of runs that were made.
    """

    options: BatchProcessorRunOptionsParams
    """
    The options for the batch processor run.
    """

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

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