#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    conjure_object::private::DeriveWith
)]
#[serde(crate = "conjure_object::serde")]
#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct Check {
    #[serde(rename = "rid")]
    rid: super::super::super::rids::api::CheckRid,
    #[serde(rename = "checkLineageRid")]
    check_lineage_rid: super::super::super::rids::api::CheckLineageRid,
    #[builder(into)]
    #[serde(rename = "title")]
    title: String,
    #[builder(into)]
    #[serde(rename = "description")]
    description: String,
    #[builder(default, into)]
    #[serde(
        rename = "autoGeneratedTitle",
        skip_serializing_if = "Option::is_none",
        default
    )]
    auto_generated_title: Option<String>,
    #[builder(default, into)]
    #[serde(
        rename = "autoGeneratedDescription",
        skip_serializing_if = "Option::is_none",
        default
    )]
    auto_generated_description: Option<String>,
    #[serde(rename = "priority")]
    priority: super::super::super::api::Priority,
    #[serde(rename = "generatedEventType")]
    generated_event_type: super::super::super::super::event::EventType,
    #[builder(default, into)]
    #[serde(
        rename = "generatedEventLabels",
        skip_serializing_if = "Option::is_none",
        default
    )]
    generated_event_labels: Option<std::collections::BTreeSet<String>>,
    #[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,
        custom(
            type = impl
            Into<Option<super::CheckCondition>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "condition", skip_serializing_if = "Option::is_none", default)]
    condition: Option<Box<super::CheckCondition>>,
}
impl Check {
    #[inline]
    pub fn rid(&self) -> &super::super::super::rids::api::CheckRid {
        &self.rid
    }
    #[inline]
    pub fn check_lineage_rid(&self) -> &super::super::super::rids::api::CheckLineageRid {
        &self.check_lineage_rid
    }
    #[inline]
    pub fn title(&self) -> &str {
        &*self.title
    }
    #[inline]
    pub fn description(&self) -> &str {
        &*self.description
    }
    #[inline]
    pub fn auto_generated_title(&self) -> Option<&str> {
        self.auto_generated_title.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn auto_generated_description(&self) -> Option<&str> {
        self.auto_generated_description.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn priority(&self) -> &super::super::super::api::Priority {
        &self.priority
    }
    #[inline]
    pub fn generated_event_type(&self) -> &super::super::super::super::event::EventType {
        &self.generated_event_type
    }
    #[inline]
    pub fn generated_event_labels(&self) -> Option<&std::collections::BTreeSet<String>> {
        self.generated_event_labels.as_ref().map(|o| &*o)
    }
    #[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)
    }
    /// If omitted, this check represents a manual check.
    #[inline]
    pub fn condition(&self) -> Option<&super::CheckCondition> {
        self.condition.as_ref().map(|o| &**o)
    }
}
