/// Close the alert with further action. If the alert is linked to the same notebook as other alerts, the other
/// alerts will also be closed with further action. This will also lock the associated notebook.
#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash
)]
#[serde(crate = "conjure_object::serde")]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct CloseWithFurtherAction {
    #[builder(into)]
    #[serde(rename = "comment")]
    comment: String,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::CloseStrategy>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "strategy", skip_serializing_if = "Option::is_none", default)]
    strategy: Option<Box<super::CloseStrategy>>,
}
impl CloseWithFurtherAction {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(comment: impl Into<String>) -> Self {
        Self::builder().comment(comment).build()
    }
    #[inline]
    pub fn comment(&self) -> &str {
        &*self.comment
    }
    /// Defines the strategy for reopening the alert and any alerts linked via an associated notebook. If not
    /// provided, the alert will be closed naively and throw if it leaves a linked notebook in an invalid state.
    #[inline]
    pub fn strategy(&self) -> Option<&super::CloseStrategy> {
        self.strategy.as_ref().map(|o| &**o)
    }
}
