Skip to main content

nominal_api/conjure/objects/scout/workbookcommon/api/
workbook_content.rs

1#[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 WorkbookContent {
13    #[builder(default)]
14    #[serde(
15        rename = "channelVariables",
16        skip_serializing_if = "std::collections::BTreeMap::is_empty",
17        default
18    )]
19    channel_variables: super::super::super::channelvariables::api::WorkbookChannelVariableMap,
20    #[builder(
21        default,
22        custom(
23            type = impl
24            Into<Option<super::WorkbookInputs>>,
25            convert = |v|v.into().map(Box::new)
26        )
27    )]
28    #[serde(rename = "inputs", skip_serializing_if = "Option::is_none", default)]
29    inputs: Option<Box<super::WorkbookInputs>>,
30    #[builder(default)]
31    #[serde(
32        rename = "charts",
33        skip_serializing_if = "std::collections::BTreeMap::is_empty",
34        default
35    )]
36    charts: super::super::super::chartdefinition::api::WorkbookVizDefinitionMap,
37    #[builder(
38        default,
39        custom(
40            type = impl
41            Into<Option<super::WorkbookSettings>>,
42            convert = |v|v.into().map(Box::new)
43        )
44    )]
45    #[serde(rename = "settings", skip_serializing_if = "Option::is_none", default)]
46    settings: Option<Box<super::WorkbookSettings>>,
47    #[builder(
48        default,
49        custom(
50            type = impl
51            Into<Option<super::WorkbookDataScopeInputs>>,
52            convert = |v|v.into().map(Box::new)
53        )
54    )]
55    #[serde(
56        rename = "dataScopeInputs",
57        skip_serializing_if = "Option::is_none",
58        default
59    )]
60    data_scope_inputs: Option<Box<super::WorkbookDataScopeInputs>>,
61}
62impl WorkbookContent {
63    /// Constructs a new instance of the type.
64    #[inline]
65    pub fn new() -> Self {
66        Self::builder().build()
67    }
68    #[inline]
69    pub fn channel_variables(
70        &self,
71    ) -> &super::super::super::channelvariables::api::WorkbookChannelVariableMap {
72        &self.channel_variables
73    }
74    #[inline]
75    pub fn inputs(&self) -> Option<&super::WorkbookInputs> {
76        self.inputs.as_ref().map(|o| &**o)
77    }
78    /// map of visualizations. Previously termed "charts"
79    #[inline]
80    pub fn charts(
81        &self,
82    ) -> &super::super::super::chartdefinition::api::WorkbookVizDefinitionMap {
83        &self.charts
84    }
85    #[inline]
86    pub fn settings(&self) -> Option<&super::WorkbookSettings> {
87        self.settings.as_ref().map(|o| &**o)
88    }
89    #[inline]
90    pub fn data_scope_inputs(&self) -> Option<&super::WorkbookDataScopeInputs> {
91        self.data_scope_inputs.as_ref().map(|o| &**o)
92    }
93}