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

import datetime as dt
import typing

import typing_extensions
from ..core.serialization import FieldMetadata
from ..types.created_at import CreatedAt
from ..types.updated_at import UpdatedAt
from ..types.workflow_run_status import WorkflowRunStatus
from .run_usage import RunUsageParams
from .workflow_summary import WorkflowSummaryParams
from .workflow_version_summary import WorkflowVersionSummaryParams


class WorkflowRunSummaryParams(typing_extensions.TypedDict):
    object: typing.Literal["workflow_run"]
    """
    The type of object. In this case, it will always be `"workflow_run"`.
    """

    id: str
    """
    The ID of the workflow run.
    
    Example: `"workflow_run_Zk9mNP12Qw4-yTv8BdR3H"`
    """

    status: WorkflowRunStatus
    workflow: WorkflowSummaryParams
    workflow_version: typing_extensions.Annotated[WorkflowVersionSummaryParams, FieldMetadata(alias="workflowVersion")]
    dashboard_url: typing_extensions.Annotated[str, FieldMetadata(alias="dashboardUrl")]
    """
    A URL to view this workflow run in the Extend dashboard.
    
    Example: `"https://dashboard.extend.ai/workflows/workflow_run_xKm9pNv3qWsY_jL2tR5Dh"`
    """

    reviewed_by_user: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="reviewedByUser")]
    """
    The user of the person who reviewed the workflow run. Will be null if the workflow run has not been reviewed.
    
    Example: `"jane.doe@example.com"`
    """

    reviewed_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="reviewedAt")]
    """
    The time (in UTC) at which the workflow run was reviewed. Will follow the RFC 3339 format. Will be null if the workflow run has not been reviewed.
    
    Example: `"2024-03-21T16:45:00Z"`
    """

    initial_run_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="initialRunAt")]
    """
    The time (in UTC) at which the workflow was initially created. Will follow the RFC 3339 format. Will be null if the run hasn't started yet.
    
    Example: `"2024-03-21T15:30:00Z"`
    """

    start_time: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="startTime")]
    """
    The start time (in UTC) that the workflow actually started executing. This occurs after the `initialRunAt` time. Will follow the RFC 3339 format. Will be null if not started.
    
    Example: `"2024-03-21T15:30:00Z"`
    """

    end_time: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="endTime")]
    """
    The end time (in UTC) that the workflow finished. Will follow the RFC 3339 format. Will be null if not finished.
    
    Example: `"2024-03-21T15:35:00Z"`
    """

    batch_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="batchId")]
    """
    The batch ID of the workflow run. If that workflow run was created from a batch of files, all runs in that batch will have the same batch ID.
    
    Example: `"batch_7Ws31-F5"`
    """

    rejection_note: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="rejectionNote")]
    """
    The note that was added when the workflow run was rejected.
    
    Example: `"Invalid invoice format"`
    """

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