#[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 Commit {
    #[serde(rename = "id")]
    id: super::CommitId,
    #[serde(rename = "resourceRid")]
    resource_rid: conjure_object::ResourceIdentifier,
    #[builder(default, into)]
    #[serde(rename = "parentCommit", skip_serializing_if = "Option::is_none", default)]
    parent_commit: Option<super::CommitId>,
    #[builder(default, into)]
    #[serde(
        rename = "mergeParentCommit",
        skip_serializing_if = "Option::is_none",
        default
    )]
    merge_parent_commit: Option<super::CommitId>,
    #[builder(into)]
    #[serde(rename = "message")]
    message: String,
    #[serde(rename = "isWorkingState")]
    is_working_state: bool,
    #[serde(rename = "committedBy")]
    committed_by: super::super::super::rids::api::UserRid,
    #[serde(rename = "committedAt")]
    committed_at: conjure_object::DateTime<conjure_object::Utc>,
}
impl Commit {
    #[inline]
    pub fn id(&self) -> &super::CommitId {
        &self.id
    }
    #[inline]
    pub fn resource_rid(&self) -> &conjure_object::ResourceIdentifier {
        &self.resource_rid
    }
    #[inline]
    pub fn parent_commit(&self) -> Option<&super::CommitId> {
        self.parent_commit.as_ref().map(|o| &*o)
    }
    #[inline]
    pub fn merge_parent_commit(&self) -> Option<&super::CommitId> {
        self.merge_parent_commit.as_ref().map(|o| &*o)
    }
    #[inline]
    pub fn message(&self) -> &str {
        &*self.message
    }
    /// A working state commit is created via the `saveWorkingState` endpoint
    /// and is non-permanent. In the future, it may be compacted and not exist.
    #[inline]
    pub fn is_working_state(&self) -> bool {
        self.is_working_state
    }
    #[inline]
    pub fn committed_by(&self) -> &super::super::super::rids::api::UserRid {
        &self.committed_by
    }
    #[inline]
    pub fn committed_at(&self) -> conjure_object::DateTime<conjure_object::Utc> {
        self.committed_at
    }
}
