#[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 VersionedChecklist {
    #[serde(rename = "rid")]
    rid: super::super::super::rids::api::ChecklistRid,
    #[builder(custom(type = super::ChecklistMetadata, convert = Box::new))]
    #[serde(rename = "metadata")]
    metadata: Box<super::ChecklistMetadata>,
    #[builder(
        custom(type = super::super::super::versioning::api::Commit, convert = Box::new)
    )]
    #[serde(rename = "commit")]
    commit: Box<super::super::super::versioning::api::Commit>,
    #[builder(default, into)]
    #[serde(rename = "functions", skip_serializing_if = "Option::is_none", default)]
    functions: Option<Vec<super::Function>>,
    #[builder(default, list(item(type = super::ChecklistEntry)))]
    #[serde(rename = "checks", skip_serializing_if = "Vec::is_empty", default)]
    checks: Vec<super::ChecklistEntry>,
    #[builder(default, list(item(type = super::ChecklistVariable)))]
    #[serde(
        rename = "checklistVariables",
        skip_serializing_if = "Vec::is_empty",
        default
    )]
    checklist_variables: Vec<super::ChecklistVariable>,
}
impl VersionedChecklist {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        rid: super::super::super::rids::api::ChecklistRid,
        metadata: super::ChecklistMetadata,
        commit: super::super::super::versioning::api::Commit,
    ) -> Self {
        Self::builder().rid(rid).metadata(metadata).commit(commit).build()
    }
    #[inline]
    pub fn rid(&self) -> &super::super::super::rids::api::ChecklistRid {
        &self.rid
    }
    #[inline]
    pub fn metadata(&self) -> &super::ChecklistMetadata {
        &*self.metadata
    }
    #[inline]
    pub fn commit(&self) -> &super::super::super::versioning::api::Commit {
        &*self.commit
    }
    #[deprecated(
        note = "The functions field is deprecated and will be removed in a future version.\n"
    )]
    #[inline]
    pub fn functions(&self) -> Option<&[super::Function]> {
        self.functions.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn checks(&self) -> &[super::ChecklistEntry] {
        &*self.checks
    }
    /// Variables that can be used in checks. Variables are resolved in order of declaration.
    /// If variable `a` depends on variable `b`, then `b` must be defined before `a` in the list.
    #[inline]
    pub fn checklist_variables(&self) -> &[super::ChecklistVariable] {
        &*self.checklist_variables
    }
}
