#[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 LinkNotebook {
    #[serde(rename = "rid")]
    rid: super::super::super::rids::api::NotebookRid,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::LinkNotebookStrategy>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "strategy", skip_serializing_if = "Option::is_none", default)]
    strategy: Option<Box<super::LinkNotebookStrategy>>,
}
impl LinkNotebook {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(rid: super::super::super::rids::api::NotebookRid) -> Self {
        Self::builder().rid(rid).build()
    }
    #[inline]
    pub fn rid(&self) -> &super::super::super::rids::api::NotebookRid {
        &self.rid
    }
    /// Defines the strategy for reconciling the alert with any linked alerts via the associated notebook. If not
    /// provided, the alert will be linked naively and throw if it leaves a linked notebook in an invalid state.
    #[inline]
    pub fn strategy(&self) -> Option<&super::LinkNotebookStrategy> {
        self.strategy.as_ref().map(|o| &**o)
    }
}
