Skip to main content

nominal_api/conjure/objects/scout/datareview/api/
close_with_further_action.rs

1/// Close the alert with further action. If the alert is linked to the same notebook as other alerts, the other
2/// alerts will also be closed with further action. This will also lock the associated notebook.
3#[derive(
4    Debug,
5    Clone,
6    conjure_object::serde::Serialize,
7    conjure_object::serde::Deserialize,
8    PartialEq,
9    Eq,
10    PartialOrd,
11    Ord,
12    Hash
13)]
14#[serde(crate = "conjure_object::serde")]
15#[conjure_object::private::staged_builder::staged_builder]
16#[builder(crate = conjure_object::private::staged_builder, update, inline)]
17pub struct CloseWithFurtherAction {
18    #[builder(into)]
19    #[serde(rename = "comment")]
20    comment: String,
21    #[builder(
22        default,
23        custom(
24            type = impl
25            Into<Option<super::CloseStrategy>>,
26            convert = |v|v.into().map(Box::new)
27        )
28    )]
29    #[serde(rename = "strategy", skip_serializing_if = "Option::is_none", default)]
30    strategy: Option<Box<super::CloseStrategy>>,
31}
32impl CloseWithFurtherAction {
33    /// Constructs a new instance of the type.
34    #[inline]
35    pub fn new(comment: impl Into<String>) -> Self {
36        Self::builder().comment(comment).build()
37    }
38    #[inline]
39    pub fn comment(&self) -> &str {
40        &*self.comment
41    }
42    /// Defines the strategy for reopening the alert and any alerts linked via an associated notebook. If not
43    /// provided, the alert will be closed naively and throw if it leaves a linked notebook in an invalid state.
44    #[inline]
45    pub fn strategy(&self) -> Option<&super::CloseStrategy> {
46        self.strategy.as_ref().map(|o| &**o)
47    }
48}