/// A reference to a checklist that may be pinned to a specific commit.
/// If commit is empty, this refers to "the latest commit on main".
#[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 ChecklistRef {
    #[serde(rename = "rid")]
    rid: super::super::super::rids::api::ChecklistRid,
    #[builder(default, into)]
    #[serde(rename = "commit", skip_serializing_if = "Option::is_none", default)]
    commit: Option<super::super::super::versioning::api::CommitId>,
}
impl ChecklistRef {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(rid: super::super::super::rids::api::ChecklistRid) -> Self {
        Self::builder().rid(rid).build()
    }
    #[inline]
    pub fn rid(&self) -> &super::super::super::rids::api::ChecklistRid {
        &self.rid
    }
    #[inline]
    pub fn commit(&self) -> Option<&super::super::super::versioning::api::CommitId> {
        self.commit.as_ref().map(|o| &*o)
    }
}
