Skip to main content

windmill_api/models/
listable_script.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.878.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ListableScript : A script as returned by the list endpoint: the deployed row's summary fields, without its content, lock or schema. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ListableScript {
17    #[serde(rename = "hash")]
18    pub hash: String,
19    #[serde(rename = "path")]
20    pub path: String,
21    #[serde(rename = "summary")]
22    pub summary: String,
23    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
24    pub description: Option<String>,
25    #[serde(rename = "created_at")]
26    pub created_at: String,
27    #[serde(rename = "archived")]
28    pub archived: bool,
29    #[serde(rename = "extra_perms")]
30    pub extra_perms: std::collections::HashMap<String, bool>,
31    #[serde(rename = "language")]
32    pub language: models::ScriptLang,
33    #[serde(rename = "kind")]
34    pub kind: Kind,
35    #[serde(rename = "starred")]
36    pub starred: bool,
37    #[serde(rename = "tag", deserialize_with = "Option::deserialize")]
38    pub tag: Option<String>,
39    /// True on rows built from a draft that was never deployed. Omitted on deployed rows. 
40    #[serde(rename = "draft_only", skip_serializing_if = "Option::is_none")]
41    pub draft_only: Option<bool>,
42    #[serde(rename = "has_deploy_errors")]
43    pub has_deploy_errors: bool,
44    #[serde(rename = "ws_error_handler_muted", deserialize_with = "Option::deserialize")]
45    pub ws_error_handler_muted: Option<bool>,
46    #[serde(rename = "auto_kind", skip_serializing_if = "Option::is_none")]
47    pub auto_kind: Option<String>,
48    /// Omitted when false.
49    #[serde(rename = "use_codebase", skip_serializing_if = "Option::is_none")]
50    pub use_codebase: Option<bool>,
51    /// Only returned with `with_deployment_msg=true`.
52    #[serde(rename = "deployment_msg", skip_serializing_if = "Option::is_none")]
53    pub deployment_msg: Option<String>,
54    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
55    pub labels: Option<Vec<String>>,
56    #[serde(rename = "inherited_labels", skip_serializing_if = "Option::is_none")]
57    pub inherited_labels: Option<Vec<String>>,
58    /// True when the authed user has a draft for this script — either no deployed row exists at this path (draft-only) or the user saved a per-user draft on top of the deployed row. Omitted when false. 
59    #[serde(rename = "is_draft", skip_serializing_if = "Option::is_none")]
60    pub is_draft: Option<bool>,
61    /// User-typed path the editor has staged but not yet deployed. Surfaced for draft-only rows so the home list can render the meaningful name instead of the autogenerated `u/{user}/draft_{uuid}` URL path. Omitted when unchanged. 
62    #[serde(rename = "draft_path", skip_serializing_if = "Option::is_none")]
63    pub draft_path: Option<String>,
64    /// Workspace users (including the authed user, and the legacy NULL-email row if any) who have a per-user draft at this path. Drives the home page's user-avatar circles inside the Draft badge. Omitted when no drafts exist. 
65    #[serde(rename = "draft_users", skip_serializing_if = "Option::is_none")]
66    pub draft_users: Option<Vec<models::ListDrafts200ResponseInnerDraftUsersInner>>,
67}
68
69impl ListableScript {
70    /// A script as returned by the list endpoint: the deployed row's summary fields, without its content, lock or schema. 
71    pub fn new(hash: String, path: String, summary: String, created_at: String, archived: bool, extra_perms: std::collections::HashMap<String, bool>, language: models::ScriptLang, kind: Kind, starred: bool, tag: Option<String>, has_deploy_errors: bool, ws_error_handler_muted: Option<bool>) -> ListableScript {
72        ListableScript {
73            hash,
74            path,
75            summary,
76            description: None,
77            created_at,
78            archived,
79            extra_perms,
80            language,
81            kind,
82            starred,
83            tag,
84            draft_only: None,
85            has_deploy_errors,
86            ws_error_handler_muted,
87            auto_kind: None,
88            use_codebase: None,
89            deployment_msg: None,
90            labels: None,
91            inherited_labels: None,
92            is_draft: None,
93            draft_path: None,
94            draft_users: None,
95        }
96    }
97}
98/// 
99#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
100pub enum Kind {
101    #[serde(rename = "script")]
102    Script,
103    #[serde(rename = "failure")]
104    Failure,
105    #[serde(rename = "trigger")]
106    Trigger,
107    #[serde(rename = "approval")]
108    Approval,
109    #[serde(rename = "preprocessor")]
110    Preprocessor,
111}
112
113impl Default for Kind {
114    fn default() -> Kind {
115        Self::Script
116    }
117}
118