nominal_api/conjure/objects/scout/compute/api/
stale_ranges.rs1#[derive(
5 Debug,
6 Clone,
7 conjure_object::serde::Serialize,
8 conjure_object::serde::Deserialize,
9 conjure_object::private::DeriveWith
10)]
11#[serde(crate = "conjure_object::serde")]
12#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
13#[conjure_object::private::staged_builder::staged_builder]
14#[builder(crate = conjure_object::private::staged_builder, update, inline)]
15pub struct StaleRanges {
16 #[builder(custom(type = super::Series, convert = Box::new))]
17 #[serde(rename = "input")]
18 input: Box<super::Series>,
19 #[builder(custom(type = super::DurationConstant, convert = Box::new))]
20 #[serde(rename = "threshold")]
21 threshold: Box<super::DurationConstant>,
22 #[builder(
23 default,
24 custom(
25 type = impl
26 Into<Option<super::TimestampConstant>>,
27 convert = |v|v.into().map(Box::new)
28 )
29 )]
30 #[serde(rename = "startTimestamp", skip_serializing_if = "Option::is_none", default)]
31 start_timestamp: Option<Box<super::TimestampConstant>>,
32 #[builder(
33 default,
34 custom(
35 type = impl
36 Into<Option<super::TimestampConstant>>,
37 convert = |v|v.into().map(Box::new)
38 )
39 )]
40 #[serde(rename = "endTimestamp", skip_serializing_if = "Option::is_none", default)]
41 end_timestamp: Option<Box<super::TimestampConstant>>,
42}
43impl StaleRanges {
44 #[inline]
46 pub fn new(input: super::Series, threshold: super::DurationConstant) -> Self {
47 Self::builder().input(input).threshold(threshold).build()
48 }
49 #[inline]
50 pub fn input(&self) -> &super::Series {
51 &*self.input
52 }
53 #[inline]
54 pub fn threshold(&self) -> &super::DurationConstant {
55 &*self.threshold
56 }
57 #[inline]
59 pub fn start_timestamp(&self) -> Option<&super::TimestampConstant> {
60 self.start_timestamp.as_ref().map(|o| &**o)
61 }
62 #[deprecated(note = "No longer used and will be removed")]
63 #[inline]
64 pub fn end_timestamp(&self) -> Option<&super::TimestampConstant> {
65 self.end_timestamp.as_ref().map(|o| &**o)
66 }
67}