# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import List, Optional
from datetime import datetime
from typing_extensions import Literal

from pydantic import Field as FieldInfo

from ..._models import BaseModel

__all__ = ["FlowHistoryItem", "Edge"]


class Edge(BaseModel):
    source: str
    """The unique identifier of the source node/quark."""

    target: str
    """The unique identifier of the target node/quark."""

    api_id: Optional[str] = FieldInfo(alias="_id", default=None)


class FlowHistoryItem(BaseModel):
    created_at: datetime
    """The timestamp when the Lattice was created."""

    edges: List[Edge]
    """A list of relationships (edges) between the nodes in the Lattice."""

    flow_history_id: str
    """The unique identifier for the Lattice."""

    identity_id: str
    """Identity of the Lattice Runner"""

    input: object
    """Input data provided to the Lattice, stored as a JSON value."""

    metrics: object
    """Performance-related data or metrics associated with the Lattice."""

    nodes: List[str]
    """A list of unique identifiers for the nodes (Quarks) in the Lattice."""

    registry_qrn: str
    """
    User-facing fully qualified identifier for the registry where the Flow is
    defined.
    """

    status: Literal["New", "Scheduled", "Running", "Completed", "Failed"]
    """Represents the status/stage of a Quark instance"""

    updated_at: datetime

    output: Optional[object] = None
    """Optional output data generated by the Lattice, stored as a JSON value."""

    registry_id: Optional[str] = None
    """The identifier for the registry associated with the Lattice."""
