nomad_api_types/types/
variable.rs

1/*
2 * This is an auto-generated file.
3 * Any manual changes may be overwritten without notice!
4 */
5
6use derive_builder::Builder;
7use serde::{Deserialize, Serialize};
8
9/// Variable specifies the metadata and contents to be stored in the
10/// encrypted Nomad backend.
11///
12/// This struct was generated based on the Go types of the official Nomad API client.
13#[derive(Clone, Debug, PartialEq, Deserialize, Serialize, Builder, Default)]
14pub struct Variable {
15    /// Namespace is the Nomad namespace associated with the variable
16    #[serde(rename = "Namespace")]
17    #[builder(default)]
18    pub namespace: String,
19
20    /// Path is the path to the variable
21    #[serde(rename = "Path")]
22    #[builder(default)]
23    pub path: String,
24
25    /// CreateIndex tracks the index of creation time
26    #[serde(rename = "CreateIndex")]
27    #[builder(default)]
28    pub create_index: u64,
29
30    /// ModifyTime is the unix nano of the last modified time
31    #[serde(rename = "ModifyIndex")]
32    #[builder(default)]
33    pub modify_index: u64,
34
35    /// CreateTime is the unix nano of the creation time
36    #[serde(rename = "CreateTime")]
37    #[builder(default)]
38    pub create_time: i64,
39
40    /// ModifyTime is the unix nano of the last modified time
41    #[serde(rename = "ModifyTime")]
42    #[builder(default)]
43    pub modify_time: i64,
44
45    /// Items contains the k/v variable component
46    #[serde(
47        rename = "Items",
48        deserialize_with = "crate::deserialize_null_as_default"
49    )]
50    #[builder(default)]
51    pub items: std::collections::HashMap<String, String>,
52
53    /// Lock holds the information about the variable lock if its being used.
54    #[serde(rename = "Lock", skip_serializing_if = "Option::is_none")]
55    #[builder(default)]
56    pub lock: Option<super::VariableLock>,
57}
58impl Variable {
59    pub fn builder() -> VariableBuilder {
60        VariableBuilder::default()
61    }
62}