#[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 ChannelMetadata {
    #[builder(into)]
    #[serde(rename = "name")]
    name: String,
    #[serde(rename = "dataSource")]
    data_source: conjure_object::ResourceIdentifier,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::super::super::scout::run::api::Unit>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "unit", skip_serializing_if = "Option::is_none", default)]
    unit: Option<Box<super::super::super::scout::run::api::Unit>>,
    #[builder(default, into)]
    #[serde(rename = "description", skip_serializing_if = "Option::is_none", default)]
    description: Option<String>,
    #[builder(default, into)]
    #[serde(rename = "dataType", skip_serializing_if = "Option::is_none", default)]
    data_type: Option<super::super::super::api::SeriesDataType>,
    #[builder(
        custom(type = super::SeriesMetadataRidOrLogicalSeriesRid, convert = Box::new)
    )]
    #[serde(rename = "seriesRid")]
    series_rid: Box<super::SeriesMetadataRidOrLogicalSeriesRid>,
}
impl ChannelMetadata {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        name: impl Into<String>,
        data_source: conjure_object::ResourceIdentifier,
        series_rid: super::SeriesMetadataRidOrLogicalSeriesRid,
    ) -> Self {
        Self::builder()
            .name(name)
            .data_source(data_source)
            .series_rid(series_rid)
            .build()
    }
    #[inline]
    pub fn name(&self) -> &str {
        &*self.name
    }
    #[inline]
    pub fn data_source(&self) -> &conjure_object::ResourceIdentifier {
        &self.data_source
    }
    #[inline]
    pub fn unit(&self) -> Option<&super::super::super::scout::run::api::Unit> {
        self.unit.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn description(&self) -> Option<&str> {
        self.description.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn data_type(&self) -> Option<&super::super::super::api::SeriesDataType> {
        self.data_type.as_ref().map(|o| &*o)
    }
    #[inline]
    pub fn series_rid(&self) -> &super::SeriesMetadataRidOrLogicalSeriesRid {
        &*self.series_rid
    }
}
