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.555.2
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")]
31    pub value: 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 = "draft_only", skip_serializing_if = "Option::is_none")]
41    pub draft_only: Option<bool>,
42    #[serde(rename = "draft", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
43    pub draft: Option<Option<serde_json::Value>>,
44}
45
46impl AppWithLastVersionWDraft {
47    pub fn new(id: i32, workspace_id: String, path: String, summary: String, versions: Vec<i32>, created_by: String, created_at: String, value: serde_json::Value, policy: models::Policy, execution_mode: ExecutionMode, extra_perms: std::collections::HashMap<String, bool>) -> AppWithLastVersionWDraft {
48        AppWithLastVersionWDraft {
49            id,
50            workspace_id,
51            path,
52            summary,
53            versions,
54            created_by,
55            created_at,
56            value,
57            policy: Box::new(policy),
58            execution_mode,
59            extra_perms,
60            custom_path: None,
61            draft_only: None,
62            draft: None,
63        }
64    }
65}
66/// 
67#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
68pub enum ExecutionMode {
69    #[serde(rename = "viewer")]
70    Viewer,
71    #[serde(rename = "publisher")]
72    Publisher,
73    #[serde(rename = "anonymous")]
74    Anonymous,
75}
76
77impl Default for ExecutionMode {
78    fn default() -> ExecutionMode {
79        Self::Viewer
80    }
81}
82