#[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 ExternalStorageLocator {
    #[serde(rename = "rid")]
    rid: conjure_object::ResourceIdentifier,
    #[serde(rename = "dataSourceRid")]
    data_source_rid: conjure_object::ResourceIdentifier,
    #[builder(custom(type = super::Locator, convert = Box::new))]
    #[serde(rename = "locator")]
    locator: Box<super::Locator>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::Locator>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "timeLocator", skip_serializing_if = "Option::is_none", default)]
    time_locator: Option<Box<super::Locator>>,
    #[builder(into)]
    #[serde(rename = "channel")]
    channel: String,
    #[builder(default, into)]
    #[serde(rename = "description", skip_serializing_if = "Option::is_none", default)]
    description: Option<String>,
    #[builder(default, into)]
    #[serde(rename = "unit", skip_serializing_if = "Option::is_none", default)]
    unit: Option<String>,
    #[builder(default, into)]
    #[serde(rename = "seriesDataType", skip_serializing_if = "Option::is_none", default)]
    series_data_type: Option<super::super::super::super::api::SeriesDataType>,
    #[builder(default, into)]
    #[serde(rename = "granularity", skip_serializing_if = "Option::is_none", default)]
    granularity: Option<super::super::super::super::api::Granularity>,
}
impl ExternalStorageLocator {
    #[inline]
    pub fn rid(&self) -> &conjure_object::ResourceIdentifier {
        &self.rid
    }
    #[inline]
    pub fn data_source_rid(&self) -> &conjure_object::ResourceIdentifier {
        &self.data_source_rid
    }
    #[inline]
    pub fn locator(&self) -> &super::Locator {
        &*self.locator
    }
    /// Only required to be present for legacy CSVs.
    #[inline]
    pub fn time_locator(&self) -> Option<&super::Locator> {
        self.time_locator.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn channel(&self) -> &str {
        &*self.channel
    }
    #[inline]
    pub fn description(&self) -> Option<&str> {
        self.description.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn unit(&self) -> Option<&str> {
        self.unit.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn series_data_type(
        &self,
    ) -> Option<&super::super::super::super::api::SeriesDataType> {
        self.series_data_type.as_ref().map(|o| &*o)
    }
    /// Time granularity of the series. If omitted, defaults to nanoseconds.
    #[deprecated(
        note = "The source of truth for granularity comes from the data source of the logical series."
    )]
    #[inline]
    pub fn granularity(&self) -> Option<&super::super::super::super::api::Granularity> {
        self.granularity.as_ref().map(|o| &*o)
    }
}
