windmill-api 1.776.0

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Documentation
/*
 * Windmill API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.776.0
 * Contact: contact@windmill.dev
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// DbtAssetProvenance : What dbt says about the model, snapshot, seed or source that produces (or, for a source, is read at) this relation. A dbt project is one runnable node with many model assets, so per-model metadata belongs here rather than on the script.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DbtAssetProvenance {
    /// dbt's own node id, e.g. `model.jaffle_shop.customers`.
    #[serde(rename = "unique_id")]
    pub unique_id: String,
    #[serde(rename = "resource_type")]
    pub resource_type: ResourceType,
    /// dbt's own word (`table`, `view`, `incremental`, `snapshot`).
    #[serde(rename = "materialized", skip_serializing_if = "Option::is_none")]
    pub materialized: Option<String>,
    /// The Windmill write strategy it maps to, absent for `view` and `ephemeral`, which have none.
    #[serde(rename = "materialize_strategy", skip_serializing_if = "Option::is_none")]
    pub materialize_strategy: Option<String>,
    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
    pub tags: Option<Vec<String>>,
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[serde(rename = "data_tests", skip_serializing_if = "Option::is_none")]
    pub data_tests: Option<Vec<models::DbtAssetProvenanceDataTestsInner>>,
    /// Declared column metadata (name -> description). NOT column lineage — `manifest.json` carries none.
    #[serde(rename = "columns", skip_serializing_if = "Option::is_none")]
    pub columns: Option<std::collections::HashMap<String, serde_json::Value>>,
    /// A source's declared freshness policy, for the staleness chip.
    #[serde(rename = "freshness", skip_serializing_if = "Option::is_none")]
    pub freshness: Option<std::collections::HashMap<String, serde_json::Value>>,
    /// The model's SQL as written, at the deploy this graph belongs to. Omitted when the caller cannot read the script.
    #[serde(rename = "raw_code", skip_serializing_if = "Option::is_none")]
    pub raw_code: Option<String>,
    /// Its path inside the dbt project, e.g. `models/staging/stg_orders.sql`.
    #[serde(rename = "original_file_path", skip_serializing_if = "Option::is_none")]
    pub original_file_path: Option<String>,
}

impl DbtAssetProvenance {
    /// What dbt says about the model, snapshot, seed or source that produces (or, for a source, is read at) this relation. A dbt project is one runnable node with many model assets, so per-model metadata belongs here rather than on the script.
    pub fn new(unique_id: String, resource_type: ResourceType) -> DbtAssetProvenance {
        DbtAssetProvenance {
            unique_id,
            resource_type,
            materialized: None,
            materialize_strategy: None,
            tags: None,
            description: None,
            data_tests: None,
            columns: None,
            freshness: None,
            raw_code: None,
            original_file_path: None,
        }
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ResourceType {
    #[serde(rename = "model")]
    Model,
    #[serde(rename = "snapshot")]
    Snapshot,
    #[serde(rename = "seed")]
    Seed,
    #[serde(rename = "source")]
    Source,
}

impl Default for ResourceType {
    fn default() -> ResourceType {
        Self::Model
    }
}