Skip to main content

nominal_api/conjure/objects/scout/datareview/api/
link_notebook.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 LinkNotebook {
16    #[serde(rename = "rid")]
17    rid: super::super::super::rids::api::NotebookRid,
18    #[builder(
19        default,
20        custom(
21            type = impl
22            Into<Option<super::LinkNotebookStrategy>>,
23            convert = |v|v.into().map(Box::new)
24        )
25    )]
26    #[serde(rename = "strategy", skip_serializing_if = "Option::is_none", default)]
27    strategy: Option<Box<super::LinkNotebookStrategy>>,
28}
29impl LinkNotebook {
30    /// Constructs a new instance of the type.
31    #[inline]
32    pub fn new(rid: super::super::super::rids::api::NotebookRid) -> Self {
33        Self::builder().rid(rid).build()
34    }
35    #[inline]
36    pub fn rid(&self) -> &super::super::super::rids::api::NotebookRid {
37        &self.rid
38    }
39    /// Defines the strategy for reconciling the alert with any linked alerts via the associated notebook. If not
40    /// provided, the alert will be linked naively and throw if it leaves a linked notebook in an invalid state.
41    #[inline]
42    pub fn strategy(&self) -> Option<&super::LinkNotebookStrategy> {
43        self.strategy.as_ref().map(|o| &**o)
44    }
45}