#[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 CheckAlert {
    #[serde(rename = "rid")]
    rid: super::super::super::rids::api::CheckAlertRid,
    #[serde(rename = "checkRid")]
    check_rid: super::super::super::rids::api::CheckRid,
    #[builder(default, into)]
    #[serde(
        rename = "implementationIndex",
        skip_serializing_if = "Option::is_none",
        default
    )]
    implementation_index: Option<i32>,
    #[serde(rename = "dataReviewRid")]
    data_review_rid: super::super::super::rids::api::DataReviewRid,
    #[serde(rename = "checkEvaluationRid")]
    check_evaluation_rid: conjure_object::ResourceIdentifier,
    #[builder(into)]
    #[serde(rename = "name")]
    name: String,
    #[builder(default, into)]
    #[serde(
        rename = "autogeneratedCheckTitle",
        skip_serializing_if = "Option::is_none",
        default
    )]
    autogenerated_check_title: Option<String>,
    #[builder(default, into)]
    #[serde(
        rename = "autogeneratedCheckDescription",
        skip_serializing_if = "Option::is_none",
        default
    )]
    autogenerated_check_description: Option<String>,
    #[builder(default, set(item(type = super::super::super::rids::api::UserRid)))]
    #[serde(
        rename = "assigneeRids",
        skip_serializing_if = "std::collections::BTreeSet::is_empty",
        default
    )]
    assignee_rids: std::collections::BTreeSet<super::super::super::rids::api::UserRid>,
    #[builder(
        custom(type = super::super::super::super::api::Timestamp, convert = Box::new)
    )]
    #[serde(rename = "start")]
    start: Box<super::super::super::super::api::Timestamp>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::super::super::super::api::Timestamp>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "end", skip_serializing_if = "Option::is_none", default)]
    end: Option<Box<super::super::super::super::api::Timestamp>>,
    #[builder(
        custom(
            type = super::super::super::rids::api::CheckAlertState,
            convert = Box::new
        )
    )]
    #[serde(rename = "state")]
    state: Box<super::super::super::rids::api::CheckAlertState>,
    #[serde(rename = "priority")]
    priority: super::super::super::api::Priority,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::super::super::rids::api::VersionedVizId>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "chart", skip_serializing_if = "Option::is_none", default)]
    chart: Option<Box<super::super::super::rids::api::VersionedVizId>>,
    #[builder(default, into)]
    #[serde(rename = "notes", skip_serializing_if = "Option::is_none", default)]
    notes: Option<String>,
    #[builder(default, into)]
    #[serde(rename = "notebook", skip_serializing_if = "Option::is_none", default)]
    notebook: Option<super::super::super::rids::api::NotebookRid>,
}
impl CheckAlert {
    #[inline]
    pub fn rid(&self) -> &super::super::super::rids::api::CheckAlertRid {
        &self.rid
    }
    #[inline]
    pub fn check_rid(&self) -> &super::super::super::rids::api::CheckRid {
        &self.check_rid
    }
    #[inline]
    pub fn implementation_index(&self) -> Option<i32> {
        self.implementation_index.as_ref().map(|o| *o)
    }
    #[inline]
    pub fn data_review_rid(&self) -> &super::super::super::rids::api::DataReviewRid {
        &self.data_review_rid
    }
    #[inline]
    pub fn check_evaluation_rid(&self) -> &conjure_object::ResourceIdentifier {
        &self.check_evaluation_rid
    }
    #[inline]
    pub fn name(&self) -> &str {
        &*self.name
    }
    #[inline]
    pub fn autogenerated_check_title(&self) -> Option<&str> {
        self.autogenerated_check_title.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn autogenerated_check_description(&self) -> Option<&str> {
        self.autogenerated_check_description.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn assignee_rids(
        &self,
    ) -> &std::collections::BTreeSet<super::super::super::rids::api::UserRid> {
        &self.assignee_rids
    }
    #[inline]
    pub fn start(&self) -> &super::super::super::super::api::Timestamp {
        &*self.start
    }
    #[inline]
    pub fn end(&self) -> Option<&super::super::super::super::api::Timestamp> {
        self.end.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn state(&self) -> &super::super::super::rids::api::CheckAlertState {
        &*self.state
    }
    #[inline]
    pub fn priority(&self) -> &super::super::super::api::Priority {
        &self.priority
    }
    #[deprecated(note = "charts are no longer versioned resources.")]
    #[inline]
    pub fn chart(&self) -> Option<&super::super::super::rids::api::VersionedVizId> {
        self.chart.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn notes(&self) -> Option<&str> {
        self.notes.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn notebook(&self) -> Option<&super::super::super::rids::api::NotebookRid> {
        self.notebook.as_ref().map(|o| &*o)
    }
}
