Skip to main content

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

1/// Intervals come from an event query. Each event defines [timestamp, timestamp+duration).
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Serialize,
6    conjure_object::serde::Deserialize,
7    PartialEq,
8    Eq,
9    PartialOrd,
10    Ord,
11    Hash
12)]
13#[serde(crate = "conjure_object::serde")]
14#[conjure_object::private::staged_builder::staged_builder]
15#[builder(crate = conjure_object::private::staged_builder, update, inline)]
16pub struct EventIntervalSource {
17    #[builder(
18        custom(
19            type = super::super::super::rids::api::ComputeEventQuery,
20            convert = Box::new
21        )
22    )]
23    #[serde(rename = "query")]
24    query: Box<super::super::super::rids::api::ComputeEventQuery>,
25    #[builder(default, list(item(type = super::EventTagSource)))]
26    #[serde(rename = "tagBy", skip_serializing_if = "Vec::is_empty", default)]
27    tag_by: Vec<super::EventTagSource>,
28}
29impl EventIntervalSource {
30    /// Constructs a new instance of the type.
31    #[inline]
32    pub fn new(query: super::super::super::rids::api::ComputeEventQuery) -> Self {
33        Self::builder().query(query).build()
34    }
35    #[inline]
36    pub fn query(&self) -> &super::super::super::rids::api::ComputeEventQuery {
37        &*self.query
38    }
39    /// Non-empty ordered list of tag sources. Each contributes a tag key-value pair per event interval.
40    #[inline]
41    pub fn tag_by(&self) -> &[super::EventTagSource] {
42        &*self.tag_by
43    }
44}