Skip to main content

nominal_api/conjure/objects/scout/chartdefinition/api/
procedure_viz_definition_v2.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    PartialEq,
7    Eq,
8    PartialOrd,
9    Ord,
10    Hash
11)]
12#[serde(crate = "conjure_object::serde")]
13#[conjure_object::private::staged_builder::staged_builder]
14#[builder(crate = conjure_object::private::staged_builder, update, inline)]
15pub struct ProcedureVizDefinitionV2 {
16    #[builder(default, into)]
17    #[serde(rename = "title", skip_serializing_if = "Option::is_none", default)]
18    title: Option<String>,
19    #[builder(
20        default,
21        custom(
22            type = impl
23            Into<Option<super::ProcedureVizId>>,
24            convert = |v|v.into().map(Box::new)
25        )
26    )]
27    #[serde(rename = "procedure", skip_serializing_if = "Option::is_none", default)]
28    procedure: Option<Box<super::ProcedureVizId>>,
29}
30impl ProcedureVizDefinitionV2 {
31    /// Constructs a new instance of the type.
32    #[inline]
33    pub fn new() -> Self {
34        Self::builder().build()
35    }
36    #[inline]
37    pub fn title(&self) -> Option<&str> {
38        self.title.as_ref().map(|o| &**o)
39    }
40    /// A workbook can save either an execution or a template. Workbook templates should only use the latter.
41    #[inline]
42    pub fn procedure(&self) -> Option<&super::ProcedureVizId> {
43        self.procedure.as_ref().map(|o| &**o)
44    }
45}