/// Slices a numeric series by pre-resolved intervals, injecting tags from each interval.
/// Points outside all intervals are dropped.
#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    conjure_object::private::DeriveWith
)]
#[serde(crate = "conjure_object::serde")]
#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct TagByIntervalsSeriesNode {
    #[builder(custom(type = super::NumericSeriesNode, convert = Box::new))]
    #[serde(rename = "input")]
    input: Box<super::NumericSeriesNode>,
    #[builder(default, set(item(type = String, into)))]
    #[serde(
        rename = "tagKeys",
        skip_serializing_if = "std::collections::BTreeSet::is_empty",
        default
    )]
    tag_keys: std::collections::BTreeSet<String>,
    #[builder(default, list(item(type = super::TaggedInterval)))]
    #[serde(rename = "sortedIntervals", skip_serializing_if = "Vec::is_empty", default)]
    sorted_intervals: Vec<super::TaggedInterval>,
}
impl TagByIntervalsSeriesNode {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(input: super::NumericSeriesNode) -> Self {
        Self::builder().input(input).build()
    }
    #[inline]
    pub fn input(&self) -> &super::NumericSeriesNode {
        &*self.input
    }
    #[inline]
    pub fn tag_keys(&self) -> &std::collections::BTreeSet<String> {
        &self.tag_keys
    }
    #[inline]
    pub fn sorted_intervals(&self) -> &[super::TaggedInterval] {
        &*self.sorted_intervals
    }
}
