Skip to main content

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

1/// Stores a video as a variable rather than the deprecated video datasource rid.
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Serialize,
6    conjure_object::serde::Deserialize,
7    PartialEq,
8    Eq,
9    PartialOrd,
10    Ord,
11    Hash
12)]
13#[serde(crate = "conjure_object::serde")]
14#[conjure_object::private::staged_builder::staged_builder]
15#[builder(crate = conjure_object::private::staged_builder, update, inline)]
16pub struct VideoVizDefinitionV2 {
17    #[builder(default, into)]
18    #[serde(rename = "title", skip_serializing_if = "Option::is_none", default)]
19    title: Option<String>,
20    #[serde(rename = "variable")]
21    variable: super::super::super::channelvariables::api::ChannelVariableName,
22}
23impl VideoVizDefinitionV2 {
24    /// Constructs a new instance of the type.
25    #[inline]
26    pub fn new(
27        variable: super::super::super::channelvariables::api::ChannelVariableName,
28    ) -> Self {
29        Self::builder().variable(variable).build()
30    }
31    #[inline]
32    pub fn title(&self) -> Option<&str> {
33        self.title.as_ref().map(|o| &**o)
34    }
35    #[inline]
36    pub fn variable(
37        &self,
38    ) -> &super::super::super::channelvariables::api::ChannelVariableName {
39        &self.variable
40    }
41}