Skip to main content

windmill_api/models/
app_with_last_version_w_draft.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.677.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 AppWithLastVersionWDraft {
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 = "versions")]
25    pub versions: Vec<i32>,
26    #[serde(rename = "created_by")]
27    pub created_by: String,
28    #[serde(rename = "created_at")]
29    pub created_at: String,
30    #[serde(rename = "value", deserialize_with = "Option::deserialize")]
31    pub value: Option<serde_json::Value>,
32    #[serde(rename = "policy")]
33    pub policy: Box<models::Policy>,
34    #[serde(rename = "execution_mode")]
35    pub execution_mode: ExecutionMode,
36    #[serde(rename = "extra_perms")]
37    pub extra_perms: std::collections::HashMap<String, bool>,
38    #[serde(rename = "custom_path", skip_serializing_if = "Option::is_none")]
39    pub custom_path: Option<String>,
40    #[serde(rename = "raw_app")]
41    pub raw_app: bool,
42    #[serde(rename = "bundle_secret", skip_serializing_if = "Option::is_none")]
43    pub bundle_secret: Option<String>,
44    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
45    pub labels: Option<Vec<String>>,
46    #[serde(rename = "draft_only", skip_serializing_if = "Option::is_none")]
47    pub draft_only: Option<bool>,
48    #[serde(rename = "draft", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
49    pub draft: Option<Option<serde_json::Value>>,
50}
51
52impl AppWithLastVersionWDraft {
53    pub fn new(id: i32, workspace_id: String, path: String, summary: String, versions: Vec<i32>, created_by: String, created_at: String, value: Option<serde_json::Value>, policy: models::Policy, execution_mode: ExecutionMode, extra_perms: std::collections::HashMap<String, bool>, raw_app: bool) -> AppWithLastVersionWDraft {
54        AppWithLastVersionWDraft {
55            id,
56            workspace_id,
57            path,
58            summary,
59            versions,
60            created_by,
61            created_at,
62            value,
63            policy: Box::new(policy),
64            execution_mode,
65            extra_perms,
66            custom_path: None,
67            raw_app,
68            bundle_secret: None,
69            labels: None,
70            draft_only: None,
71            draft: None,
72        }
73    }
74}
75/// 
76#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
77pub enum ExecutionMode {
78    #[serde(rename = "viewer")]
79    Viewer,
80    #[serde(rename = "publisher")]
81    Publisher,
82    #[serde(rename = "anonymous")]
83    Anonymous,
84}
85
86impl Default for ExecutionMode {
87    fn default() -> ExecutionMode {
88        Self::Viewer
89    }
90}
91