Skip to main content

nominal_api/conjure/objects/scout/chartdefinition/api/
log_panel_definition_v1.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 LogPanelDefinitionV1 {
16    #[builder(default, into)]
17    #[serde(rename = "title", skip_serializing_if = "Option::is_none", default)]
18    title: Option<String>,
19    #[builder(
20        default,
21        list(
22            item(type = super::super::super::channelvariables::api::ChannelVariableName)
23        )
24    )]
25    #[serde(rename = "logChannels", skip_serializing_if = "Vec::is_empty", default)]
26    log_channels: Vec<super::super::super::channelvariables::api::ChannelVariableName>,
27    #[builder(default, into)]
28    #[serde(rename = "logChannelsV2", skip_serializing_if = "Option::is_none", default)]
29    log_channels_v2: Option<Vec<super::LogChannel>>,
30}
31impl LogPanelDefinitionV1 {
32    /// Constructs a new instance of the type.
33    #[inline]
34    pub fn new() -> Self {
35        Self::builder().build()
36    }
37    #[inline]
38    pub fn title(&self) -> Option<&str> {
39        self.title.as_ref().map(|o| &**o)
40    }
41    #[inline]
42    pub fn log_channels(
43        &self,
44    ) -> &[super::super::super::channelvariables::api::ChannelVariableName] {
45        &*self.log_channels
46    }
47    #[inline]
48    pub fn log_channels_v2(&self) -> Option<&[super::LogChannel]> {
49        self.log_channels_v2.as_ref().map(|o| &**o)
50    }
51}