Skip to main content

windmill_api/models/
create_variable.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.699.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 CreateVariable {
16    /// The path to the variable
17    #[serde(rename = "path")]
18    pub path: String,
19    /// The value of the variable
20    #[serde(rename = "value")]
21    pub value: String,
22    /// Whether the variable is a secret
23    #[serde(rename = "is_secret")]
24    pub is_secret: bool,
25    /// The description of the variable
26    #[serde(rename = "description")]
27    pub description: String,
28    /// The account identifier
29    #[serde(rename = "account", skip_serializing_if = "Option::is_none")]
30    pub account: Option<i32>,
31    /// Whether the variable is an OAuth variable
32    #[serde(rename = "is_oauth", skip_serializing_if = "Option::is_none")]
33    pub is_oauth: Option<bool>,
34    /// The expiration date of the variable
35    #[serde(rename = "expires_at", skip_serializing_if = "Option::is_none")]
36    pub expires_at: Option<String>,
37    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
38    pub labels: Option<Vec<String>>,
39    #[serde(rename = "ws_specific", skip_serializing_if = "Option::is_none")]
40    pub ws_specific: Option<bool>,
41}
42
43impl CreateVariable {
44    pub fn new(path: String, value: String, is_secret: bool, description: String) -> CreateVariable {
45        CreateVariable {
46            path,
47            value,
48            is_secret,
49            description,
50            account: None,
51            is_oauth: None,
52            expires_at: None,
53            labels: None,
54            ws_specific: None,
55        }
56    }
57}
58