Skip to main content

windmill_api/models/
runnable_item.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.834.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// RunnableItem : A row in the merged runnables listing. `type` is the discriminator; kind-specific fields (hash/language/kind for scripts, execution_mode/ version for apps, agent_memory/ws_specific for agents) are present only for that kind. An agent is an `ai_agent` resource whose description is reported as `summary`. `edited_at` is the unified last-updated time (a script's created_at, a flow/app/agent's edit time). 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct RunnableItem {
17    #[serde(rename = "type")]
18    pub r#type: Type,
19    #[serde(rename = "path")]
20    pub path: String,
21    #[serde(rename = "summary", skip_serializing_if = "Option::is_none")]
22    pub summary: Option<String>,
23    #[serde(rename = "workspace_id", skip_serializing_if = "Option::is_none")]
24    pub workspace_id: Option<String>,
25    #[serde(rename = "extra_perms", skip_serializing_if = "Option::is_none")]
26    pub extra_perms: Option<std::collections::HashMap<String, bool>>,
27    #[serde(rename = "starred", skip_serializing_if = "Option::is_none")]
28    pub starred: Option<bool>,
29    #[serde(rename = "archived", skip_serializing_if = "Option::is_none")]
30    pub archived: Option<bool>,
31    #[serde(rename = "is_draft", skip_serializing_if = "Option::is_none")]
32    pub is_draft: Option<bool>,
33    #[serde(rename = "draft_only", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
34    pub draft_only: Option<Option<bool>>,
35    #[serde(rename = "draft_path", skip_serializing_if = "Option::is_none")]
36    pub draft_path: Option<String>,
37    #[serde(rename = "draft_users", skip_serializing_if = "Option::is_none")]
38    pub draft_users: Option<Vec<serde_json::Value>>,
39    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
40    pub labels: Option<Vec<String>>,
41    #[serde(rename = "inherited_labels", skip_serializing_if = "Option::is_none")]
42    pub inherited_labels: Option<Vec<String>>,
43    #[serde(rename = "ws_error_handler_muted", skip_serializing_if = "Option::is_none")]
44    pub ws_error_handler_muted: Option<bool>,
45    #[serde(rename = "edited_at", skip_serializing_if = "Option::is_none")]
46    pub edited_at: Option<String>,
47    /// script version hash as a 16-char hex string
48    #[serde(rename = "hash", skip_serializing_if = "Option::is_none")]
49    pub hash: Option<String>,
50    #[serde(rename = "language", skip_serializing_if = "Option::is_none")]
51    pub language: Option<String>,
52    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
53    pub kind: Option<String>,
54    #[serde(rename = "auto_kind", skip_serializing_if = "Option::is_none")]
55    pub auto_kind: Option<String>,
56    #[serde(rename = "use_codebase", skip_serializing_if = "Option::is_none")]
57    pub use_codebase: Option<bool>,
58    #[serde(rename = "has_deploy_errors", skip_serializing_if = "Option::is_none")]
59    pub has_deploy_errors: Option<bool>,
60    /// flow-only. `chat_input_enabled` of the flow's value, projected so the list can mark flows that open as a chat. Omitted when the value has no such field.
61    #[serde(rename = "chat_input_enabled", skip_serializing_if = "Option::is_none")]
62    pub chat_input_enabled: Option<bool>,
63    #[serde(rename = "raw_app", skip_serializing_if = "Option::is_none")]
64    pub raw_app: Option<bool>,
65    #[serde(rename = "execution_mode", skip_serializing_if = "Option::is_none")]
66    pub execution_mode: Option<String>,
67    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
68    pub id: Option<i64>,
69    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
70    pub version: Option<i64>,
71    /// agent-only. The agent's `memory` setting.
72    #[serde(rename = "agent_memory", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
73    pub agent_memory: Option<Option<serde_json::Value>>,
74    /// agent-only. Whether the agent is workspace-specific, which keeps it out of deploys to other workspaces.
75    #[serde(rename = "ws_specific", skip_serializing_if = "Option::is_none")]
76    pub ws_specific: Option<bool>,
77}
78
79impl RunnableItem {
80    /// A row in the merged runnables listing. `type` is the discriminator; kind-specific fields (hash/language/kind for scripts, execution_mode/ version for apps, agent_memory/ws_specific for agents) are present only for that kind. An agent is an `ai_agent` resource whose description is reported as `summary`. `edited_at` is the unified last-updated time (a script's created_at, a flow/app/agent's edit time). 
81    pub fn new(r#type: Type, path: String) -> RunnableItem {
82        RunnableItem {
83            r#type,
84            path,
85            summary: None,
86            workspace_id: None,
87            extra_perms: None,
88            starred: None,
89            archived: None,
90            is_draft: None,
91            draft_only: None,
92            draft_path: None,
93            draft_users: None,
94            labels: None,
95            inherited_labels: None,
96            ws_error_handler_muted: None,
97            edited_at: None,
98            hash: None,
99            language: None,
100            kind: None,
101            auto_kind: None,
102            use_codebase: None,
103            has_deploy_errors: None,
104            chat_input_enabled: None,
105            raw_app: None,
106            execution_mode: None,
107            id: None,
108            version: None,
109            agent_memory: None,
110            ws_specific: None,
111        }
112    }
113}
114/// 
115#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
116pub enum Type {
117    #[serde(rename = "script")]
118    Script,
119    #[serde(rename = "flow")]
120    Flow,
121    #[serde(rename = "app")]
122    App,
123    #[serde(rename = "agent")]
124    Agent,
125}
126
127impl Default for Type {
128    fn default() -> Type {
129        Self::Script
130    }
131}
132