nominal_api/conjure/objects/ingest/workflow/api/
ingest_dataflash_response.rs1#[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 IngestDataflashResponse {
16 #[builder(default, map(key(type = String, into), value(type = String, into)))]
17 #[serde(
18 rename = "units",
19 skip_serializing_if = "std::collections::BTreeMap::is_empty",
20 default
21 )]
22 units: std::collections::BTreeMap<String, String>,
23 #[builder(default, list(item(type = super::ObjectLocator)))]
24 #[serde(
25 rename = "parquetObjectLocators",
26 skip_serializing_if = "Vec::is_empty",
27 default
28 )]
29 parquet_object_locators: Vec<super::ObjectLocator>,
30 #[builder(into)]
31 #[serde(rename = "timestampSeriesName")]
32 timestamp_series_name: String,
33 #[serde(rename = "timeUnit")]
34 time_unit: super::TimeUnitSeconds,
35 #[builder(
36 default,
37 custom(
38 type = impl
39 Into<Option<super::ObjectLocator>>,
40 convert = |v|v.into().map(Box::new)
41 )
42 )]
43 #[serde(rename = "avroLocator", skip_serializing_if = "Option::is_none", default)]
44 avro_locator: Option<Box<super::ObjectLocator>>,
45}
46impl IngestDataflashResponse {
47 #[inline]
49 pub fn new(
50 timestamp_series_name: impl Into<String>,
51 time_unit: super::TimeUnitSeconds,
52 ) -> Self {
53 Self::builder()
54 .timestamp_series_name(timestamp_series_name)
55 .time_unit(time_unit)
56 .build()
57 }
58 #[inline]
59 pub fn units(&self) -> &std::collections::BTreeMap<String, String> {
60 &self.units
61 }
62 #[inline]
65 pub fn parquet_object_locators(&self) -> &[super::ObjectLocator] {
66 &*self.parquet_object_locators
67 }
68 #[inline]
70 pub fn timestamp_series_name(&self) -> &str {
71 &*self.timestamp_series_name
72 }
73 #[inline]
75 pub fn time_unit(&self) -> &super::TimeUnitSeconds {
76 &self.time_unit
77 }
78 #[inline]
81 pub fn avro_locator(&self) -> Option<&super::ObjectLocator> {
82 self.avro_locator.as_ref().map(|o| &**o)
83 }
84}