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.651.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}
34
35impl CreateAppRequest {
36    pub fn new(path: String, value: Option<serde_json::Value>, summary: String, policy: models::Policy) -> CreateAppRequest {
37        CreateAppRequest {
38            path,
39            value,
40            summary,
41            policy: Box::new(policy),
42            draft_only: None,
43            deployment_message: None,
44            custom_path: None,
45            preserve_on_behalf_of: None,
46        }
47    }
48}
49