Skip to main content

windmill_api/models/
asset_graph.rs

1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.776.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct AssetGraph {
16    #[serde(rename = "assets")]
17    pub assets: Vec<models::AssetGraphAssetsInner>,
18    #[serde(rename = "runnables")]
19    pub runnables: Vec<models::AssetGraphRunnablesInner>,
20    #[serde(rename = "edges")]
21    pub edges: Vec<models::AssetGraphEdgesInner>,
22    #[serde(rename = "triggers")]
23    pub triggers: Vec<models::AssetGraphTriggersInner>,
24    /// Macro-library → consumer edges (deploy-recorded call detection plus `// use`). Omitted when empty.
25    #[serde(rename = "macro_edges", skip_serializing_if = "Option::is_none")]
26    pub macro_edges: Option<Vec<models::AssetGraphMacroEdgesInner>>,
27    /// Ordering-only \"must-run-after\" edges — a `// data_test relationships` (or custom test reading a pipeline asset) requires the referenced asset's producer to run before the tested script. Not a data-consumption edge; fed into the cascade topo-sort so cold runs order correctly. Omitted when empty.
28    #[serde(rename = "test_edges", skip_serializing_if = "Option::is_none")]
29    pub test_edges: Option<Vec<models::AssetGraphTestEdgesInner>>,
30    /// `ref()` lineage BETWEEN two dbt models, in the terms the canvas draws — the relations, not dbt's node ids. Without it every model hangs off the one dbt runnable and the project reads as a flat fan-out. Omitted when empty.
31    #[serde(rename = "dbt_edges", skip_serializing_if = "Option::is_none")]
32    pub dbt_edges: Option<Vec<models::AssetGraphDbtEdgesInner>>,
33    /// The job whose own snapshot the dbt half was resolved from, when one was asked for and found. A run page polls the graph while its job runs, because a dynamic descriptor's snapshot is written mid-run, and this is what tells it to stop. Omitted when the answer came from the version's deployed graph.
34    #[serde(rename = "dbt_snapshot_job", skip_serializing_if = "Option::is_none")]
35    pub dbt_snapshot_job: Option<uuid::Uuid>,
36}
37
38impl AssetGraph {
39    pub fn new(assets: Vec<models::AssetGraphAssetsInner>, runnables: Vec<models::AssetGraphRunnablesInner>, edges: Vec<models::AssetGraphEdgesInner>, triggers: Vec<models::AssetGraphTriggersInner>) -> AssetGraph {
40        AssetGraph {
41            assets,
42            runnables,
43            edges,
44            triggers,
45            macro_edges: None,
46            test_edges: None,
47            dbt_edges: None,
48            dbt_snapshot_job: None,
49        }
50    }
51}
52