#[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 Type {
    #[serde(rename = "rid")]
    rid: super::super::super::rids::api::TypeRid,
    #[builder(into)]
    #[serde(rename = "name")]
    name: 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 = super::PropertyConfig))
    )]
    #[serde(
        rename = "propertyConfigs",
        skip_serializing_if = "std::collections::BTreeMap::is_empty",
        default
    )]
    property_configs: std::collections::BTreeMap<String, super::PropertyConfig>,
    #[serde(rename = "createdAt")]
    created_at: conjure_object::DateTime<conjure_object::Utc>,
    #[builder(default, into)]
    #[serde(rename = "iconName", skip_serializing_if = "Option::is_none", default)]
    icon_name: Option<String>,
    #[builder(
        default,
        map(
            key(type = conjure_object::ResourceIdentifier),
            value(type = super::AssetTypeDataScopeConfig)
        )
    )]
    #[serde(
        rename = "datasourceConfigs",
        skip_serializing_if = "std::collections::BTreeMap::is_empty",
        default
    )]
    datasource_configs: std::collections::BTreeMap<
        conjure_object::ResourceIdentifier,
        super::AssetTypeDataScopeConfig,
    >,
}
impl Type {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        rid: super::super::super::rids::api::TypeRid,
        name: impl Into<String>,
        created_at: conjure_object::DateTime<conjure_object::Utc>,
    ) -> Self {
        Self::builder().rid(rid).name(name).created_at(created_at).build()
    }
    #[inline]
    pub fn rid(&self) -> &super::super::super::rids::api::TypeRid {
        &self.rid
    }
    #[inline]
    pub fn name(&self) -> &str {
        &*self.name
    }
    #[inline]
    pub fn description(&self) -> Option<&str> {
        self.description.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn property_configs(
        &self,
    ) -> &std::collections::BTreeMap<String, super::PropertyConfig> {
        &self.property_configs
    }
    #[inline]
    pub fn created_at(&self) -> conjure_object::DateTime<conjure_object::Utc> {
        self.created_at
    }
    /// The name of the icon to display for the type. This name maps to a Lucide icon in the frontend.
    #[inline]
    pub fn icon_name(&self) -> Option<&str> {
        self.icon_name.as_ref().map(|o| &**o)
    }
    /// The configuration outlines what a data scope should provide when added to an asset of this type. It is
    /// referenced at data scope creation time, but does not actively modify existing data scopes.
    #[inline]
    pub fn datasource_configs(
        &self,
    ) -> &std::collections::BTreeMap<
        conjure_object::ResourceIdentifier,
        super::AssetTypeDataScopeConfig,
    > {
        &self.datasource_configs
    }
}
