Skip to main content

nominal_api/conjure/objects/ingest/api/
heartbeat_streaming_session_request.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    PartialEq,
7    Eq,
8    PartialOrd,
9    Ord,
10    Hash
11)]
12#[serde(crate = "conjure_object::serde")]
13#[conjure_object::private::staged_builder::staged_builder]
14#[builder(crate = conjure_object::private::staged_builder, update, inline)]
15pub struct HeartbeatStreamingSessionRequest {
16    #[builder(custom(type = super::super::super::api::Range, convert = Box::new))]
17    #[serde(rename = "bounds")]
18    bounds: Box<super::super::super::api::Range>,
19    #[serde(rename = "pointsCount")]
20    points_count: i32,
21}
22impl HeartbeatStreamingSessionRequest {
23    /// Constructs a new instance of the type.
24    #[inline]
25    pub fn new(bounds: super::super::super::api::Range, points_count: i32) -> Self {
26        Self::builder().bounds(bounds).points_count(points_count).build()
27    }
28    /// The time range of data points ingested since the last heartbeat.
29    /// The server atomically merges this with the session's existing bounds
30    /// using LEAST/GREATEST to track the full time range.
31    #[inline]
32    pub fn bounds(&self) -> &super::super::super::api::Range {
33        &*self.bounds
34    }
35    /// Number of data points ingested since the last heartbeat.
36    /// The server atomically adds this to the session's running total.
37    #[inline]
38    pub fn points_count(&self) -> i32 {
39        self.points_count
40    }
41}