Skip to main content

windmill_api/models/
list_scripts_200_response_inner.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.726.1
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 ListScripts200ResponseInner {
16    #[serde(rename = "workspace_id", skip_serializing_if = "Option::is_none")]
17    pub workspace_id: Option<String>,
18    #[serde(rename = "hash")]
19    pub hash: String,
20    #[serde(rename = "path")]
21    pub path: String,
22    /// The first element is the direct parent of the script, the second is the parent of the first, etc 
23    #[serde(rename = "parent_hashes", skip_serializing_if = "Option::is_none")]
24    pub parent_hashes: Option<Vec<String>>,
25    #[serde(rename = "summary")]
26    pub summary: String,
27    #[serde(rename = "description")]
28    pub description: String,
29    #[serde(rename = "content")]
30    pub content: String,
31    #[serde(rename = "created_by")]
32    pub created_by: String,
33    #[serde(rename = "created_at")]
34    pub created_at: String,
35    #[serde(rename = "archived")]
36    pub archived: bool,
37    #[serde(rename = "schema", skip_serializing_if = "Option::is_none")]
38    pub schema: Option<serde_json::Value>,
39    #[serde(rename = "deleted")]
40    pub deleted: bool,
41    #[serde(rename = "is_template")]
42    pub is_template: bool,
43    #[serde(rename = "extra_perms")]
44    pub extra_perms: std::collections::HashMap<String, bool>,
45    #[serde(rename = "lock", skip_serializing_if = "Option::is_none")]
46    pub lock: Option<String>,
47    #[serde(rename = "lock_error_logs", skip_serializing_if = "Option::is_none")]
48    pub lock_error_logs: Option<String>,
49    #[serde(rename = "language")]
50    pub language: models::ScriptLang,
51    #[serde(rename = "kind")]
52    pub kind: Kind,
53    #[serde(rename = "starred")]
54    pub starred: bool,
55    #[serde(rename = "tag", skip_serializing_if = "Option::is_none")]
56    pub tag: Option<String>,
57    #[serde(rename = "draft_only", skip_serializing_if = "Option::is_none")]
58    pub draft_only: Option<bool>,
59    #[serde(rename = "envs", skip_serializing_if = "Option::is_none")]
60    pub envs: Option<Vec<String>>,
61    #[serde(rename = "concurrent_limit", skip_serializing_if = "Option::is_none")]
62    pub concurrent_limit: Option<i32>,
63    #[serde(rename = "concurrency_time_window_s", skip_serializing_if = "Option::is_none")]
64    pub concurrency_time_window_s: Option<i32>,
65    #[serde(rename = "concurrency_key", skip_serializing_if = "Option::is_none")]
66    pub concurrency_key: Option<String>,
67    #[serde(rename = "debounce_key", skip_serializing_if = "Option::is_none")]
68    pub debounce_key: Option<String>,
69    #[serde(rename = "debounce_delay_s", skip_serializing_if = "Option::is_none")]
70    pub debounce_delay_s: Option<i32>,
71    #[serde(rename = "debounce_args_to_accumulate", skip_serializing_if = "Option::is_none")]
72    pub debounce_args_to_accumulate: Option<Vec<String>>,
73    #[serde(rename = "max_total_debouncing_time", skip_serializing_if = "Option::is_none")]
74    pub max_total_debouncing_time: Option<i32>,
75    #[serde(rename = "max_total_debounces_amount", skip_serializing_if = "Option::is_none")]
76    pub max_total_debounces_amount: Option<i32>,
77    #[serde(rename = "cache_ttl", skip_serializing_if = "Option::is_none")]
78    pub cache_ttl: Option<f64>,
79    #[serde(rename = "dedicated_worker", skip_serializing_if = "Option::is_none")]
80    pub dedicated_worker: Option<bool>,
81    #[serde(rename = "ws_error_handler_muted", skip_serializing_if = "Option::is_none")]
82    pub ws_error_handler_muted: Option<bool>,
83    #[serde(rename = "priority", skip_serializing_if = "Option::is_none")]
84    pub priority: Option<i32>,
85    #[serde(rename = "restart_unless_cancelled", skip_serializing_if = "Option::is_none")]
86    pub restart_unless_cancelled: Option<bool>,
87    #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")]
88    pub timeout: Option<i32>,
89    /// If set, delete the job's args, result and logs after this many seconds following job completion
90    #[serde(rename = "delete_after_secs", skip_serializing_if = "Option::is_none")]
91    pub delete_after_secs: Option<i32>,
92    #[serde(rename = "visible_to_runner_only", skip_serializing_if = "Option::is_none")]
93    pub visible_to_runner_only: Option<bool>,
94    #[serde(rename = "auto_kind", skip_serializing_if = "Option::is_none")]
95    pub auto_kind: Option<String>,
96    #[serde(rename = "codebase", skip_serializing_if = "Option::is_none")]
97    pub codebase: Option<String>,
98    #[serde(rename = "has_preprocessor")]
99    pub has_preprocessor: bool,
100    #[serde(rename = "on_behalf_of_email", skip_serializing_if = "Option::is_none")]
101    pub on_behalf_of_email: Option<String>,
102    /// Additional script modules keyed by relative file path
103    #[serde(rename = "modules", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
104    pub modules: Option<Option<std::collections::HashMap<String, models::ScriptModule>>>,
105    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
106    pub labels: Option<Vec<String>>,
107    /// Labels inherited from the parent folder, computed at read time. Read-only — edit them on the folder. 
108    #[serde(rename = "inherited_labels", skip_serializing_if = "Option::is_none")]
109    pub inherited_labels: Option<Vec<String>>,
110    /// 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. 
111    #[serde(rename = "is_draft", skip_serializing_if = "Option::is_none")]
112    pub is_draft: Option<bool>,
113    /// 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. 
114    #[serde(rename = "draft_path", skip_serializing_if = "Option::is_none")]
115    pub draft_path: Option<String>,
116    /// 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. 
117    #[serde(rename = "draft_users", skip_serializing_if = "Option::is_none")]
118    pub draft_users: Option<Vec<models::ListScripts200ResponseInnerAllOfDraftUsersInner>>,
119}
120
121impl ListScripts200ResponseInner {
122    pub fn new(hash: String, path: String, summary: String, description: String, content: String, created_by: String, created_at: String, archived: bool, deleted: bool, is_template: bool, extra_perms: std::collections::HashMap<String, bool>, language: models::ScriptLang, kind: Kind, starred: bool, has_preprocessor: bool) -> ListScripts200ResponseInner {
123        ListScripts200ResponseInner {
124            workspace_id: None,
125            hash,
126            path,
127            parent_hashes: None,
128            summary,
129            description,
130            content,
131            created_by,
132            created_at,
133            archived,
134            schema: None,
135            deleted,
136            is_template,
137            extra_perms,
138            lock: None,
139            lock_error_logs: None,
140            language,
141            kind,
142            starred,
143            tag: None,
144            draft_only: None,
145            envs: None,
146            concurrent_limit: None,
147            concurrency_time_window_s: None,
148            concurrency_key: None,
149            debounce_key: None,
150            debounce_delay_s: None,
151            debounce_args_to_accumulate: None,
152            max_total_debouncing_time: None,
153            max_total_debounces_amount: None,
154            cache_ttl: None,
155            dedicated_worker: None,
156            ws_error_handler_muted: None,
157            priority: None,
158            restart_unless_cancelled: None,
159            timeout: None,
160            delete_after_secs: None,
161            visible_to_runner_only: None,
162            auto_kind: None,
163            codebase: None,
164            has_preprocessor,
165            on_behalf_of_email: None,
166            modules: None,
167            labels: None,
168            inherited_labels: None,
169            is_draft: None,
170            draft_path: None,
171            draft_users: None,
172        }
173    }
174}
175/// 
176#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
177pub enum Kind {
178    #[serde(rename = "script")]
179    Script,
180    #[serde(rename = "failure")]
181    Failure,
182    #[serde(rename = "trigger")]
183    Trigger,
184    #[serde(rename = "command")]
185    Command,
186    #[serde(rename = "approval")]
187    Approval,
188    #[serde(rename = "preprocessor")]
189    Preprocessor,
190}
191
192impl Default for Kind {
193    fn default() -> Kind {
194        Self::Script
195    }
196}
197