#[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 CreateTypeRequest {
    #[builder(into)]
    #[serde(rename = "name")]
    name: 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>,
    #[builder(default, into)]
    #[serde(rename = "description", skip_serializing_if = "Option::is_none", default)]
    description: Option<String>,
    #[builder(default, into)]
    #[serde(rename = "iconName", skip_serializing_if = "Option::is_none", default)]
    icon_name: Option<String>,
    #[builder(default, into)]
    #[serde(rename = "workspace", skip_serializing_if = "Option::is_none", default)]
    workspace: Option<conjure_object::ResourceIdentifier>,
    #[builder(default, into)]
    #[serde(
        rename = "datasourceConfigs",
        skip_serializing_if = "Option::is_none",
        default
    )]
    datasource_configs: Option<
        std::collections::BTreeMap<
            conjure_object::ResourceIdentifier,
            super::AssetTypeDataScopeConfig,
        >,
    >,
}
impl CreateTypeRequest {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(name: impl Into<String>) -> Self {
        Self::builder().name(name).build()
    }
    #[inline]
    pub fn name(&self) -> &str {
        &*self.name
    }
    #[inline]
    pub fn property_configs(
        &self,
    ) -> &std::collections::BTreeMap<String, super::PropertyConfig> {
        &self.property_configs
    }
    #[inline]
    pub fn description(&self) -> Option<&str> {
        self.description.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn icon_name(&self) -> Option<&str> {
        self.icon_name.as_ref().map(|o| &**o)
    }
    /// The workspace in which to create the asset type. If not provided, the asset type will be created in
    /// the default workspace for the user's organization, if the default workspace for the
    /// organization is configured.
    #[inline]
    pub fn workspace(&self) -> Option<&conjure_object::ResourceIdentifier> {
        self.workspace.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,
    ) -> Option<
        &std::collections::BTreeMap<
            conjure_object::ResourceIdentifier,
            super::AssetTypeDataScopeConfig,
        >,
    > {
        self.datasource_configs.as_ref().map(|o| &*o)
    }
}
