Skip to main content

windmill_api/models/
create_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.717.1
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 CreateAppRequest {
16    #[serde(rename = "path")]
17    pub path: String,
18    #[serde(rename = "value", deserialize_with = "Option::deserialize")]
19    pub value: Option<serde_json::Value>,
20    #[serde(rename = "summary")]
21    pub summary: String,
22    #[serde(rename = "policy")]
23    pub policy: Box<models::Policy>,
24    #[serde(rename = "draft_only", skip_serializing_if = "Option::is_none")]
25    pub draft_only: Option<bool>,
26    #[serde(rename = "deployment_message", skip_serializing_if = "Option::is_none")]
27    pub deployment_message: Option<String>,
28    #[serde(rename = "custom_path", skip_serializing_if = "Option::is_none")]
29    pub custom_path: Option<String>,
30    /// 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.
31    #[serde(rename = "preserve_on_behalf_of", skip_serializing_if = "Option::is_none")]
32    pub preserve_on_behalf_of: Option<bool>,
33    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
34    pub labels: Option<Vec<String>>,
35    /// When true (set by the CLI / git sync), deploying this app does not delete an existing user draft at the same path.
36    #[serde(rename = "skip_draft_deletion", skip_serializing_if = "Option::is_none")]
37    pub skip_draft_deletion: Option<bool>,
38}
39
40impl CreateAppRequest {
41    pub fn new(path: String, value: Option<serde_json::Value>, summary: String, policy: models::Policy) -> CreateAppRequest {
42        CreateAppRequest {
43            path,
44            value,
45            summary,
46            policy: Box::new(policy),
47            draft_only: None,
48            deployment_message: None,
49            custom_path: None,
50            preserve_on_behalf_of: None,
51            labels: None,
52            skip_draft_deletion: None,
53        }
54    }
55}
56