nominal_api/conjure/objects/scout/compute/resolved/api/
stale_ranges_node.rs1#[derive(
2 Debug,
3 Clone,
4 conjure_object::serde::Serialize,
5 conjure_object::serde::Deserialize,
6 conjure_object::private::DeriveWith
7)]
8#[serde(crate = "conjure_object::serde")]
9#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
10#[conjure_object::private::staged_builder::staged_builder]
11#[builder(crate = conjure_object::private::staged_builder, update, inline)]
12pub struct StaleRangesNode {
13 #[builder(custom(type = super::SeriesNode, convert = Box::new))]
14 #[serde(rename = "input")]
15 input: Box<super::SeriesNode>,
16 #[builder(
17 custom(type = super::super::super::super::run::api::Duration, convert = Box::new)
18 )]
19 #[serde(rename = "threshold")]
20 threshold: Box<super::super::super::super::run::api::Duration>,
21 #[builder(
22 default,
23 custom(
24 type = impl
25 Into<Option<super::super::super::super::super::api::Timestamp>>,
26 convert = |v|v.into().map(Box::new)
27 )
28 )]
29 #[serde(rename = "startTimestamp", skip_serializing_if = "Option::is_none", default)]
30 start_timestamp: Option<Box<super::super::super::super::super::api::Timestamp>>,
31}
32impl StaleRangesNode {
33 #[inline]
35 pub fn new(
36 input: super::SeriesNode,
37 threshold: super::super::super::super::run::api::Duration,
38 ) -> Self {
39 Self::builder().input(input).threshold(threshold).build()
40 }
41 #[inline]
42 pub fn input(&self) -> &super::SeriesNode {
43 &*self.input
44 }
45 #[inline]
46 pub fn threshold(&self) -> &super::super::super::super::run::api::Duration {
47 &*self.threshold
48 }
49 #[inline]
50 pub fn start_timestamp(
51 &self,
52 ) -> Option<&super::super::super::super::super::api::Timestamp> {
53 self.start_timestamp.as_ref().map(|o| &**o)
54 }
55}