Skip to main content

windmill_api/models/
listable_app.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.727.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 ListableApp {
16    #[serde(rename = "id")]
17    pub id: i32,
18    #[serde(rename = "workspace_id")]
19    pub workspace_id: String,
20    #[serde(rename = "path")]
21    pub path: String,
22    #[serde(rename = "summary")]
23    pub summary: String,
24    #[serde(rename = "version")]
25    pub version: i32,
26    #[serde(rename = "extra_perms")]
27    pub extra_perms: std::collections::HashMap<String, bool>,
28    #[serde(rename = "starred", skip_serializing_if = "Option::is_none")]
29    pub starred: Option<bool>,
30    #[serde(rename = "edited_at")]
31    pub edited_at: String,
32    #[serde(rename = "execution_mode")]
33    pub execution_mode: ExecutionMode,
34    #[serde(rename = "raw_app", skip_serializing_if = "Option::is_none")]
35    pub raw_app: Option<bool>,
36    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
37    pub labels: Option<Vec<String>>,
38    /// True when the authed user has a draft for this app — either no deployed row exists at this path (draft-only) or the user has saved a per-user draft on top of the deployed row. 
39    #[serde(rename = "is_draft", skip_serializing_if = "Option::is_none")]
40    pub is_draft: Option<bool>,
41    /// User-typed path the editor has staged but not yet deployed. Sourced from the draft JSON's `draft_path` field (the editor only writes it when the typed path differs from the deployed one). Lets the home list render the meaningful name instead of the autogenerated `u/{user}/draft_{uuid}` URL path. Omitted when unchanged. 
42    #[serde(rename = "draft_path", skip_serializing_if = "Option::is_none")]
43    pub draft_path: Option<String>,
44    /// 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. 
45    #[serde(rename = "draft_users", skip_serializing_if = "Option::is_none")]
46    pub draft_users: Option<Vec<models::ListScripts200ResponseInnerAllOfDraftUsersInner>>,
47    /// Labels inherited from the parent folder, computed at read time. Read-only — edit them on the folder. 
48    #[serde(rename = "inherited_labels", skip_serializing_if = "Option::is_none")]
49    pub inherited_labels: Option<Vec<String>>,
50}
51
52impl ListableApp {
53    pub fn new(id: i32, workspace_id: String, path: String, summary: String, version: i32, extra_perms: std::collections::HashMap<String, bool>, edited_at: String, execution_mode: ExecutionMode) -> ListableApp {
54        ListableApp {
55            id,
56            workspace_id,
57            path,
58            summary,
59            version,
60            extra_perms,
61            starred: None,
62            edited_at,
63            execution_mode,
64            raw_app: None,
65            labels: None,
66            is_draft: None,
67            draft_path: None,
68            draft_users: None,
69            inherited_labels: None,
70        }
71    }
72}
73/// 
74#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
75pub enum ExecutionMode {
76    #[serde(rename = "viewer")]
77    Viewer,
78    #[serde(rename = "publisher")]
79    Publisher,
80    #[serde(rename = "anonymous")]
81    Anonymous,
82}
83
84impl Default for ExecutionMode {
85    fn default() -> ExecutionMode {
86        Self::Viewer
87    }
88}
89