#[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 TemplateMetadata {
    #[builder(into)]
    #[serde(rename = "title")]
    title: String,
    #[builder(into)]
    #[serde(rename = "description")]
    description: String,
    #[builder(default, set(item(type = String, into)))]
    #[serde(
        rename = "labels",
        skip_serializing_if = "std::collections::BTreeSet::is_empty",
        default
    )]
    labels: std::collections::BTreeSet<String>,
    #[builder(default, map(key(type = String, into), value(type = String, into)))]
    #[serde(
        rename = "properties",
        skip_serializing_if = "std::collections::BTreeMap::is_empty",
        default
    )]
    properties: std::collections::BTreeMap<String, String>,
    #[serde(rename = "isArchived")]
    is_archived: bool,
    #[serde(rename = "isPublished")]
    is_published: bool,
    #[serde(rename = "createdBy")]
    created_by: super::super::super::rids::api::UserRid,
    #[serde(rename = "createdAt")]
    created_at: conjure_object::DateTime<conjure_object::Utc>,
    #[serde(rename = "updatedAt")]
    updated_at: conjure_object::DateTime<conjure_object::Utc>,
    #[serde(rename = "editedAt")]
    edited_at: conjure_object::DateTime<conjure_object::Utc>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::super::super::super::api::ThemeAwareImage>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "previewImage", skip_serializing_if = "Option::is_none", default)]
    preview_image: Option<Box<super::super::super::super::api::ThemeAwareImage>>,
}
impl TemplateMetadata {
    #[inline]
    pub fn title(&self) -> &str {
        &*self.title
    }
    #[inline]
    pub fn description(&self) -> &str {
        &*self.description
    }
    #[inline]
    pub fn labels(&self) -> &std::collections::BTreeSet<String> {
        &self.labels
    }
    #[inline]
    pub fn properties(&self) -> &std::collections::BTreeMap<String, String> {
        &self.properties
    }
    #[inline]
    pub fn is_archived(&self) -> bool {
        self.is_archived
    }
    #[inline]
    pub fn is_published(&self) -> bool {
        self.is_published
    }
    #[inline]
    pub fn created_by(&self) -> &super::super::super::rids::api::UserRid {
        &self.created_by
    }
    #[inline]
    pub fn created_at(&self) -> conjure_object::DateTime<conjure_object::Utc> {
        self.created_at
    }
    #[inline]
    pub fn updated_at(&self) -> conjure_object::DateTime<conjure_object::Utc> {
        self.updated_at
    }
    /// The time of the last permanent commit to the main branch.
    #[inline]
    pub fn edited_at(&self) -> conjure_object::DateTime<conjure_object::Utc> {
        self.edited_at
    }
    #[inline]
    pub fn preview_image(
        &self,
    ) -> Option<&super::super::super::super::api::ThemeAwareImage> {
        self.preview_image.as_ref().map(|o| &**o)
    }
}
