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

from __future__ import annotations

from typing import List, Union, Iterable
from datetime import datetime
from typing_extensions import Literal, Required, Annotated, TypedDict

from ..._utils import PropertyInfo

__all__ = ["FlowUpdateParams", "Edge"]


class FlowUpdateParams(TypedDict, total=False):
    created_at: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
    """The timestamp when the Lattice was created."""

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

    flow_history_id: Required[str]
    """The unique identifier for the Lattice."""

    identity_id: Required[str]
    """Identity of the Lattice Runner"""

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

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

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

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

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

    updated_at: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]

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

    registry_id: str
    """The identifier for the registry associated with the Lattice."""


class Edge(TypedDict, total=False):
    source: Required[str]
    """The unique identifier of the source node/quark."""

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

    _id: str
