Skip to main content

nominal_api/conjure/objects/scout/datareview/api/
generated_alerts_state.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 GeneratedAlertsState {
16    #[builder(default, into)]
17    #[serde(rename = "rids", skip_serializing_if = "Option::is_none", default)]
18    rids: Option<
19        std::collections::BTreeSet<super::super::super::rids::api::CheckAlertRid>,
20    >,
21    #[builder(default, set(item(type = conjure_object::ResourceIdentifier)))]
22    #[serde(
23        rename = "eventRids",
24        skip_serializing_if = "std::collections::BTreeSet::is_empty",
25        default
26    )]
27    event_rids: std::collections::BTreeSet<conjure_object::ResourceIdentifier>,
28}
29impl GeneratedAlertsState {
30    /// Constructs a new instance of the type.
31    #[inline]
32    pub fn new() -> Self {
33        Self::builder().build()
34    }
35    #[deprecated(
36        note = "This field is deprecated and will be removed in a future version.\nUse eventRids instead.\n"
37    )]
38    #[inline]
39    pub fn rids(
40        &self,
41    ) -> Option<
42        &std::collections::BTreeSet<super::super::super::rids::api::CheckAlertRid>,
43    > {
44        self.rids.as_ref().map(|o| &*o)
45    }
46    #[inline]
47    pub fn event_rids(
48        &self,
49    ) -> &std::collections::BTreeSet<conjure_object::ResourceIdentifier> {
50        &self.event_rids
51    }
52}