1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
* Windmill API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.848.0
* Contact: contact@windmill.dev
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateVariable {
/// The path to the variable
#[serde(rename = "path")]
pub path: String,
/// The value of the variable
#[serde(rename = "value")]
pub value: String,
/// Whether the variable is a secret
#[serde(rename = "is_secret")]
pub is_secret: bool,
/// The description of the variable
#[serde(rename = "description")]
pub description: String,
/// Ignored. A variable is linked to an OAuth account only when `createAccount` creates both.
#[serde(rename = "account", skip_serializing_if = "Option::is_none")]
pub account: Option<i32>,
/// Whether the variable is an OAuth variable
#[serde(rename = "is_oauth", skip_serializing_if = "Option::is_none")]
pub is_oauth: Option<bool>,
/// When to garbage-collect the variable. Used for ephemeral secrets; the variable is deleted once this is reached. Not the value's expiry — see value_valid_until.
#[serde(rename = "expires_at", skip_serializing_if = "Option::is_none")]
pub expires_at: Option<String>,
/// When the value stored in this variable stops working. Triggers the workspace's variable expiration handler ahead of it, by the handler's `notify_before_secs` (1 day by default); never causes the variable to be deleted.
#[serde(rename = "value_valid_until", skip_serializing_if = "Option::is_none")]
pub value_valid_until: Option<String>,
#[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
pub labels: Option<Vec<String>>,
#[serde(rename = "ws_specific", skip_serializing_if = "Option::is_none")]
pub ws_specific: Option<bool>,
}
impl CreateVariable {
pub fn new(path: String, value: String, is_secret: bool, description: String) -> CreateVariable {
CreateVariable {
path,
value,
is_secret,
description,
account: None,
is_oauth: None,
expires_at: None,
value_valid_until: None,
labels: None,
ws_specific: None,
}
}
}