nomad_api_types/types/
attribute.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/// Attribute is used to describe the value of an attribute, optionally
10/// specifying units
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 Attribute {
15    /// Float is the float value for the attribute
16    #[serde(rename = "Float", skip_serializing_if = "Option::is_none")]
17    #[builder(default)]
18    pub float_val: Option<f64>,
19
20    /// Int is the int value for the attribute
21    #[serde(rename = "Int", skip_serializing_if = "Option::is_none")]
22    #[builder(default)]
23    pub int_val: Option<i64>,
24
25    /// String is the string value for the attribute
26    #[serde(rename = "String", skip_serializing_if = "Option::is_none")]
27    #[builder(default)]
28    pub string_val: Option<String>,
29
30    /// Bool is the bool value for the attribute
31    #[serde(rename = "Bool", skip_serializing_if = "Option::is_none")]
32    #[builder(default)]
33    pub bool_val: Option<bool>,
34
35    /// Unit is the optional unit for the set int or float value
36    #[serde(rename = "Unit")]
37    #[builder(default)]
38    pub unit: String,
39}
40impl Attribute {
41    pub fn builder() -> AttributeBuilder {
42        AttributeBuilder::default()
43    }
44}