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

import typing

import typing_extensions
from ..core.serialization import FieldMetadata
from ..types.created_at import CreatedAt
from ..types.processor_run_status import ProcessorRunStatus
from ..types.run_metadata import RunMetadata
from ..types.updated_at import UpdatedAt
from .extractor_summary import ExtractorSummaryParams
from .extractor_version_summary import ExtractorVersionSummaryParams
from .file_summary import FileSummaryParams
from .run_usage import RunUsageParams


class ExtractRunSummaryParams(typing_extensions.TypedDict):
    """
    Summary representation of an extract run.
    """

    object: typing.Literal["extract_run"]
    """
    The type of object. Will always be `"extract_run"`.
    """

    id: str
    """
    The unique identifier for this extract run.
    """

    extractor: typing.Optional[ExtractorSummaryParams]
    """
    The extractor that was used for this run.
    
    **Availability:** Present when an extractor reference was provided. Not present when using inline `config`.
    """

    extractor_version: typing_extensions.Annotated[
        typing.Optional[ExtractorVersionSummaryParams], FieldMetadata(alias="extractorVersion")
    ]
    """
    The version of the extractor that was used for this run.
    
    **Availability:** Present when an extractor reference was provided. Not present when using inline `config`.
    """

    status: ProcessorRunStatus
    failure_reason: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="failureReason")]
    """
    The reason for failure.
    
    **Availability:** Present when `status` is `"FAILED"`.
    """

    failure_message: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="failureMessage")]
    """
    A detailed message about the failure.
    
    **Availability:** Present when `status` is `"FAILED"`.
    """

    metadata: typing.Optional[RunMetadata]
    """
    Any metadata that was provided when creating the extract run.
    
    **Availability:** Present when metadata was provided during creation.
    """

    reviewed: bool
    """
    Indicates whether the run has been reviewed by a human.
    """

    edited: bool
    """
    Indicates whether the run results have been edited during review.
    """

    file: FileSummaryParams
    """
    The file that was processed.
    """

    parse_run_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="parseRunId")]
    """
    The ID of the parse run that was used for this extract run.
    
    **Availability:** Present when a parse run was created.
    """

    dashboard_url: typing_extensions.Annotated[str, FieldMetadata(alias="dashboardUrl")]
    """
    The URL to view the extract run in the Extend dashboard.
    """

    usage: typing.Optional[RunUsageParams]
    """
    Usage credits consumed by this run.
    
    **Availability:** Present when `status` is `"PROCESSED"`.
    """

    created_at: typing_extensions.Annotated[CreatedAt, FieldMetadata(alias="createdAt")]
    updated_at: typing_extensions.Annotated[UpdatedAt, FieldMetadata(alias="updatedAt")]
