Skip to main content

nominal_api/conjure/objects/scout/chartdefinition/api/
event.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 Event {
16    #[builder(default, into)]
17    #[serde(rename = "displayName", skip_serializing_if = "Option::is_none", default)]
18    display_name: Option<String>,
19    #[serde(rename = "eventUuid")]
20    event_uuid: conjure_object::Uuid,
21    #[serde(rename = "isPinned")]
22    is_pinned: bool,
23}
24impl Event {
25    /// Constructs a new instance of the type.
26    #[inline]
27    pub fn new(event_uuid: conjure_object::Uuid, is_pinned: bool) -> Self {
28        Self::builder().event_uuid(event_uuid).is_pinned(is_pinned).build()
29    }
30    #[inline]
31    pub fn display_name(&self) -> Option<&str> {
32        self.display_name.as_ref().map(|o| &**o)
33    }
34    #[inline]
35    pub fn event_uuid(&self) -> conjure_object::Uuid {
36        self.event_uuid
37    }
38    #[inline]
39    pub fn is_pinned(&self) -> bool {
40        self.is_pinned
41    }
42}