Skip to main content

windmill_api/models/
get_app_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.816.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 GetAppByPath200Response {
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 = "is_draft")]
47    pub is_draft: bool,
48    #[serde(rename = "draft_saved_at", skip_serializing_if = "Option::is_none")]
49    pub draft_saved_at: Option<String>,
50    /// The deployed version the draft forked from, as text whatever the kind (script hash, flow version id, app version id). Compare to the deployed head to tell a draft that is behind. Absent when there is no draft or it was never forked from a deploy. 
51    #[serde(rename = "draft_base", skip_serializing_if = "Option::is_none")]
52    pub draft_base: Option<String>,
53    #[serde(rename = "no_deployed", skip_serializing_if = "Option::is_none")]
54    pub no_deployed: Option<bool>,
55    #[serde(rename = "draft", skip_serializing_if = "Option::is_none")]
56    pub draft: Option<std::collections::HashMap<String, serde_json::Value>>,
57    /// 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. 
58    #[serde(rename = "other_drafts_users", skip_serializing_if = "Option::is_none")]
59    pub other_drafts_users: Option<Vec<models::UserDraftOverlayOtherDraftsUsersInner>>,
60}
61
62impl GetAppByPath200Response {
63    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, is_draft: bool) -> GetAppByPath200Response {
64        GetAppByPath200Response {
65            id,
66            workspace_id,
67            path,
68            summary,
69            versions,
70            created_by,
71            created_at,
72            value,
73            policy: Box::new(policy),
74            execution_mode,
75            extra_perms,
76            custom_path: None,
77            raw_app,
78            bundle_secret: None,
79            labels: None,
80            is_draft,
81            draft_saved_at: None,
82            draft_base: None,
83            no_deployed: None,
84            draft: None,
85            other_drafts_users: None,
86        }
87    }
88}
89/// 
90#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
91pub enum ExecutionMode {
92    #[serde(rename = "viewer")]
93    Viewer,
94    #[serde(rename = "publisher")]
95    Publisher,
96    #[serde(rename = "anonymous")]
97    Anonymous,
98}
99
100impl Default for ExecutionMode {
101    fn default() -> ExecutionMode {
102        Self::Viewer
103    }
104}
105