Skip to main content

windmill_api/models/
update_app_request.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.848.3
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 UpdateAppRequest {
16    #[serde(rename = "path", skip_serializing_if = "Option::is_none")]
17    pub path: Option<String>,
18    #[serde(rename = "summary", skip_serializing_if = "Option::is_none")]
19    pub summary: Option<String>,
20    #[serde(rename = "value", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
21    pub value: Option<Option<serde_json::Value>>,
22    #[serde(rename = "policy", skip_serializing_if = "Option::is_none")]
23    pub policy: Option<Box<models::Policy>>,
24    /// Changes who may open the app and leaves the rest of the deployed policy, its run-as user included, as it is. Applied under the same lock as a deploy, so neither overwrites the other. Cannot be sent with `policy`, which states its own mode. When the app runs as another user, refused to a caller who is neither an admin nor in 'wm_deployers', and to an operator with builder rights even in 'wm_deployers'; they change the mode by deploying.
25    #[serde(rename = "execution_mode", skip_serializing_if = "Option::is_none")]
26    pub execution_mode: Option<ExecutionMode>,
27    #[serde(rename = "deployment_message", skip_serializing_if = "Option::is_none")]
28    pub deployment_message: Option<String>,
29    #[serde(rename = "custom_path", skip_serializing_if = "Option::is_none")]
30    pub custom_path: Option<String>,
31    /// When true and the caller is a member of the 'wm_deployers' group, preserves the original on_behalf_of value in the policy instead of overwriting it.
32    #[serde(rename = "preserve_on_behalf_of", skip_serializing_if = "Option::is_none")]
33    pub preserve_on_behalf_of: Option<bool>,
34    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
35    pub labels: Option<Vec<String>>,
36    /// When true (set by the CLI / git sync), deploying this app does not delete an existing user draft at the same path.
37    #[serde(rename = "skip_draft_deletion", skip_serializing_if = "Option::is_none")]
38    pub skip_draft_deletion: Option<bool>,
39    /// When true, this deploy may switch the app between low-code and raw. Without it, deploying a value to an app of the other kind is refused so an app is never converted by accident.
40    #[serde(rename = "allow_kind_change", skip_serializing_if = "Option::is_none")]
41    pub allow_kind_change: Option<bool>,
42}
43
44impl UpdateAppRequest {
45    pub fn new() -> UpdateAppRequest {
46        UpdateAppRequest {
47            path: None,
48            summary: None,
49            value: None,
50            policy: None,
51            execution_mode: None,
52            deployment_message: None,
53            custom_path: None,
54            preserve_on_behalf_of: None,
55            labels: None,
56            skip_draft_deletion: None,
57            allow_kind_change: None,
58        }
59    }
60}
61/// Changes who may open the app and leaves the rest of the deployed policy, its run-as user included, as it is. Applied under the same lock as a deploy, so neither overwrites the other. Cannot be sent with `policy`, which states its own mode. When the app runs as another user, refused to a caller who is neither an admin nor in 'wm_deployers', and to an operator with builder rights even in 'wm_deployers'; they change the mode by deploying.
62#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
63pub enum ExecutionMode {
64    #[serde(rename = "viewer")]
65    Viewer,
66    #[serde(rename = "publisher")]
67    Publisher,
68    #[serde(rename = "guest")]
69    Guest,
70    #[serde(rename = "anonymous")]
71    Anonymous,
72}
73
74impl Default for ExecutionMode {
75    fn default() -> ExecutionMode {
76        Self::Viewer
77    }
78}
79