#[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 SeriesMetadata {
    #[serde(rename = "rid")]
    rid: conjure_object::ResourceIdentifier,
    #[builder(into)]
    #[serde(rename = "channel")]
    channel: String,
    #[serde(rename = "dataSourceRid")]
    data_source_rid: conjure_object::ResourceIdentifier,
    #[builder(custom(type = super::LocatorTemplate, convert = Box::new))]
    #[serde(rename = "locator")]
    locator: Box<super::LocatorTemplate>,
    #[builder(default, into)]
    #[serde(rename = "unit", skip_serializing_if = "Option::is_none", default)]
    unit: Option<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 = "tags",
        skip_serializing_if = "std::collections::BTreeMap::is_empty",
        default
    )]
    tags: std::collections::BTreeMap<String, String>,
    #[builder(default, into)]
    #[serde(rename = "seriesDataType", skip_serializing_if = "Option::is_none", default)]
    series_data_type: Option<super::super::super::super::api::SeriesDataType>,
}
impl SeriesMetadata {
    #[inline]
    pub fn rid(&self) -> &conjure_object::ResourceIdentifier {
        &self.rid
    }
    #[inline]
    pub fn channel(&self) -> &str {
        &*self.channel
    }
    #[inline]
    pub fn data_source_rid(&self) -> &conjure_object::ResourceIdentifier {
        &self.data_source_rid
    }
    #[inline]
    pub fn locator(&self) -> &super::LocatorTemplate {
        &*self.locator
    }
    #[inline]
    pub fn unit(&self) -> Option<&str> {
        self.unit.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn description(&self) -> Option<&str> {
        self.description.as_ref().map(|o| &**o)
    }
    /// Tags specified here will take precedence over tags specified in the RunDatasource, in the case that both specify the same TagName.
    #[deprecated(note = "Deprecated. Should not be used.")]
    #[inline]
    pub fn tags(&self) -> &std::collections::BTreeMap<String, String> {
        &self.tags
    }
    #[inline]
    pub fn series_data_type(
        &self,
    ) -> Option<&super::super::super::super::api::SeriesDataType> {
        self.series_data_type.as_ref().map(|o| &*o)
    }
}
