/// One expanded leaf of the dataset. Semantic fields (assetRid, runRid, dataScope)
/// carry the branch context from dataset expansion.
#[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 Locator {
    #[builder(default, into)]
    #[serde(rename = "assetRid", skip_serializing_if = "Option::is_none", default)]
    asset_rid: Option<super::super::super::rids::api::AssetRid>,
    #[builder(default, into)]
    #[serde(rename = "runRid", skip_serializing_if = "Option::is_none", default)]
    run_rid: Option<super::super::super::run::api::RunRid>,
    #[builder(default, into)]
    #[serde(rename = "dataScope", skip_serializing_if = "Option::is_none", default)]
    data_scope: Option<String>,
    #[serde(rename = "dataSourceRid")]
    data_source_rid: conjure_object::ResourceIdentifier,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::super::super::super::api::Range>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "timeRange", skip_serializing_if = "Option::is_none", default)]
    time_range: Option<Box<super::super::super::super::api::Range>>,
    #[builder(default, map(key(type = String, into), value(type = String, into)))]
    #[serde(
        rename = "injectedTags",
        skip_serializing_if = "std::collections::BTreeMap::is_empty",
        default
    )]
    injected_tags: std::collections::BTreeMap<String, String>,
}
impl Locator {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(data_source_rid: conjure_object::ResourceIdentifier) -> Self {
        Self::builder().data_source_rid(data_source_rid).build()
    }
    #[inline]
    pub fn asset_rid(&self) -> Option<&super::super::super::rids::api::AssetRid> {
        self.asset_rid.as_ref().map(|o| &*o)
    }
    #[inline]
    pub fn run_rid(&self) -> Option<&super::super::super::run::api::RunRid> {
        self.run_rid.as_ref().map(|o| &*o)
    }
    #[inline]
    pub fn data_scope(&self) -> Option<&str> {
        self.data_scope.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn data_source_rid(&self) -> &conjure_object::ResourceIdentifier {
        &self.data_source_rid
    }
    /// Effective source time range used for this expanded locator. This can differ from the request time range
    /// when the dataset includes transforms such as `Dataset.timeShift`.
    #[inline]
    pub fn time_range(&self) -> Option<&super::super::super::super::api::Range> {
        self.time_range.as_ref().map(|o| &**o)
    }
    /// Dataset-injected tags accumulated along this branch's resolution path. This includes reserved branch tags
    /// such as ASSET_RID, RUN_RID, and DATA_SCOPE, data-scope series tags, and explicit TaggedDataset pairs.
    #[inline]
    pub fn injected_tags(&self) -> &std::collections::BTreeMap<String, String> {
        &self.injected_tags
    }
}
