#[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 CreateExternalStorageLocator {
    #[builder(into)]
    #[serde(rename = "channel")]
    channel: String,
    #[builder(custom(type = super::Locator, convert = Box::new))]
    #[serde(rename = "locator")]
    locator: Box<super::Locator>,
    #[builder(default, into)]
    #[serde(rename = "idLocator", skip_serializing_if = "Option::is_none", default)]
    id_locator: Option<conjure_object::Uuid>,
    #[serde(rename = "dataSourceRid")]
    data_source_rid: conjure_object::ResourceIdentifier,
    #[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>,
    #[builder(default, into)]
    #[serde(
        rename = "seriesArchetypeRid",
        skip_serializing_if = "Option::is_none",
        default
    )]
    series_archetype_rid: Option<conjure_object::ResourceIdentifier>,
}
impl CreateExternalStorageLocator {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        channel: impl Into<String>,
        locator: super::Locator,
        data_source_rid: conjure_object::ResourceIdentifier,
    ) -> Self {
        Self::builder()
            .channel(channel)
            .locator(locator)
            .data_source_rid(data_source_rid)
            .build()
    }
    #[inline]
    pub fn channel(&self) -> &str {
        &*self.channel
    }
    #[inline]
    pub fn locator(&self) -> &super::Locator {
        &*self.locator
    }
    /// If present, will be used as the locator of the LogicalSeriesRid. If a logical series already exists
    /// with this id, will throw a CONFLICT.
    #[inline]
    pub fn id_locator(&self) -> Option<conjure_object::Uuid> {
        self.id_locator.as_ref().map(|o| *o)
    }
    #[inline]
    pub fn data_source_rid(&self) -> &conjure_object::ResourceIdentifier {
        &self.data_source_rid
    }
    #[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)
    }
    #[inline]
    pub fn granularity(&self) -> Option<&super::super::super::super::api::Granularity> {
        self.granularity.as_ref().map(|o| &*o)
    }
    /// Deprecated. Do not use.
    #[inline]
    pub fn series_archetype_rid(&self) -> Option<&conjure_object::ResourceIdentifier> {
        self.series_archetype_rid.as_ref().map(|o| &*o)
    }
}
