#[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 CreateAssetDataScope {
    #[serde(rename = "dataScopeName")]
    data_scope_name: super::super::super::api::DataSourceRefName,
    #[builder(
        custom(type = super::super::super::run::api::DataSource, convert = Box::new)
    )]
    #[serde(rename = "dataSource")]
    data_source: Box<super::super::super::run::api::DataSource>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::super::super::run::api::Duration>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "offset", skip_serializing_if = "Option::is_none", default)]
    offset: Option<Box<super::super::super::run::api::Duration>>,
    #[builder(default, map(key(type = String, into), value(type = String, into)))]
    #[serde(
        rename = "seriesTags",
        skip_serializing_if = "std::collections::BTreeMap::is_empty",
        default
    )]
    series_tags: std::collections::BTreeMap<String, String>,
}
impl CreateAssetDataScope {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        data_scope_name: super::super::super::api::DataSourceRefName,
        data_source: super::super::super::run::api::DataSource,
    ) -> Self {
        Self::builder().data_scope_name(data_scope_name).data_source(data_source).build()
    }
    /// The name of the data scope. The name is guaranteed to be be unique within the context of an asset.
    #[inline]
    pub fn data_scope_name(&self) -> &super::super::super::api::DataSourceRefName {
        &self.data_scope_name
    }
    #[inline]
    pub fn data_source(&self) -> &super::super::super::run::api::DataSource {
        &*self.data_source
    }
    #[inline]
    pub fn offset(&self) -> Option<&super::super::super::run::api::Duration> {
        self.offset.as_ref().map(|o| &**o)
    }
    /// Filters the data source to series matching these tag values. The filtered set of series should be
    /// the ones that belong to the asset.
    #[inline]
    pub fn series_tags(&self) -> &std::collections::BTreeMap<String, String> {
        &self.series_tags
    }
}
