Skip to main content

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

1/// Public view of a streaming ingest session.
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 StreamingSession {
17    #[serde(rename = "sessionRid")]
18    session_rid: super::StreamingSessionRid,
19    #[serde(rename = "datasetRid")]
20    dataset_rid: super::super::super::api::rids::DatasetRid,
21    #[serde(rename = "status")]
22    status: super::StreamingSessionStatus,
23    #[builder(
24        default,
25        custom(
26            type = impl
27            Into<Option<super::StreamingSessionSource>>,
28            convert = |v|v.into().map(Box::new)
29        )
30    )]
31    #[serde(rename = "source", skip_serializing_if = "Option::is_none", default)]
32    source: Option<Box<super::StreamingSessionSource>>,
33    #[builder(
34        default,
35        custom(
36            type = impl
37            Into<Option<super::super::super::api::Range>>,
38            convert = |v|v.into().map(Box::new)
39        )
40    )]
41    #[serde(rename = "bounds", skip_serializing_if = "Option::is_none", default)]
42    bounds: Option<Box<super::super::super::api::Range>>,
43    #[serde(rename = "pointsCount")]
44    points_count: conjure_object::SafeLong,
45    #[builder(custom(type = super::super::super::api::Timestamp, convert = Box::new))]
46    #[serde(rename = "createdAt")]
47    created_at: Box<super::super::super::api::Timestamp>,
48}
49impl StreamingSession {
50    #[inline]
51    pub fn session_rid(&self) -> &super::StreamingSessionRid {
52        &self.session_rid
53    }
54    #[inline]
55    pub fn dataset_rid(&self) -> &super::super::super::api::rids::DatasetRid {
56        &self.dataset_rid
57    }
58    #[inline]
59    pub fn status(&self) -> &super::StreamingSessionStatus {
60        &self.status
61    }
62    #[inline]
63    pub fn source(&self) -> Option<&super::StreamingSessionSource> {
64        self.source.as_ref().map(|o| &**o)
65    }
66    #[inline]
67    pub fn bounds(&self) -> Option<&super::super::super::api::Range> {
68        self.bounds.as_ref().map(|o| &**o)
69    }
70    #[inline]
71    pub fn points_count(&self) -> conjure_object::SafeLong {
72        self.points_count
73    }
74    #[inline]
75    pub fn created_at(&self) -> &super::super::super::api::Timestamp {
76        &*self.created_at
77    }
78}