#[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 Asset {
    #[serde(rename = "rid")]
    rid: super::super::super::rids::api::AssetRid,
    #[builder(into)]
    #[serde(rename = "title")]
    title: String,
    #[builder(default, into)]
    #[serde(rename = "description", skip_serializing_if = "Option::is_none", default)]
    description: Option<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>,
    #[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, list(item(type = super::super::super::run::api::Link)))]
    #[serde(rename = "links", skip_serializing_if = "Vec::is_empty", default)]
    links: Vec<super::super::super::run::api::Link>,
    #[builder(default, list(item(type = super::DataScope)))]
    #[serde(rename = "dataScopes", skip_serializing_if = "Vec::is_empty", default)]
    data_scopes: Vec<super::DataScope>,
    #[builder(default, into)]
    #[serde(rename = "createdBy", skip_serializing_if = "Option::is_none", default)]
    created_by: Option<conjure_object::ResourceIdentifier>,
    #[serde(rename = "createdAt")]
    created_at: conjure_object::DateTime<conjure_object::Utc>,
    #[serde(rename = "updatedAt")]
    updated_at: conjure_object::DateTime<conjure_object::Utc>,
    #[builder(default, set(item(type = conjure_object::ResourceIdentifier)))]
    #[serde(
        rename = "attachments",
        skip_serializing_if = "std::collections::BTreeSet::is_empty",
        default
    )]
    attachments: std::collections::BTreeSet<conjure_object::ResourceIdentifier>,
    #[builder(default, into)]
    #[serde(rename = "type", skip_serializing_if = "Option::is_none", default)]
    type_: Option<super::super::super::rids::api::TypeRid>,
    #[serde(rename = "isStaged")]
    is_staged: bool,
    #[serde(rename = "isArchived")]
    is_archived: bool,
}
impl Asset {
    #[inline]
    pub fn rid(&self) -> &super::super::super::rids::api::AssetRid {
        &self.rid
    }
    #[inline]
    pub fn title(&self) -> &str {
        &*self.title
    }
    #[inline]
    pub fn description(&self) -> Option<&str> {
        self.description.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn properties(&self) -> &std::collections::BTreeMap<String, String> {
        &self.properties
    }
    /// Labels associated with the asset. These labels do not have a time dimension.
    /// To associate labels with a range of time, create a time range on the asset with labels.
    #[inline]
    pub fn labels(&self) -> &std::collections::BTreeSet<String> {
        &self.labels
    }
    /// Links associated with the asset. These links do not have a time dimension.
    /// To associate links with a range of time, create a time range on the asset with links.
    #[inline]
    pub fn links(&self) -> &[super::super::super::run::api::Link] {
        &*self.links
    }
    /// The data scopes associated with the asset.
    #[inline]
    pub fn data_scopes(&self) -> &[super::DataScope] {
        &*self.data_scopes
    }
    #[inline]
    pub fn created_by(&self) -> Option<&conjure_object::ResourceIdentifier> {
        self.created_by.as_ref().map(|o| &*o)
    }
    #[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
    }
    #[inline]
    pub fn attachments(
        &self,
    ) -> &std::collections::BTreeSet<conjure_object::ResourceIdentifier> {
        &self.attachments
    }
    #[inline]
    pub fn type_(&self) -> Option<&super::super::super::rids::api::TypeRid> {
        self.type_.as_ref().map(|o| &*o)
    }
    /// Auto created assets are considered staged by default.
    #[inline]
    pub fn is_staged(&self) -> bool {
        self.is_staged
    }
    #[inline]
    pub fn is_archived(&self) -> bool {
        self.is_archived
    }
}
