Skip to main content

windmill_api/models/
get_script_by_path_200_response.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.792.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 GetScriptByPath200Response {
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 = "cache_ignore_s3_path", skip_serializing_if = "Option::is_none")]
80    pub cache_ignore_s3_path: Option<bool>,
81    #[serde(rename = "dedicated_worker", skip_serializing_if = "Option::is_none")]
82    pub dedicated_worker: Option<bool>,
83    #[serde(rename = "ws_error_handler_muted", skip_serializing_if = "Option::is_none")]
84    pub ws_error_handler_muted: Option<bool>,
85    #[serde(rename = "priority", skip_serializing_if = "Option::is_none")]
86    pub priority: Option<i32>,
87    #[serde(rename = "restart_unless_cancelled", skip_serializing_if = "Option::is_none")]
88    pub restart_unless_cancelled: Option<bool>,
89    #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")]
90    pub timeout: Option<i32>,
91    /// If set, delete the job's args, result and logs after this many seconds following job completion
92    #[serde(rename = "delete_after_secs", skip_serializing_if = "Option::is_none")]
93    pub delete_after_secs: Option<i32>,
94    #[serde(rename = "visible_to_runner_only", skip_serializing_if = "Option::is_none")]
95    pub visible_to_runner_only: Option<bool>,
96    #[serde(rename = "auto_kind", skip_serializing_if = "Option::is_none")]
97    pub auto_kind: Option<String>,
98    #[serde(rename = "codebase", skip_serializing_if = "Option::is_none")]
99    pub codebase: Option<String>,
100    #[serde(rename = "has_preprocessor")]
101    pub has_preprocessor: bool,
102    #[serde(rename = "on_behalf_of_email", skip_serializing_if = "Option::is_none")]
103    pub on_behalf_of_email: Option<String>,
104    /// Authorization identity the runnable runs as: u/{username}, g/{group}, or a bare email when the username is itself email-shaped. The only stored half of the identity; on_behalf_of_email is derived from it.
105    #[serde(rename = "on_behalf_of", skip_serializing_if = "Option::is_none")]
106    pub on_behalf_of: Option<String>,
107    /// Additional script modules keyed by relative file path
108    #[serde(rename = "modules", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
109    pub modules: Option<Option<std::collections::HashMap<String, models::ScriptModule>>>,
110    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
111    pub labels: Option<Vec<String>>,
112    /// Labels inherited from the parent folder, computed at read time. Read-only — edit them on the folder. 
113    #[serde(rename = "inherited_labels", skip_serializing_if = "Option::is_none")]
114    pub inherited_labels: Option<Vec<String>>,
115    #[serde(rename = "is_draft")]
116    pub is_draft: bool,
117    #[serde(rename = "draft_saved_at", skip_serializing_if = "Option::is_none")]
118    pub draft_saved_at: Option<String>,
119    #[serde(rename = "no_deployed", skip_serializing_if = "Option::is_none")]
120    pub no_deployed: Option<bool>,
121    #[serde(rename = "draft", skip_serializing_if = "Option::is_none")]
122    pub draft: Option<std::collections::HashMap<String, serde_json::Value>>,
123    /// Other workspace users (and the legacy NULL-email row, if any) with a saved draft at the same path. Populated only on the authed user's \"get by path\" responses for kinds the editor surfaces a fork banner for (script, flow, app, raw_app). Empty / omitted for kinds without that UI. 
124    #[serde(rename = "other_drafts_users", skip_serializing_if = "Option::is_none")]
125    pub other_drafts_users: Option<Vec<models::UserDraftOverlayOtherDraftsUsersInner>>,
126}
127
128impl GetScriptByPath200Response {
129    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, is_draft: bool) -> GetScriptByPath200Response {
130        GetScriptByPath200Response {
131            workspace_id: None,
132            hash,
133            path,
134            parent_hashes: None,
135            summary,
136            description,
137            content,
138            created_by,
139            created_at,
140            archived,
141            schema: None,
142            deleted,
143            is_template,
144            extra_perms,
145            lock: None,
146            lock_error_logs: None,
147            language,
148            kind,
149            starred,
150            tag: None,
151            draft_only: None,
152            envs: None,
153            concurrent_limit: None,
154            concurrency_time_window_s: None,
155            concurrency_key: None,
156            debounce_key: None,
157            debounce_delay_s: None,
158            debounce_args_to_accumulate: None,
159            max_total_debouncing_time: None,
160            max_total_debounces_amount: None,
161            cache_ttl: None,
162            cache_ignore_s3_path: None,
163            dedicated_worker: None,
164            ws_error_handler_muted: None,
165            priority: None,
166            restart_unless_cancelled: None,
167            timeout: None,
168            delete_after_secs: None,
169            visible_to_runner_only: None,
170            auto_kind: None,
171            codebase: None,
172            has_preprocessor,
173            on_behalf_of_email: None,
174            on_behalf_of: None,
175            modules: None,
176            labels: None,
177            inherited_labels: None,
178            is_draft,
179            draft_saved_at: None,
180            no_deployed: None,
181            draft: None,
182            other_drafts_users: None,
183        }
184    }
185}
186/// 
187#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
188pub enum Kind {
189    #[serde(rename = "script")]
190    Script,
191    #[serde(rename = "failure")]
192    Failure,
193    #[serde(rename = "trigger")]
194    Trigger,
195    #[serde(rename = "command")]
196    Command,
197    #[serde(rename = "approval")]
198    Approval,
199    #[serde(rename = "preprocessor")]
200    Preprocessor,
201}
202
203impl Default for Kind {
204    fn default() -> Kind {
205        Self::Script
206    }
207}
208