nominal_api/conjure/objects/scout/checks/api/
checklist_variable.rs1#[derive(
2 Debug,
3 Clone,
4 conjure_object::serde::Serialize,
5 conjure_object::serde::Deserialize,
6 conjure_object::private::DeriveWith
7)]
8#[serde(crate = "conjure_object::serde")]
9#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
10#[conjure_object::private::staged_builder::staged_builder]
11#[builder(crate = conjure_object::private::staged_builder, update, inline)]
12pub struct ChecklistVariable {
13 #[serde(rename = "name")]
14 name: super::super::super::compute::api::VariableName,
15 #[builder(default, into)]
16 #[serde(rename = "displayName", skip_serializing_if = "Option::is_none", default)]
17 display_name: Option<String>,
18 #[builder(custom(type = super::VariableLocator, convert = Box::new))]
19 #[serde(rename = "value")]
20 value: Box<super::VariableLocator>,
21}
22impl ChecklistVariable {
23 #[inline]
25 pub fn new(
26 name: super::super::super::compute::api::VariableName,
27 value: super::VariableLocator,
28 ) -> Self {
29 Self::builder().name(name).value(value).build()
30 }
31 #[inline]
32 pub fn name(&self) -> &super::super::super::compute::api::VariableName {
33 &self.name
34 }
35 #[inline]
36 pub fn display_name(&self) -> Option<&str> {
37 self.display_name.as_ref().map(|o| &**o)
38 }
39 #[inline]
40 pub fn value(&self) -> &super::VariableLocator {
41 &*self.value
42 }
43}