Skip to main content

nominal_api/conjure/objects/scout/compute/api/
range_interval_source.rs

1/// Intervals come from a range series. Must resolve to literal ranges.
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Serialize,
6    conjure_object::serde::Deserialize,
7    conjure_object::private::DeriveWith
8)]
9#[serde(crate = "conjure_object::serde")]
10#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
11#[conjure_object::private::staged_builder::staged_builder]
12#[builder(crate = conjure_object::private::staged_builder, update, inline)]
13pub struct RangeIntervalSource {
14    #[builder(custom(type = super::RangeSeries, convert = Box::new))]
15    #[serde(rename = "ranges")]
16    ranges: Box<super::RangeSeries>,
17    #[builder(default, list(item(type = super::RangeTagSource)))]
18    #[serde(rename = "tagBy", skip_serializing_if = "Vec::is_empty", default)]
19    tag_by: Vec<super::RangeTagSource>,
20}
21impl RangeIntervalSource {
22    /// Constructs a new instance of the type.
23    #[inline]
24    pub fn new(ranges: super::RangeSeries) -> Self {
25        Self::builder().ranges(ranges).build()
26    }
27    #[inline]
28    pub fn ranges(&self) -> &super::RangeSeries {
29        &*self.ranges
30    }
31    /// Non-empty ordered list of tag sources. Each contributes a tag key-value pair per range interval.
32    #[inline]
33    pub fn tag_by(&self) -> &[super::RangeTagSource] {
34        &*self.tag_by
35    }
36}