1use crate::telemetry::*;
2impl serde::Serialize for BatchEventMessage {
3 #[allow(deprecated)]
4 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5 where
6 S: serde::Serializer,
7 {
8 use serde::ser::SerializeStruct;
9 let mut len = 0;
10 if !self.events.is_empty() {
11 len += 1;
12 }
13 let mut struct_ser = serializer.serialize_struct("telemetry.BatchEventMessage", len)?;
14 if !self.events.is_empty() {
15 struct_ser.serialize_field("events", &self.events)?;
16 }
17 struct_ser.end()
18 }
19}
20impl<'de> serde::Deserialize<'de> for BatchEventMessage {
21 #[allow(deprecated)]
22 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23 where
24 D: serde::Deserializer<'de>,
25 {
26 const FIELDS: &[&str] = &[
27 "events",
28 ];
29
30 #[allow(clippy::enum_variant_names)]
31 enum GeneratedField {
32 Events,
33 }
34 impl<'de> serde::Deserialize<'de> for GeneratedField {
35 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
36 where
37 D: serde::Deserializer<'de>,
38 {
39 struct GeneratedVisitor;
40
41 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
42 type Value = GeneratedField;
43
44 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
45 write!(formatter, "expected one of: {:?}", &FIELDS)
46 }
47
48 #[allow(unused_variables)]
49 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
50 where
51 E: serde::de::Error,
52 {
53 match value {
54 "events" => Ok(GeneratedField::Events),
55 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
56 }
57 }
58 }
59 deserializer.deserialize_identifier(GeneratedVisitor)
60 }
61 }
62 struct GeneratedVisitor;
63 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
64 type Value = BatchEventMessage;
65
66 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
67 formatter.write_str("struct telemetry.BatchEventMessage")
68 }
69
70 fn visit_map<V>(self, mut map_: V) -> std::result::Result<BatchEventMessage, V::Error>
71 where
72 V: serde::de::MapAccess<'de>,
73 {
74 let mut events__ = None;
75 while let Some(k) = map_.next_key()? {
76 match k {
77 GeneratedField::Events => {
78 if events__.is_some() {
79 return Err(serde::de::Error::duplicate_field("events"));
80 }
81 events__ = Some(map_.next_value()?);
82 }
83 }
84 }
85 Ok(BatchEventMessage {
86 events: events__.unwrap_or_default(),
87 })
88 }
89 }
90 deserializer.deserialize_struct("telemetry.BatchEventMessage", FIELDS, GeneratedVisitor)
91 }
92}
93impl serde::Serialize for CompactorReport {
94 #[allow(deprecated)]
95 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
96 where
97 S: serde::Serializer,
98 {
99 use serde::ser::SerializeStruct;
100 let mut len = 0;
101 if self.base.is_some() {
102 len += 1;
103 }
104 let mut struct_ser = serializer.serialize_struct("telemetry.CompactorReport", len)?;
105 if let Some(v) = self.base.as_ref() {
106 struct_ser.serialize_field("base", v)?;
107 }
108 struct_ser.end()
109 }
110}
111impl<'de> serde::Deserialize<'de> for CompactorReport {
112 #[allow(deprecated)]
113 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
114 where
115 D: serde::Deserializer<'de>,
116 {
117 const FIELDS: &[&str] = &[
118 "base",
119 ];
120
121 #[allow(clippy::enum_variant_names)]
122 enum GeneratedField {
123 Base,
124 }
125 impl<'de> serde::Deserialize<'de> for GeneratedField {
126 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
127 where
128 D: serde::Deserializer<'de>,
129 {
130 struct GeneratedVisitor;
131
132 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
133 type Value = GeneratedField;
134
135 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
136 write!(formatter, "expected one of: {:?}", &FIELDS)
137 }
138
139 #[allow(unused_variables)]
140 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
141 where
142 E: serde::de::Error,
143 {
144 match value {
145 "base" => Ok(GeneratedField::Base),
146 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
147 }
148 }
149 }
150 deserializer.deserialize_identifier(GeneratedVisitor)
151 }
152 }
153 struct GeneratedVisitor;
154 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
155 type Value = CompactorReport;
156
157 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
158 formatter.write_str("struct telemetry.CompactorReport")
159 }
160
161 fn visit_map<V>(self, mut map_: V) -> std::result::Result<CompactorReport, V::Error>
162 where
163 V: serde::de::MapAccess<'de>,
164 {
165 let mut base__ = None;
166 while let Some(k) = map_.next_key()? {
167 match k {
168 GeneratedField::Base => {
169 if base__.is_some() {
170 return Err(serde::de::Error::duplicate_field("base"));
171 }
172 base__ = map_.next_value()?;
173 }
174 }
175 }
176 Ok(CompactorReport {
177 base: base__,
178 })
179 }
180 }
181 deserializer.deserialize_struct("telemetry.CompactorReport", FIELDS, GeneratedVisitor)
182 }
183}
184impl serde::Serialize for ComputeReport {
185 #[allow(deprecated)]
186 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
187 where
188 S: serde::Serializer,
189 {
190 use serde::ser::SerializeStruct;
191 let mut len = 0;
192 if self.base.is_some() {
193 len += 1;
194 }
195 let mut struct_ser = serializer.serialize_struct("telemetry.ComputeReport", len)?;
196 if let Some(v) = self.base.as_ref() {
197 struct_ser.serialize_field("base", v)?;
198 }
199 struct_ser.end()
200 }
201}
202impl<'de> serde::Deserialize<'de> for ComputeReport {
203 #[allow(deprecated)]
204 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
205 where
206 D: serde::Deserializer<'de>,
207 {
208 const FIELDS: &[&str] = &[
209 "base",
210 ];
211
212 #[allow(clippy::enum_variant_names)]
213 enum GeneratedField {
214 Base,
215 }
216 impl<'de> serde::Deserialize<'de> for GeneratedField {
217 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
218 where
219 D: serde::Deserializer<'de>,
220 {
221 struct GeneratedVisitor;
222
223 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
224 type Value = GeneratedField;
225
226 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
227 write!(formatter, "expected one of: {:?}", &FIELDS)
228 }
229
230 #[allow(unused_variables)]
231 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
232 where
233 E: serde::de::Error,
234 {
235 match value {
236 "base" => Ok(GeneratedField::Base),
237 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
238 }
239 }
240 }
241 deserializer.deserialize_identifier(GeneratedVisitor)
242 }
243 }
244 struct GeneratedVisitor;
245 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
246 type Value = ComputeReport;
247
248 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
249 formatter.write_str("struct telemetry.ComputeReport")
250 }
251
252 fn visit_map<V>(self, mut map_: V) -> std::result::Result<ComputeReport, V::Error>
253 where
254 V: serde::de::MapAccess<'de>,
255 {
256 let mut base__ = None;
257 while let Some(k) = map_.next_key()? {
258 match k {
259 GeneratedField::Base => {
260 if base__.is_some() {
261 return Err(serde::de::Error::duplicate_field("base"));
262 }
263 base__ = map_.next_value()?;
264 }
265 }
266 }
267 Ok(ComputeReport {
268 base: base__,
269 })
270 }
271 }
272 deserializer.deserialize_struct("telemetry.ComputeReport", FIELDS, GeneratedVisitor)
273 }
274}
275impl serde::Serialize for EventMessage {
276 #[allow(deprecated)]
277 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
278 where
279 S: serde::Serializer,
280 {
281 use serde::ser::SerializeStruct;
282 let mut len = 0;
283 if !self.tracking_id.is_empty() {
284 len += 1;
285 }
286 if self.event_time_sec != 0 {
287 len += 1;
288 }
289 if self.event_stage != 0 {
290 len += 1;
291 }
292 if !self.event_name.is_empty() {
293 len += 1;
294 }
295 if self.connector_name.is_some() {
296 len += 1;
297 }
298 if self.object.is_some() {
299 len += 1;
300 }
301 if self.catalog_id != 0 {
302 len += 1;
303 }
304 if self.attributes.is_some() {
305 len += 1;
306 }
307 if !self.node.is_empty() {
308 len += 1;
309 }
310 if self.is_test {
311 len += 1;
312 }
313 let mut struct_ser = serializer.serialize_struct("telemetry.EventMessage", len)?;
314 if !self.tracking_id.is_empty() {
315 struct_ser.serialize_field("trackingId", &self.tracking_id)?;
316 }
317 if self.event_time_sec != 0 {
318 #[allow(clippy::needless_borrow)]
319 #[allow(clippy::needless_borrows_for_generic_args)]
320 struct_ser.serialize_field("eventTimeSec", ToString::to_string(&self.event_time_sec).as_str())?;
321 }
322 if self.event_stage != 0 {
323 let v = TelemetryEventStage::try_from(self.event_stage)
324 .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.event_stage)))?;
325 struct_ser.serialize_field("eventStage", &v)?;
326 }
327 if !self.event_name.is_empty() {
328 struct_ser.serialize_field("eventName", &self.event_name)?;
329 }
330 if let Some(v) = self.connector_name.as_ref() {
331 struct_ser.serialize_field("connectorName", v)?;
332 }
333 if let Some(v) = self.object.as_ref() {
334 let v = TelemetryDatabaseObject::try_from(*v)
335 .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?;
336 struct_ser.serialize_field("object", &v)?;
337 }
338 if self.catalog_id != 0 {
339 #[allow(clippy::needless_borrow)]
340 #[allow(clippy::needless_borrows_for_generic_args)]
341 struct_ser.serialize_field("catalogId", ToString::to_string(&self.catalog_id).as_str())?;
342 }
343 if let Some(v) = self.attributes.as_ref() {
344 struct_ser.serialize_field("attributes", v)?;
345 }
346 if !self.node.is_empty() {
347 struct_ser.serialize_field("node", &self.node)?;
348 }
349 if self.is_test {
350 struct_ser.serialize_field("isTest", &self.is_test)?;
351 }
352 struct_ser.end()
353 }
354}
355impl<'de> serde::Deserialize<'de> for EventMessage {
356 #[allow(deprecated)]
357 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
358 where
359 D: serde::Deserializer<'de>,
360 {
361 const FIELDS: &[&str] = &[
362 "tracking_id",
363 "trackingId",
364 "event_time_sec",
365 "eventTimeSec",
366 "event_stage",
367 "eventStage",
368 "event_name",
369 "eventName",
370 "connector_name",
371 "connectorName",
372 "object",
373 "catalog_id",
374 "catalogId",
375 "attributes",
376 "node",
377 "is_test",
378 "isTest",
379 ];
380
381 #[allow(clippy::enum_variant_names)]
382 enum GeneratedField {
383 TrackingId,
384 EventTimeSec,
385 EventStage,
386 EventName,
387 ConnectorName,
388 Object,
389 CatalogId,
390 Attributes,
391 Node,
392 IsTest,
393 }
394 impl<'de> serde::Deserialize<'de> for GeneratedField {
395 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
396 where
397 D: serde::Deserializer<'de>,
398 {
399 struct GeneratedVisitor;
400
401 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
402 type Value = GeneratedField;
403
404 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
405 write!(formatter, "expected one of: {:?}", &FIELDS)
406 }
407
408 #[allow(unused_variables)]
409 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
410 where
411 E: serde::de::Error,
412 {
413 match value {
414 "trackingId" | "tracking_id" => Ok(GeneratedField::TrackingId),
415 "eventTimeSec" | "event_time_sec" => Ok(GeneratedField::EventTimeSec),
416 "eventStage" | "event_stage" => Ok(GeneratedField::EventStage),
417 "eventName" | "event_name" => Ok(GeneratedField::EventName),
418 "connectorName" | "connector_name" => Ok(GeneratedField::ConnectorName),
419 "object" => Ok(GeneratedField::Object),
420 "catalogId" | "catalog_id" => Ok(GeneratedField::CatalogId),
421 "attributes" => Ok(GeneratedField::Attributes),
422 "node" => Ok(GeneratedField::Node),
423 "isTest" | "is_test" => Ok(GeneratedField::IsTest),
424 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
425 }
426 }
427 }
428 deserializer.deserialize_identifier(GeneratedVisitor)
429 }
430 }
431 struct GeneratedVisitor;
432 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
433 type Value = EventMessage;
434
435 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
436 formatter.write_str("struct telemetry.EventMessage")
437 }
438
439 fn visit_map<V>(self, mut map_: V) -> std::result::Result<EventMessage, V::Error>
440 where
441 V: serde::de::MapAccess<'de>,
442 {
443 let mut tracking_id__ = None;
444 let mut event_time_sec__ = None;
445 let mut event_stage__ = None;
446 let mut event_name__ = None;
447 let mut connector_name__ = None;
448 let mut object__ = None;
449 let mut catalog_id__ = None;
450 let mut attributes__ = None;
451 let mut node__ = None;
452 let mut is_test__ = None;
453 while let Some(k) = map_.next_key()? {
454 match k {
455 GeneratedField::TrackingId => {
456 if tracking_id__.is_some() {
457 return Err(serde::de::Error::duplicate_field("trackingId"));
458 }
459 tracking_id__ = Some(map_.next_value()?);
460 }
461 GeneratedField::EventTimeSec => {
462 if event_time_sec__.is_some() {
463 return Err(serde::de::Error::duplicate_field("eventTimeSec"));
464 }
465 event_time_sec__ =
466 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
467 ;
468 }
469 GeneratedField::EventStage => {
470 if event_stage__.is_some() {
471 return Err(serde::de::Error::duplicate_field("eventStage"));
472 }
473 event_stage__ = Some(map_.next_value::<TelemetryEventStage>()? as i32);
474 }
475 GeneratedField::EventName => {
476 if event_name__.is_some() {
477 return Err(serde::de::Error::duplicate_field("eventName"));
478 }
479 event_name__ = Some(map_.next_value()?);
480 }
481 GeneratedField::ConnectorName => {
482 if connector_name__.is_some() {
483 return Err(serde::de::Error::duplicate_field("connectorName"));
484 }
485 connector_name__ = map_.next_value()?;
486 }
487 GeneratedField::Object => {
488 if object__.is_some() {
489 return Err(serde::de::Error::duplicate_field("object"));
490 }
491 object__ = map_.next_value::<::std::option::Option<TelemetryDatabaseObject>>()?.map(|x| x as i32);
492 }
493 GeneratedField::CatalogId => {
494 if catalog_id__.is_some() {
495 return Err(serde::de::Error::duplicate_field("catalogId"));
496 }
497 catalog_id__ =
498 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
499 ;
500 }
501 GeneratedField::Attributes => {
502 if attributes__.is_some() {
503 return Err(serde::de::Error::duplicate_field("attributes"));
504 }
505 attributes__ = map_.next_value()?;
506 }
507 GeneratedField::Node => {
508 if node__.is_some() {
509 return Err(serde::de::Error::duplicate_field("node"));
510 }
511 node__ = Some(map_.next_value()?);
512 }
513 GeneratedField::IsTest => {
514 if is_test__.is_some() {
515 return Err(serde::de::Error::duplicate_field("isTest"));
516 }
517 is_test__ = Some(map_.next_value()?);
518 }
519 }
520 }
521 Ok(EventMessage {
522 tracking_id: tracking_id__.unwrap_or_default(),
523 event_time_sec: event_time_sec__.unwrap_or_default(),
524 event_stage: event_stage__.unwrap_or_default(),
525 event_name: event_name__.unwrap_or_default(),
526 connector_name: connector_name__,
527 object: object__,
528 catalog_id: catalog_id__.unwrap_or_default(),
529 attributes: attributes__,
530 node: node__.unwrap_or_default(),
531 is_test: is_test__.unwrap_or_default(),
532 })
533 }
534 }
535 deserializer.deserialize_struct("telemetry.EventMessage", FIELDS, GeneratedVisitor)
536 }
537}
538impl serde::Serialize for FrontendReport {
539 #[allow(deprecated)]
540 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
541 where
542 S: serde::Serializer,
543 {
544 use serde::ser::SerializeStruct;
545 let mut len = 0;
546 if self.base.is_some() {
547 len += 1;
548 }
549 let mut struct_ser = serializer.serialize_struct("telemetry.FrontendReport", len)?;
550 if let Some(v) = self.base.as_ref() {
551 struct_ser.serialize_field("base", v)?;
552 }
553 struct_ser.end()
554 }
555}
556impl<'de> serde::Deserialize<'de> for FrontendReport {
557 #[allow(deprecated)]
558 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
559 where
560 D: serde::Deserializer<'de>,
561 {
562 const FIELDS: &[&str] = &[
563 "base",
564 ];
565
566 #[allow(clippy::enum_variant_names)]
567 enum GeneratedField {
568 Base,
569 }
570 impl<'de> serde::Deserialize<'de> for GeneratedField {
571 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
572 where
573 D: serde::Deserializer<'de>,
574 {
575 struct GeneratedVisitor;
576
577 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
578 type Value = GeneratedField;
579
580 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
581 write!(formatter, "expected one of: {:?}", &FIELDS)
582 }
583
584 #[allow(unused_variables)]
585 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
586 where
587 E: serde::de::Error,
588 {
589 match value {
590 "base" => Ok(GeneratedField::Base),
591 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
592 }
593 }
594 }
595 deserializer.deserialize_identifier(GeneratedVisitor)
596 }
597 }
598 struct GeneratedVisitor;
599 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
600 type Value = FrontendReport;
601
602 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
603 formatter.write_str("struct telemetry.FrontendReport")
604 }
605
606 fn visit_map<V>(self, mut map_: V) -> std::result::Result<FrontendReport, V::Error>
607 where
608 V: serde::de::MapAccess<'de>,
609 {
610 let mut base__ = None;
611 while let Some(k) = map_.next_key()? {
612 match k {
613 GeneratedField::Base => {
614 if base__.is_some() {
615 return Err(serde::de::Error::duplicate_field("base"));
616 }
617 base__ = map_.next_value()?;
618 }
619 }
620 }
621 Ok(FrontendReport {
622 base: base__,
623 })
624 }
625 }
626 deserializer.deserialize_struct("telemetry.FrontendReport", FIELDS, GeneratedVisitor)
627 }
628}
629impl serde::Serialize for MetaBackend {
630 #[allow(deprecated)]
631 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
632 where
633 S: serde::Serializer,
634 {
635 let variant = match self {
636 Self::Unspecified => "META_BACKEND_UNSPECIFIED",
637 Self::Memory => "META_BACKEND_MEMORY",
638 Self::Etcd => "META_BACKEND_ETCD",
639 Self::Rdb => "META_BACKEND_RDB",
640 };
641 serializer.serialize_str(variant)
642 }
643}
644impl<'de> serde::Deserialize<'de> for MetaBackend {
645 #[allow(deprecated)]
646 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
647 where
648 D: serde::Deserializer<'de>,
649 {
650 const FIELDS: &[&str] = &[
651 "META_BACKEND_UNSPECIFIED",
652 "META_BACKEND_MEMORY",
653 "META_BACKEND_ETCD",
654 "META_BACKEND_RDB",
655 ];
656
657 struct GeneratedVisitor;
658
659 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
660 type Value = MetaBackend;
661
662 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
663 write!(formatter, "expected one of: {:?}", &FIELDS)
664 }
665
666 fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
667 where
668 E: serde::de::Error,
669 {
670 i32::try_from(v)
671 .ok()
672 .and_then(|x| x.try_into().ok())
673 .ok_or_else(|| {
674 serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
675 })
676 }
677
678 fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
679 where
680 E: serde::de::Error,
681 {
682 i32::try_from(v)
683 .ok()
684 .and_then(|x| x.try_into().ok())
685 .ok_or_else(|| {
686 serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
687 })
688 }
689
690 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
691 where
692 E: serde::de::Error,
693 {
694 match value {
695 "META_BACKEND_UNSPECIFIED" => Ok(MetaBackend::Unspecified),
696 "META_BACKEND_MEMORY" => Ok(MetaBackend::Memory),
697 "META_BACKEND_ETCD" => Ok(MetaBackend::Etcd),
698 "META_BACKEND_RDB" => Ok(MetaBackend::Rdb),
699 _ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
700 }
701 }
702 }
703 deserializer.deserialize_any(GeneratedVisitor)
704 }
705}
706impl serde::Serialize for MetaReport {
707 #[allow(deprecated)]
708 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
709 where
710 S: serde::Serializer,
711 {
712 use serde::ser::SerializeStruct;
713 let mut len = 0;
714 if self.base.is_some() {
715 len += 1;
716 }
717 if self.meta_backend != 0 {
718 len += 1;
719 }
720 if self.node_count.is_some() {
721 len += 1;
722 }
723 if self.rw_version.is_some() {
724 len += 1;
725 }
726 if self.stream_job_count != 0 {
727 len += 1;
728 }
729 if !self.stream_jobs.is_empty() {
730 len += 1;
731 }
732 if self.cluster_type != 0 {
733 len += 1;
734 }
735 if !self.object_store_media_type.is_empty() {
736 len += 1;
737 }
738 if !self.connector_usage_json_str.is_empty() {
739 len += 1;
740 }
741 let mut struct_ser = serializer.serialize_struct("telemetry.MetaReport", len)?;
742 if let Some(v) = self.base.as_ref() {
743 struct_ser.serialize_field("base", v)?;
744 }
745 if self.meta_backend != 0 {
746 let v = MetaBackend::try_from(self.meta_backend)
747 .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.meta_backend)))?;
748 struct_ser.serialize_field("metaBackend", &v)?;
749 }
750 if let Some(v) = self.node_count.as_ref() {
751 struct_ser.serialize_field("nodeCount", v)?;
752 }
753 if let Some(v) = self.rw_version.as_ref() {
754 struct_ser.serialize_field("rwVersion", v)?;
755 }
756 if self.stream_job_count != 0 {
757 struct_ser.serialize_field("streamJobCount", &self.stream_job_count)?;
758 }
759 if !self.stream_jobs.is_empty() {
760 struct_ser.serialize_field("streamJobs", &self.stream_jobs)?;
761 }
762 if self.cluster_type != 0 {
763 let v = TelemetryClusterType::try_from(self.cluster_type)
764 .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.cluster_type)))?;
765 struct_ser.serialize_field("clusterType", &v)?;
766 }
767 if !self.object_store_media_type.is_empty() {
768 struct_ser.serialize_field("objectStoreMediaType", &self.object_store_media_type)?;
769 }
770 if !self.connector_usage_json_str.is_empty() {
771 struct_ser.serialize_field("connectorUsageJsonStr", &self.connector_usage_json_str)?;
772 }
773 struct_ser.end()
774 }
775}
776impl<'de> serde::Deserialize<'de> for MetaReport {
777 #[allow(deprecated)]
778 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
779 where
780 D: serde::Deserializer<'de>,
781 {
782 const FIELDS: &[&str] = &[
783 "base",
784 "meta_backend",
785 "metaBackend",
786 "node_count",
787 "nodeCount",
788 "rw_version",
789 "rwVersion",
790 "stream_job_count",
791 "streamJobCount",
792 "stream_jobs",
793 "streamJobs",
794 "cluster_type",
795 "clusterType",
796 "object_store_media_type",
797 "objectStoreMediaType",
798 "connector_usage_json_str",
799 "connectorUsageJsonStr",
800 ];
801
802 #[allow(clippy::enum_variant_names)]
803 enum GeneratedField {
804 Base,
805 MetaBackend,
806 NodeCount,
807 RwVersion,
808 StreamJobCount,
809 StreamJobs,
810 ClusterType,
811 ObjectStoreMediaType,
812 ConnectorUsageJsonStr,
813 }
814 impl<'de> serde::Deserialize<'de> for GeneratedField {
815 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
816 where
817 D: serde::Deserializer<'de>,
818 {
819 struct GeneratedVisitor;
820
821 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
822 type Value = GeneratedField;
823
824 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
825 write!(formatter, "expected one of: {:?}", &FIELDS)
826 }
827
828 #[allow(unused_variables)]
829 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
830 where
831 E: serde::de::Error,
832 {
833 match value {
834 "base" => Ok(GeneratedField::Base),
835 "metaBackend" | "meta_backend" => Ok(GeneratedField::MetaBackend),
836 "nodeCount" | "node_count" => Ok(GeneratedField::NodeCount),
837 "rwVersion" | "rw_version" => Ok(GeneratedField::RwVersion),
838 "streamJobCount" | "stream_job_count" => Ok(GeneratedField::StreamJobCount),
839 "streamJobs" | "stream_jobs" => Ok(GeneratedField::StreamJobs),
840 "clusterType" | "cluster_type" => Ok(GeneratedField::ClusterType),
841 "objectStoreMediaType" | "object_store_media_type" => Ok(GeneratedField::ObjectStoreMediaType),
842 "connectorUsageJsonStr" | "connector_usage_json_str" => Ok(GeneratedField::ConnectorUsageJsonStr),
843 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
844 }
845 }
846 }
847 deserializer.deserialize_identifier(GeneratedVisitor)
848 }
849 }
850 struct GeneratedVisitor;
851 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
852 type Value = MetaReport;
853
854 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
855 formatter.write_str("struct telemetry.MetaReport")
856 }
857
858 fn visit_map<V>(self, mut map_: V) -> std::result::Result<MetaReport, V::Error>
859 where
860 V: serde::de::MapAccess<'de>,
861 {
862 let mut base__ = None;
863 let mut meta_backend__ = None;
864 let mut node_count__ = None;
865 let mut rw_version__ = None;
866 let mut stream_job_count__ = None;
867 let mut stream_jobs__ = None;
868 let mut cluster_type__ = None;
869 let mut object_store_media_type__ = None;
870 let mut connector_usage_json_str__ = None;
871 while let Some(k) = map_.next_key()? {
872 match k {
873 GeneratedField::Base => {
874 if base__.is_some() {
875 return Err(serde::de::Error::duplicate_field("base"));
876 }
877 base__ = map_.next_value()?;
878 }
879 GeneratedField::MetaBackend => {
880 if meta_backend__.is_some() {
881 return Err(serde::de::Error::duplicate_field("metaBackend"));
882 }
883 meta_backend__ = Some(map_.next_value::<MetaBackend>()? as i32);
884 }
885 GeneratedField::NodeCount => {
886 if node_count__.is_some() {
887 return Err(serde::de::Error::duplicate_field("nodeCount"));
888 }
889 node_count__ = map_.next_value()?;
890 }
891 GeneratedField::RwVersion => {
892 if rw_version__.is_some() {
893 return Err(serde::de::Error::duplicate_field("rwVersion"));
894 }
895 rw_version__ = map_.next_value()?;
896 }
897 GeneratedField::StreamJobCount => {
898 if stream_job_count__.is_some() {
899 return Err(serde::de::Error::duplicate_field("streamJobCount"));
900 }
901 stream_job_count__ =
902 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
903 ;
904 }
905 GeneratedField::StreamJobs => {
906 if stream_jobs__.is_some() {
907 return Err(serde::de::Error::duplicate_field("streamJobs"));
908 }
909 stream_jobs__ = Some(map_.next_value()?);
910 }
911 GeneratedField::ClusterType => {
912 if cluster_type__.is_some() {
913 return Err(serde::de::Error::duplicate_field("clusterType"));
914 }
915 cluster_type__ = Some(map_.next_value::<TelemetryClusterType>()? as i32);
916 }
917 GeneratedField::ObjectStoreMediaType => {
918 if object_store_media_type__.is_some() {
919 return Err(serde::de::Error::duplicate_field("objectStoreMediaType"));
920 }
921 object_store_media_type__ = Some(map_.next_value()?);
922 }
923 GeneratedField::ConnectorUsageJsonStr => {
924 if connector_usage_json_str__.is_some() {
925 return Err(serde::de::Error::duplicate_field("connectorUsageJsonStr"));
926 }
927 connector_usage_json_str__ = Some(map_.next_value()?);
928 }
929 }
930 }
931 Ok(MetaReport {
932 base: base__,
933 meta_backend: meta_backend__.unwrap_or_default(),
934 node_count: node_count__,
935 rw_version: rw_version__,
936 stream_job_count: stream_job_count__.unwrap_or_default(),
937 stream_jobs: stream_jobs__.unwrap_or_default(),
938 cluster_type: cluster_type__.unwrap_or_default(),
939 object_store_media_type: object_store_media_type__.unwrap_or_default(),
940 connector_usage_json_str: connector_usage_json_str__.unwrap_or_default(),
941 })
942 }
943 }
944 deserializer.deserialize_struct("telemetry.MetaReport", FIELDS, GeneratedVisitor)
945 }
946}
947impl serde::Serialize for NodeCount {
948 #[allow(deprecated)]
949 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
950 where
951 S: serde::Serializer,
952 {
953 use serde::ser::SerializeStruct;
954 let mut len = 0;
955 if self.meta != 0 {
956 len += 1;
957 }
958 if self.compute != 0 {
959 len += 1;
960 }
961 if self.frontend != 0 {
962 len += 1;
963 }
964 if self.compactor != 0 {
965 len += 1;
966 }
967 let mut struct_ser = serializer.serialize_struct("telemetry.NodeCount", len)?;
968 if self.meta != 0 {
969 struct_ser.serialize_field("meta", &self.meta)?;
970 }
971 if self.compute != 0 {
972 struct_ser.serialize_field("compute", &self.compute)?;
973 }
974 if self.frontend != 0 {
975 struct_ser.serialize_field("frontend", &self.frontend)?;
976 }
977 if self.compactor != 0 {
978 struct_ser.serialize_field("compactor", &self.compactor)?;
979 }
980 struct_ser.end()
981 }
982}
983impl<'de> serde::Deserialize<'de> for NodeCount {
984 #[allow(deprecated)]
985 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
986 where
987 D: serde::Deserializer<'de>,
988 {
989 const FIELDS: &[&str] = &[
990 "meta",
991 "compute",
992 "frontend",
993 "compactor",
994 ];
995
996 #[allow(clippy::enum_variant_names)]
997 enum GeneratedField {
998 Meta,
999 Compute,
1000 Frontend,
1001 Compactor,
1002 }
1003 impl<'de> serde::Deserialize<'de> for GeneratedField {
1004 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1005 where
1006 D: serde::Deserializer<'de>,
1007 {
1008 struct GeneratedVisitor;
1009
1010 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1011 type Value = GeneratedField;
1012
1013 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1014 write!(formatter, "expected one of: {:?}", &FIELDS)
1015 }
1016
1017 #[allow(unused_variables)]
1018 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1019 where
1020 E: serde::de::Error,
1021 {
1022 match value {
1023 "meta" => Ok(GeneratedField::Meta),
1024 "compute" => Ok(GeneratedField::Compute),
1025 "frontend" => Ok(GeneratedField::Frontend),
1026 "compactor" => Ok(GeneratedField::Compactor),
1027 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1028 }
1029 }
1030 }
1031 deserializer.deserialize_identifier(GeneratedVisitor)
1032 }
1033 }
1034 struct GeneratedVisitor;
1035 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1036 type Value = NodeCount;
1037
1038 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1039 formatter.write_str("struct telemetry.NodeCount")
1040 }
1041
1042 fn visit_map<V>(self, mut map_: V) -> std::result::Result<NodeCount, V::Error>
1043 where
1044 V: serde::de::MapAccess<'de>,
1045 {
1046 let mut meta__ = None;
1047 let mut compute__ = None;
1048 let mut frontend__ = None;
1049 let mut compactor__ = None;
1050 while let Some(k) = map_.next_key()? {
1051 match k {
1052 GeneratedField::Meta => {
1053 if meta__.is_some() {
1054 return Err(serde::de::Error::duplicate_field("meta"));
1055 }
1056 meta__ =
1057 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
1058 ;
1059 }
1060 GeneratedField::Compute => {
1061 if compute__.is_some() {
1062 return Err(serde::de::Error::duplicate_field("compute"));
1063 }
1064 compute__ =
1065 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
1066 ;
1067 }
1068 GeneratedField::Frontend => {
1069 if frontend__.is_some() {
1070 return Err(serde::de::Error::duplicate_field("frontend"));
1071 }
1072 frontend__ =
1073 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
1074 ;
1075 }
1076 GeneratedField::Compactor => {
1077 if compactor__.is_some() {
1078 return Err(serde::de::Error::duplicate_field("compactor"));
1079 }
1080 compactor__ =
1081 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
1082 ;
1083 }
1084 }
1085 }
1086 Ok(NodeCount {
1087 meta: meta__.unwrap_or_default(),
1088 compute: compute__.unwrap_or_default(),
1089 frontend: frontend__.unwrap_or_default(),
1090 compactor: compactor__.unwrap_or_default(),
1091 })
1092 }
1093 }
1094 deserializer.deserialize_struct("telemetry.NodeCount", FIELDS, GeneratedVisitor)
1095 }
1096}
1097impl serde::Serialize for PlanOptimization {
1098 #[allow(deprecated)]
1099 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1100 where
1101 S: serde::Serializer,
1102 {
1103 let variant = match self {
1104 Self::TableOptimizationUnspecified => "TABLE_OPTIMIZATION_UNSPECIFIED",
1105 };
1106 serializer.serialize_str(variant)
1107 }
1108}
1109impl<'de> serde::Deserialize<'de> for PlanOptimization {
1110 #[allow(deprecated)]
1111 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1112 where
1113 D: serde::Deserializer<'de>,
1114 {
1115 const FIELDS: &[&str] = &[
1116 "TABLE_OPTIMIZATION_UNSPECIFIED",
1117 ];
1118
1119 struct GeneratedVisitor;
1120
1121 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1122 type Value = PlanOptimization;
1123
1124 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1125 write!(formatter, "expected one of: {:?}", &FIELDS)
1126 }
1127
1128 fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
1129 where
1130 E: serde::de::Error,
1131 {
1132 i32::try_from(v)
1133 .ok()
1134 .and_then(|x| x.try_into().ok())
1135 .ok_or_else(|| {
1136 serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
1137 })
1138 }
1139
1140 fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
1141 where
1142 E: serde::de::Error,
1143 {
1144 i32::try_from(v)
1145 .ok()
1146 .and_then(|x| x.try_into().ok())
1147 .ok_or_else(|| {
1148 serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
1149 })
1150 }
1151
1152 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1153 where
1154 E: serde::de::Error,
1155 {
1156 match value {
1157 "TABLE_OPTIMIZATION_UNSPECIFIED" => Ok(PlanOptimization::TableOptimizationUnspecified),
1158 _ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
1159 }
1160 }
1161 }
1162 deserializer.deserialize_any(GeneratedVisitor)
1163 }
1164}
1165impl serde::Serialize for ReportBase {
1166 #[allow(deprecated)]
1167 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1168 where
1169 S: serde::Serializer,
1170 {
1171 use serde::ser::SerializeStruct;
1172 let mut len = 0;
1173 if !self.tracking_id.is_empty() {
1174 len += 1;
1175 }
1176 if !self.session_id.is_empty() {
1177 len += 1;
1178 }
1179 if self.system_data.is_some() {
1180 len += 1;
1181 }
1182 if self.up_time != 0 {
1183 len += 1;
1184 }
1185 if self.report_time != 0 {
1186 len += 1;
1187 }
1188 if self.node_type != 0 {
1189 len += 1;
1190 }
1191 if self.is_test {
1192 len += 1;
1193 }
1194 let mut struct_ser = serializer.serialize_struct("telemetry.ReportBase", len)?;
1195 if !self.tracking_id.is_empty() {
1196 struct_ser.serialize_field("trackingId", &self.tracking_id)?;
1197 }
1198 if !self.session_id.is_empty() {
1199 struct_ser.serialize_field("sessionId", &self.session_id)?;
1200 }
1201 if let Some(v) = self.system_data.as_ref() {
1202 struct_ser.serialize_field("systemData", v)?;
1203 }
1204 if self.up_time != 0 {
1205 #[allow(clippy::needless_borrow)]
1206 #[allow(clippy::needless_borrows_for_generic_args)]
1207 struct_ser.serialize_field("upTime", ToString::to_string(&self.up_time).as_str())?;
1208 }
1209 if self.report_time != 0 {
1210 #[allow(clippy::needless_borrow)]
1211 #[allow(clippy::needless_borrows_for_generic_args)]
1212 struct_ser.serialize_field("reportTime", ToString::to_string(&self.report_time).as_str())?;
1213 }
1214 if self.node_type != 0 {
1215 let v = TelemetryNodeType::try_from(self.node_type)
1216 .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.node_type)))?;
1217 struct_ser.serialize_field("nodeType", &v)?;
1218 }
1219 if self.is_test {
1220 struct_ser.serialize_field("isTest", &self.is_test)?;
1221 }
1222 struct_ser.end()
1223 }
1224}
1225impl<'de> serde::Deserialize<'de> for ReportBase {
1226 #[allow(deprecated)]
1227 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1228 where
1229 D: serde::Deserializer<'de>,
1230 {
1231 const FIELDS: &[&str] = &[
1232 "tracking_id",
1233 "trackingId",
1234 "session_id",
1235 "sessionId",
1236 "system_data",
1237 "systemData",
1238 "up_time",
1239 "upTime",
1240 "report_time",
1241 "reportTime",
1242 "node_type",
1243 "nodeType",
1244 "is_test",
1245 "isTest",
1246 ];
1247
1248 #[allow(clippy::enum_variant_names)]
1249 enum GeneratedField {
1250 TrackingId,
1251 SessionId,
1252 SystemData,
1253 UpTime,
1254 ReportTime,
1255 NodeType,
1256 IsTest,
1257 }
1258 impl<'de> serde::Deserialize<'de> for GeneratedField {
1259 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1260 where
1261 D: serde::Deserializer<'de>,
1262 {
1263 struct GeneratedVisitor;
1264
1265 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1266 type Value = GeneratedField;
1267
1268 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1269 write!(formatter, "expected one of: {:?}", &FIELDS)
1270 }
1271
1272 #[allow(unused_variables)]
1273 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1274 where
1275 E: serde::de::Error,
1276 {
1277 match value {
1278 "trackingId" | "tracking_id" => Ok(GeneratedField::TrackingId),
1279 "sessionId" | "session_id" => Ok(GeneratedField::SessionId),
1280 "systemData" | "system_data" => Ok(GeneratedField::SystemData),
1281 "upTime" | "up_time" => Ok(GeneratedField::UpTime),
1282 "reportTime" | "report_time" => Ok(GeneratedField::ReportTime),
1283 "nodeType" | "node_type" => Ok(GeneratedField::NodeType),
1284 "isTest" | "is_test" => Ok(GeneratedField::IsTest),
1285 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1286 }
1287 }
1288 }
1289 deserializer.deserialize_identifier(GeneratedVisitor)
1290 }
1291 }
1292 struct GeneratedVisitor;
1293 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1294 type Value = ReportBase;
1295
1296 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1297 formatter.write_str("struct telemetry.ReportBase")
1298 }
1299
1300 fn visit_map<V>(self, mut map_: V) -> std::result::Result<ReportBase, V::Error>
1301 where
1302 V: serde::de::MapAccess<'de>,
1303 {
1304 let mut tracking_id__ = None;
1305 let mut session_id__ = None;
1306 let mut system_data__ = None;
1307 let mut up_time__ = None;
1308 let mut report_time__ = None;
1309 let mut node_type__ = None;
1310 let mut is_test__ = None;
1311 while let Some(k) = map_.next_key()? {
1312 match k {
1313 GeneratedField::TrackingId => {
1314 if tracking_id__.is_some() {
1315 return Err(serde::de::Error::duplicate_field("trackingId"));
1316 }
1317 tracking_id__ = Some(map_.next_value()?);
1318 }
1319 GeneratedField::SessionId => {
1320 if session_id__.is_some() {
1321 return Err(serde::de::Error::duplicate_field("sessionId"));
1322 }
1323 session_id__ = Some(map_.next_value()?);
1324 }
1325 GeneratedField::SystemData => {
1326 if system_data__.is_some() {
1327 return Err(serde::de::Error::duplicate_field("systemData"));
1328 }
1329 system_data__ = map_.next_value()?;
1330 }
1331 GeneratedField::UpTime => {
1332 if up_time__.is_some() {
1333 return Err(serde::de::Error::duplicate_field("upTime"));
1334 }
1335 up_time__ =
1336 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
1337 ;
1338 }
1339 GeneratedField::ReportTime => {
1340 if report_time__.is_some() {
1341 return Err(serde::de::Error::duplicate_field("reportTime"));
1342 }
1343 report_time__ =
1344 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
1345 ;
1346 }
1347 GeneratedField::NodeType => {
1348 if node_type__.is_some() {
1349 return Err(serde::de::Error::duplicate_field("nodeType"));
1350 }
1351 node_type__ = Some(map_.next_value::<TelemetryNodeType>()? as i32);
1352 }
1353 GeneratedField::IsTest => {
1354 if is_test__.is_some() {
1355 return Err(serde::de::Error::duplicate_field("isTest"));
1356 }
1357 is_test__ = Some(map_.next_value()?);
1358 }
1359 }
1360 }
1361 Ok(ReportBase {
1362 tracking_id: tracking_id__.unwrap_or_default(),
1363 session_id: session_id__.unwrap_or_default(),
1364 system_data: system_data__,
1365 up_time: up_time__.unwrap_or_default(),
1366 report_time: report_time__.unwrap_or_default(),
1367 node_type: node_type__.unwrap_or_default(),
1368 is_test: is_test__.unwrap_or_default(),
1369 })
1370 }
1371 }
1372 deserializer.deserialize_struct("telemetry.ReportBase", FIELDS, GeneratedVisitor)
1373 }
1374}
1375impl serde::Serialize for RwVersion {
1376 #[allow(deprecated)]
1377 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1378 where
1379 S: serde::Serializer,
1380 {
1381 use serde::ser::SerializeStruct;
1382 let mut len = 0;
1383 if !self.rw_version.is_empty() {
1384 len += 1;
1385 }
1386 if !self.git_sha.is_empty() {
1387 len += 1;
1388 }
1389 let mut struct_ser = serializer.serialize_struct("telemetry.RwVersion", len)?;
1390 if !self.rw_version.is_empty() {
1391 struct_ser.serialize_field("rwVersion", &self.rw_version)?;
1392 }
1393 if !self.git_sha.is_empty() {
1394 struct_ser.serialize_field("gitSha", &self.git_sha)?;
1395 }
1396 struct_ser.end()
1397 }
1398}
1399impl<'de> serde::Deserialize<'de> for RwVersion {
1400 #[allow(deprecated)]
1401 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1402 where
1403 D: serde::Deserializer<'de>,
1404 {
1405 const FIELDS: &[&str] = &[
1406 "rw_version",
1407 "rwVersion",
1408 "git_sha",
1409 "gitSha",
1410 ];
1411
1412 #[allow(clippy::enum_variant_names)]
1413 enum GeneratedField {
1414 RwVersion,
1415 GitSha,
1416 }
1417 impl<'de> serde::Deserialize<'de> for GeneratedField {
1418 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1419 where
1420 D: serde::Deserializer<'de>,
1421 {
1422 struct GeneratedVisitor;
1423
1424 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1425 type Value = GeneratedField;
1426
1427 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1428 write!(formatter, "expected one of: {:?}", &FIELDS)
1429 }
1430
1431 #[allow(unused_variables)]
1432 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1433 where
1434 E: serde::de::Error,
1435 {
1436 match value {
1437 "rwVersion" | "rw_version" => Ok(GeneratedField::RwVersion),
1438 "gitSha" | "git_sha" => Ok(GeneratedField::GitSha),
1439 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1440 }
1441 }
1442 }
1443 deserializer.deserialize_identifier(GeneratedVisitor)
1444 }
1445 }
1446 struct GeneratedVisitor;
1447 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1448 type Value = RwVersion;
1449
1450 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1451 formatter.write_str("struct telemetry.RwVersion")
1452 }
1453
1454 fn visit_map<V>(self, mut map_: V) -> std::result::Result<RwVersion, V::Error>
1455 where
1456 V: serde::de::MapAccess<'de>,
1457 {
1458 let mut rw_version__ = None;
1459 let mut git_sha__ = None;
1460 while let Some(k) = map_.next_key()? {
1461 match k {
1462 GeneratedField::RwVersion => {
1463 if rw_version__.is_some() {
1464 return Err(serde::de::Error::duplicate_field("rwVersion"));
1465 }
1466 rw_version__ = Some(map_.next_value()?);
1467 }
1468 GeneratedField::GitSha => {
1469 if git_sha__.is_some() {
1470 return Err(serde::de::Error::duplicate_field("gitSha"));
1471 }
1472 git_sha__ = Some(map_.next_value()?);
1473 }
1474 }
1475 }
1476 Ok(RwVersion {
1477 rw_version: rw_version__.unwrap_or_default(),
1478 git_sha: git_sha__.unwrap_or_default(),
1479 })
1480 }
1481 }
1482 deserializer.deserialize_struct("telemetry.RwVersion", FIELDS, GeneratedVisitor)
1483 }
1484}
1485impl serde::Serialize for StreamJobDesc {
1486 #[allow(deprecated)]
1487 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1488 where
1489 S: serde::Serializer,
1490 {
1491 use serde::ser::SerializeStruct;
1492 let mut len = 0;
1493 if self.table_id != 0 {
1494 len += 1;
1495 }
1496 if self.connector_name.is_some() {
1497 len += 1;
1498 }
1499 if !self.plan_optimizations.is_empty() {
1500 len += 1;
1501 }
1502 let mut struct_ser = serializer.serialize_struct("telemetry.StreamJobDesc", len)?;
1503 if self.table_id != 0 {
1504 struct_ser.serialize_field("tableId", &self.table_id)?;
1505 }
1506 if let Some(v) = self.connector_name.as_ref() {
1507 struct_ser.serialize_field("connectorName", v)?;
1508 }
1509 if !self.plan_optimizations.is_empty() {
1510 let v = self.plan_optimizations.iter().cloned().map(|v| {
1511 PlanOptimization::try_from(v)
1512 .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", v)))
1513 }).collect::<std::result::Result<Vec<_>, _>>()?;
1514 struct_ser.serialize_field("planOptimizations", &v)?;
1515 }
1516 struct_ser.end()
1517 }
1518}
1519impl<'de> serde::Deserialize<'de> for StreamJobDesc {
1520 #[allow(deprecated)]
1521 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1522 where
1523 D: serde::Deserializer<'de>,
1524 {
1525 const FIELDS: &[&str] = &[
1526 "table_id",
1527 "tableId",
1528 "connector_name",
1529 "connectorName",
1530 "plan_optimizations",
1531 "planOptimizations",
1532 ];
1533
1534 #[allow(clippy::enum_variant_names)]
1535 enum GeneratedField {
1536 TableId,
1537 ConnectorName,
1538 PlanOptimizations,
1539 }
1540 impl<'de> serde::Deserialize<'de> for GeneratedField {
1541 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1542 where
1543 D: serde::Deserializer<'de>,
1544 {
1545 struct GeneratedVisitor;
1546
1547 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1548 type Value = GeneratedField;
1549
1550 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1551 write!(formatter, "expected one of: {:?}", &FIELDS)
1552 }
1553
1554 #[allow(unused_variables)]
1555 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1556 where
1557 E: serde::de::Error,
1558 {
1559 match value {
1560 "tableId" | "table_id" => Ok(GeneratedField::TableId),
1561 "connectorName" | "connector_name" => Ok(GeneratedField::ConnectorName),
1562 "planOptimizations" | "plan_optimizations" => Ok(GeneratedField::PlanOptimizations),
1563 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1564 }
1565 }
1566 }
1567 deserializer.deserialize_identifier(GeneratedVisitor)
1568 }
1569 }
1570 struct GeneratedVisitor;
1571 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1572 type Value = StreamJobDesc;
1573
1574 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1575 formatter.write_str("struct telemetry.StreamJobDesc")
1576 }
1577
1578 fn visit_map<V>(self, mut map_: V) -> std::result::Result<StreamJobDesc, V::Error>
1579 where
1580 V: serde::de::MapAccess<'de>,
1581 {
1582 let mut table_id__ = None;
1583 let mut connector_name__ = None;
1584 let mut plan_optimizations__ = None;
1585 while let Some(k) = map_.next_key()? {
1586 match k {
1587 GeneratedField::TableId => {
1588 if table_id__.is_some() {
1589 return Err(serde::de::Error::duplicate_field("tableId"));
1590 }
1591 table_id__ =
1592 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
1593 ;
1594 }
1595 GeneratedField::ConnectorName => {
1596 if connector_name__.is_some() {
1597 return Err(serde::de::Error::duplicate_field("connectorName"));
1598 }
1599 connector_name__ = map_.next_value()?;
1600 }
1601 GeneratedField::PlanOptimizations => {
1602 if plan_optimizations__.is_some() {
1603 return Err(serde::de::Error::duplicate_field("planOptimizations"));
1604 }
1605 plan_optimizations__ = Some(map_.next_value::<Vec<PlanOptimization>>()?.into_iter().map(|x| x as i32).collect());
1606 }
1607 }
1608 }
1609 Ok(StreamJobDesc {
1610 table_id: table_id__.unwrap_or_default(),
1611 connector_name: connector_name__,
1612 plan_optimizations: plan_optimizations__.unwrap_or_default(),
1613 })
1614 }
1615 }
1616 deserializer.deserialize_struct("telemetry.StreamJobDesc", FIELDS, GeneratedVisitor)
1617 }
1618}
1619impl serde::Serialize for SystemCpu {
1620 #[allow(deprecated)]
1621 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1622 where
1623 S: serde::Serializer,
1624 {
1625 use serde::ser::SerializeStruct;
1626 let mut len = 0;
1627 if self.available != 0. {
1628 len += 1;
1629 }
1630 let mut struct_ser = serializer.serialize_struct("telemetry.SystemCpu", len)?;
1631 if self.available != 0. {
1632 struct_ser.serialize_field("available", &self.available)?;
1633 }
1634 struct_ser.end()
1635 }
1636}
1637impl<'de> serde::Deserialize<'de> for SystemCpu {
1638 #[allow(deprecated)]
1639 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1640 where
1641 D: serde::Deserializer<'de>,
1642 {
1643 const FIELDS: &[&str] = &[
1644 "available",
1645 ];
1646
1647 #[allow(clippy::enum_variant_names)]
1648 enum GeneratedField {
1649 Available,
1650 }
1651 impl<'de> serde::Deserialize<'de> for GeneratedField {
1652 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1653 where
1654 D: serde::Deserializer<'de>,
1655 {
1656 struct GeneratedVisitor;
1657
1658 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1659 type Value = GeneratedField;
1660
1661 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1662 write!(formatter, "expected one of: {:?}", &FIELDS)
1663 }
1664
1665 #[allow(unused_variables)]
1666 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1667 where
1668 E: serde::de::Error,
1669 {
1670 match value {
1671 "available" => Ok(GeneratedField::Available),
1672 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1673 }
1674 }
1675 }
1676 deserializer.deserialize_identifier(GeneratedVisitor)
1677 }
1678 }
1679 struct GeneratedVisitor;
1680 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1681 type Value = SystemCpu;
1682
1683 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1684 formatter.write_str("struct telemetry.SystemCpu")
1685 }
1686
1687 fn visit_map<V>(self, mut map_: V) -> std::result::Result<SystemCpu, V::Error>
1688 where
1689 V: serde::de::MapAccess<'de>,
1690 {
1691 let mut available__ = None;
1692 while let Some(k) = map_.next_key()? {
1693 match k {
1694 GeneratedField::Available => {
1695 if available__.is_some() {
1696 return Err(serde::de::Error::duplicate_field("available"));
1697 }
1698 available__ =
1699 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
1700 ;
1701 }
1702 }
1703 }
1704 Ok(SystemCpu {
1705 available: available__.unwrap_or_default(),
1706 })
1707 }
1708 }
1709 deserializer.deserialize_struct("telemetry.SystemCpu", FIELDS, GeneratedVisitor)
1710 }
1711}
1712impl serde::Serialize for SystemData {
1713 #[allow(deprecated)]
1714 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1715 where
1716 S: serde::Serializer,
1717 {
1718 use serde::ser::SerializeStruct;
1719 let mut len = 0;
1720 if self.memory.is_some() {
1721 len += 1;
1722 }
1723 if self.os.is_some() {
1724 len += 1;
1725 }
1726 if self.cpu.is_some() {
1727 len += 1;
1728 }
1729 let mut struct_ser = serializer.serialize_struct("telemetry.SystemData", len)?;
1730 if let Some(v) = self.memory.as_ref() {
1731 struct_ser.serialize_field("memory", v)?;
1732 }
1733 if let Some(v) = self.os.as_ref() {
1734 struct_ser.serialize_field("os", v)?;
1735 }
1736 if let Some(v) = self.cpu.as_ref() {
1737 struct_ser.serialize_field("cpu", v)?;
1738 }
1739 struct_ser.end()
1740 }
1741}
1742impl<'de> serde::Deserialize<'de> for SystemData {
1743 #[allow(deprecated)]
1744 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1745 where
1746 D: serde::Deserializer<'de>,
1747 {
1748 const FIELDS: &[&str] = &[
1749 "memory",
1750 "os",
1751 "cpu",
1752 ];
1753
1754 #[allow(clippy::enum_variant_names)]
1755 enum GeneratedField {
1756 Memory,
1757 Os,
1758 Cpu,
1759 }
1760 impl<'de> serde::Deserialize<'de> for GeneratedField {
1761 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1762 where
1763 D: serde::Deserializer<'de>,
1764 {
1765 struct GeneratedVisitor;
1766
1767 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1768 type Value = GeneratedField;
1769
1770 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1771 write!(formatter, "expected one of: {:?}", &FIELDS)
1772 }
1773
1774 #[allow(unused_variables)]
1775 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1776 where
1777 E: serde::de::Error,
1778 {
1779 match value {
1780 "memory" => Ok(GeneratedField::Memory),
1781 "os" => Ok(GeneratedField::Os),
1782 "cpu" => Ok(GeneratedField::Cpu),
1783 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1784 }
1785 }
1786 }
1787 deserializer.deserialize_identifier(GeneratedVisitor)
1788 }
1789 }
1790 struct GeneratedVisitor;
1791 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1792 type Value = SystemData;
1793
1794 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1795 formatter.write_str("struct telemetry.SystemData")
1796 }
1797
1798 fn visit_map<V>(self, mut map_: V) -> std::result::Result<SystemData, V::Error>
1799 where
1800 V: serde::de::MapAccess<'de>,
1801 {
1802 let mut memory__ = None;
1803 let mut os__ = None;
1804 let mut cpu__ = None;
1805 while let Some(k) = map_.next_key()? {
1806 match k {
1807 GeneratedField::Memory => {
1808 if memory__.is_some() {
1809 return Err(serde::de::Error::duplicate_field("memory"));
1810 }
1811 memory__ = map_.next_value()?;
1812 }
1813 GeneratedField::Os => {
1814 if os__.is_some() {
1815 return Err(serde::de::Error::duplicate_field("os"));
1816 }
1817 os__ = map_.next_value()?;
1818 }
1819 GeneratedField::Cpu => {
1820 if cpu__.is_some() {
1821 return Err(serde::de::Error::duplicate_field("cpu"));
1822 }
1823 cpu__ = map_.next_value()?;
1824 }
1825 }
1826 }
1827 Ok(SystemData {
1828 memory: memory__,
1829 os: os__,
1830 cpu: cpu__,
1831 })
1832 }
1833 }
1834 deserializer.deserialize_struct("telemetry.SystemData", FIELDS, GeneratedVisitor)
1835 }
1836}
1837impl serde::Serialize for SystemMemory {
1838 #[allow(deprecated)]
1839 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1840 where
1841 S: serde::Serializer,
1842 {
1843 use serde::ser::SerializeStruct;
1844 let mut len = 0;
1845 if self.used != 0 {
1846 len += 1;
1847 }
1848 if self.total != 0 {
1849 len += 1;
1850 }
1851 let mut struct_ser = serializer.serialize_struct("telemetry.SystemMemory", len)?;
1852 if self.used != 0 {
1853 #[allow(clippy::needless_borrow)]
1854 #[allow(clippy::needless_borrows_for_generic_args)]
1855 struct_ser.serialize_field("used", ToString::to_string(&self.used).as_str())?;
1856 }
1857 if self.total != 0 {
1858 #[allow(clippy::needless_borrow)]
1859 #[allow(clippy::needless_borrows_for_generic_args)]
1860 struct_ser.serialize_field("total", ToString::to_string(&self.total).as_str())?;
1861 }
1862 struct_ser.end()
1863 }
1864}
1865impl<'de> serde::Deserialize<'de> for SystemMemory {
1866 #[allow(deprecated)]
1867 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1868 where
1869 D: serde::Deserializer<'de>,
1870 {
1871 const FIELDS: &[&str] = &[
1872 "used",
1873 "total",
1874 ];
1875
1876 #[allow(clippy::enum_variant_names)]
1877 enum GeneratedField {
1878 Used,
1879 Total,
1880 }
1881 impl<'de> serde::Deserialize<'de> for GeneratedField {
1882 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1883 where
1884 D: serde::Deserializer<'de>,
1885 {
1886 struct GeneratedVisitor;
1887
1888 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1889 type Value = GeneratedField;
1890
1891 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1892 write!(formatter, "expected one of: {:?}", &FIELDS)
1893 }
1894
1895 #[allow(unused_variables)]
1896 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1897 where
1898 E: serde::de::Error,
1899 {
1900 match value {
1901 "used" => Ok(GeneratedField::Used),
1902 "total" => Ok(GeneratedField::Total),
1903 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1904 }
1905 }
1906 }
1907 deserializer.deserialize_identifier(GeneratedVisitor)
1908 }
1909 }
1910 struct GeneratedVisitor;
1911 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1912 type Value = SystemMemory;
1913
1914 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1915 formatter.write_str("struct telemetry.SystemMemory")
1916 }
1917
1918 fn visit_map<V>(self, mut map_: V) -> std::result::Result<SystemMemory, V::Error>
1919 where
1920 V: serde::de::MapAccess<'de>,
1921 {
1922 let mut used__ = None;
1923 let mut total__ = None;
1924 while let Some(k) = map_.next_key()? {
1925 match k {
1926 GeneratedField::Used => {
1927 if used__.is_some() {
1928 return Err(serde::de::Error::duplicate_field("used"));
1929 }
1930 used__ =
1931 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
1932 ;
1933 }
1934 GeneratedField::Total => {
1935 if total__.is_some() {
1936 return Err(serde::de::Error::duplicate_field("total"));
1937 }
1938 total__ =
1939 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
1940 ;
1941 }
1942 }
1943 }
1944 Ok(SystemMemory {
1945 used: used__.unwrap_or_default(),
1946 total: total__.unwrap_or_default(),
1947 })
1948 }
1949 }
1950 deserializer.deserialize_struct("telemetry.SystemMemory", FIELDS, GeneratedVisitor)
1951 }
1952}
1953impl serde::Serialize for SystemOs {
1954 #[allow(deprecated)]
1955 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1956 where
1957 S: serde::Serializer,
1958 {
1959 use serde::ser::SerializeStruct;
1960 let mut len = 0;
1961 if !self.name.is_empty() {
1962 len += 1;
1963 }
1964 if !self.version.is_empty() {
1965 len += 1;
1966 }
1967 if !self.kernel_version.is_empty() {
1968 len += 1;
1969 }
1970 let mut struct_ser = serializer.serialize_struct("telemetry.SystemOs", len)?;
1971 if !self.name.is_empty() {
1972 struct_ser.serialize_field("name", &self.name)?;
1973 }
1974 if !self.version.is_empty() {
1975 struct_ser.serialize_field("version", &self.version)?;
1976 }
1977 if !self.kernel_version.is_empty() {
1978 struct_ser.serialize_field("kernelVersion", &self.kernel_version)?;
1979 }
1980 struct_ser.end()
1981 }
1982}
1983impl<'de> serde::Deserialize<'de> for SystemOs {
1984 #[allow(deprecated)]
1985 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1986 where
1987 D: serde::Deserializer<'de>,
1988 {
1989 const FIELDS: &[&str] = &[
1990 "name",
1991 "version",
1992 "kernel_version",
1993 "kernelVersion",
1994 ];
1995
1996 #[allow(clippy::enum_variant_names)]
1997 enum GeneratedField {
1998 Name,
1999 Version,
2000 KernelVersion,
2001 }
2002 impl<'de> serde::Deserialize<'de> for GeneratedField {
2003 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
2004 where
2005 D: serde::Deserializer<'de>,
2006 {
2007 struct GeneratedVisitor;
2008
2009 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2010 type Value = GeneratedField;
2011
2012 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2013 write!(formatter, "expected one of: {:?}", &FIELDS)
2014 }
2015
2016 #[allow(unused_variables)]
2017 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
2018 where
2019 E: serde::de::Error,
2020 {
2021 match value {
2022 "name" => Ok(GeneratedField::Name),
2023 "version" => Ok(GeneratedField::Version),
2024 "kernelVersion" | "kernel_version" => Ok(GeneratedField::KernelVersion),
2025 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
2026 }
2027 }
2028 }
2029 deserializer.deserialize_identifier(GeneratedVisitor)
2030 }
2031 }
2032 struct GeneratedVisitor;
2033 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2034 type Value = SystemOs;
2035
2036 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2037 formatter.write_str("struct telemetry.SystemOs")
2038 }
2039
2040 fn visit_map<V>(self, mut map_: V) -> std::result::Result<SystemOs, V::Error>
2041 where
2042 V: serde::de::MapAccess<'de>,
2043 {
2044 let mut name__ = None;
2045 let mut version__ = None;
2046 let mut kernel_version__ = None;
2047 while let Some(k) = map_.next_key()? {
2048 match k {
2049 GeneratedField::Name => {
2050 if name__.is_some() {
2051 return Err(serde::de::Error::duplicate_field("name"));
2052 }
2053 name__ = Some(map_.next_value()?);
2054 }
2055 GeneratedField::Version => {
2056 if version__.is_some() {
2057 return Err(serde::de::Error::duplicate_field("version"));
2058 }
2059 version__ = Some(map_.next_value()?);
2060 }
2061 GeneratedField::KernelVersion => {
2062 if kernel_version__.is_some() {
2063 return Err(serde::de::Error::duplicate_field("kernelVersion"));
2064 }
2065 kernel_version__ = Some(map_.next_value()?);
2066 }
2067 }
2068 }
2069 Ok(SystemOs {
2070 name: name__.unwrap_or_default(),
2071 version: version__.unwrap_or_default(),
2072 kernel_version: kernel_version__.unwrap_or_default(),
2073 })
2074 }
2075 }
2076 deserializer.deserialize_struct("telemetry.SystemOs", FIELDS, GeneratedVisitor)
2077 }
2078}
2079impl serde::Serialize for TelemetryClusterType {
2080 #[allow(deprecated)]
2081 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2082 where
2083 S: serde::Serializer,
2084 {
2085 let variant = match self {
2086 Self::Unspecified => "TELEMETRY_CLUSTER_TYPE_UNSPECIFIED",
2087 Self::SingleNode => "TELEMETRY_CLUSTER_TYPE_SINGLE_NODE",
2088 Self::DockerCompose => "TELEMETRY_CLUSTER_TYPE_DOCKER_COMPOSE",
2089 Self::Kubernetes => "TELEMETRY_CLUSTER_TYPE_KUBERNETES",
2090 Self::CloudHosted => "TELEMETRY_CLUSTER_TYPE_CLOUD_HOSTED",
2091 };
2092 serializer.serialize_str(variant)
2093 }
2094}
2095impl<'de> serde::Deserialize<'de> for TelemetryClusterType {
2096 #[allow(deprecated)]
2097 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2098 where
2099 D: serde::Deserializer<'de>,
2100 {
2101 const FIELDS: &[&str] = &[
2102 "TELEMETRY_CLUSTER_TYPE_UNSPECIFIED",
2103 "TELEMETRY_CLUSTER_TYPE_SINGLE_NODE",
2104 "TELEMETRY_CLUSTER_TYPE_DOCKER_COMPOSE",
2105 "TELEMETRY_CLUSTER_TYPE_KUBERNETES",
2106 "TELEMETRY_CLUSTER_TYPE_CLOUD_HOSTED",
2107 ];
2108
2109 struct GeneratedVisitor;
2110
2111 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2112 type Value = TelemetryClusterType;
2113
2114 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2115 write!(formatter, "expected one of: {:?}", &FIELDS)
2116 }
2117
2118 fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
2119 where
2120 E: serde::de::Error,
2121 {
2122 i32::try_from(v)
2123 .ok()
2124 .and_then(|x| x.try_into().ok())
2125 .ok_or_else(|| {
2126 serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
2127 })
2128 }
2129
2130 fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
2131 where
2132 E: serde::de::Error,
2133 {
2134 i32::try_from(v)
2135 .ok()
2136 .and_then(|x| x.try_into().ok())
2137 .ok_or_else(|| {
2138 serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
2139 })
2140 }
2141
2142 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2143 where
2144 E: serde::de::Error,
2145 {
2146 match value {
2147 "TELEMETRY_CLUSTER_TYPE_UNSPECIFIED" => Ok(TelemetryClusterType::Unspecified),
2148 "TELEMETRY_CLUSTER_TYPE_SINGLE_NODE" => Ok(TelemetryClusterType::SingleNode),
2149 "TELEMETRY_CLUSTER_TYPE_DOCKER_COMPOSE" => Ok(TelemetryClusterType::DockerCompose),
2150 "TELEMETRY_CLUSTER_TYPE_KUBERNETES" => Ok(TelemetryClusterType::Kubernetes),
2151 "TELEMETRY_CLUSTER_TYPE_CLOUD_HOSTED" => Ok(TelemetryClusterType::CloudHosted),
2152 _ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
2153 }
2154 }
2155 }
2156 deserializer.deserialize_any(GeneratedVisitor)
2157 }
2158}
2159impl serde::Serialize for TelemetryDatabaseObject {
2160 #[allow(deprecated)]
2161 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2162 where
2163 S: serde::Serializer,
2164 {
2165 let variant = match self {
2166 Self::Unspecified => "TELEMETRY_DATABASE_OBJECT_UNSPECIFIED",
2167 Self::Source => "TELEMETRY_DATABASE_OBJECT_SOURCE",
2168 Self::Mv => "TELEMETRY_DATABASE_OBJECT_MV",
2169 Self::Table => "TELEMETRY_DATABASE_OBJECT_TABLE",
2170 Self::Sink => "TELEMETRY_DATABASE_OBJECT_SINK",
2171 Self::Index => "TELEMETRY_DATABASE_OBJECT_INDEX",
2172 };
2173 serializer.serialize_str(variant)
2174 }
2175}
2176impl<'de> serde::Deserialize<'de> for TelemetryDatabaseObject {
2177 #[allow(deprecated)]
2178 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2179 where
2180 D: serde::Deserializer<'de>,
2181 {
2182 const FIELDS: &[&str] = &[
2183 "TELEMETRY_DATABASE_OBJECT_UNSPECIFIED",
2184 "TELEMETRY_DATABASE_OBJECT_SOURCE",
2185 "TELEMETRY_DATABASE_OBJECT_MV",
2186 "TELEMETRY_DATABASE_OBJECT_TABLE",
2187 "TELEMETRY_DATABASE_OBJECT_SINK",
2188 "TELEMETRY_DATABASE_OBJECT_INDEX",
2189 ];
2190
2191 struct GeneratedVisitor;
2192
2193 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2194 type Value = TelemetryDatabaseObject;
2195
2196 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2197 write!(formatter, "expected one of: {:?}", &FIELDS)
2198 }
2199
2200 fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
2201 where
2202 E: serde::de::Error,
2203 {
2204 i32::try_from(v)
2205 .ok()
2206 .and_then(|x| x.try_into().ok())
2207 .ok_or_else(|| {
2208 serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
2209 })
2210 }
2211
2212 fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
2213 where
2214 E: serde::de::Error,
2215 {
2216 i32::try_from(v)
2217 .ok()
2218 .and_then(|x| x.try_into().ok())
2219 .ok_or_else(|| {
2220 serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
2221 })
2222 }
2223
2224 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2225 where
2226 E: serde::de::Error,
2227 {
2228 match value {
2229 "TELEMETRY_DATABASE_OBJECT_UNSPECIFIED" => Ok(TelemetryDatabaseObject::Unspecified),
2230 "TELEMETRY_DATABASE_OBJECT_SOURCE" => Ok(TelemetryDatabaseObject::Source),
2231 "TELEMETRY_DATABASE_OBJECT_MV" => Ok(TelemetryDatabaseObject::Mv),
2232 "TELEMETRY_DATABASE_OBJECT_TABLE" => Ok(TelemetryDatabaseObject::Table),
2233 "TELEMETRY_DATABASE_OBJECT_SINK" => Ok(TelemetryDatabaseObject::Sink),
2234 "TELEMETRY_DATABASE_OBJECT_INDEX" => Ok(TelemetryDatabaseObject::Index),
2235 _ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
2236 }
2237 }
2238 }
2239 deserializer.deserialize_any(GeneratedVisitor)
2240 }
2241}
2242impl serde::Serialize for TelemetryEventStage {
2243 #[allow(deprecated)]
2244 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2245 where
2246 S: serde::Serializer,
2247 {
2248 let variant = match self {
2249 Self::Unspecified => "TELEMETRY_EVENT_STAGE_UNSPECIFIED",
2250 Self::CreateStreamJob => "TELEMETRY_EVENT_STAGE_CREATE_STREAM_JOB",
2251 Self::UpdateStreamJob => "TELEMETRY_EVENT_STAGE_UPDATE_STREAM_JOB",
2252 Self::DropStreamJob => "TELEMETRY_EVENT_STAGE_DROP_STREAM_JOB",
2253 Self::Query => "TELEMETRY_EVENT_STAGE_QUERY",
2254 Self::Recovery => "TELEMETRY_EVENT_STAGE_RECOVERY",
2255 };
2256 serializer.serialize_str(variant)
2257 }
2258}
2259impl<'de> serde::Deserialize<'de> for TelemetryEventStage {
2260 #[allow(deprecated)]
2261 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2262 where
2263 D: serde::Deserializer<'de>,
2264 {
2265 const FIELDS: &[&str] = &[
2266 "TELEMETRY_EVENT_STAGE_UNSPECIFIED",
2267 "TELEMETRY_EVENT_STAGE_CREATE_STREAM_JOB",
2268 "TELEMETRY_EVENT_STAGE_UPDATE_STREAM_JOB",
2269 "TELEMETRY_EVENT_STAGE_DROP_STREAM_JOB",
2270 "TELEMETRY_EVENT_STAGE_QUERY",
2271 "TELEMETRY_EVENT_STAGE_RECOVERY",
2272 ];
2273
2274 struct GeneratedVisitor;
2275
2276 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2277 type Value = TelemetryEventStage;
2278
2279 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2280 write!(formatter, "expected one of: {:?}", &FIELDS)
2281 }
2282
2283 fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
2284 where
2285 E: serde::de::Error,
2286 {
2287 i32::try_from(v)
2288 .ok()
2289 .and_then(|x| x.try_into().ok())
2290 .ok_or_else(|| {
2291 serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
2292 })
2293 }
2294
2295 fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
2296 where
2297 E: serde::de::Error,
2298 {
2299 i32::try_from(v)
2300 .ok()
2301 .and_then(|x| x.try_into().ok())
2302 .ok_or_else(|| {
2303 serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
2304 })
2305 }
2306
2307 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2308 where
2309 E: serde::de::Error,
2310 {
2311 match value {
2312 "TELEMETRY_EVENT_STAGE_UNSPECIFIED" => Ok(TelemetryEventStage::Unspecified),
2313 "TELEMETRY_EVENT_STAGE_CREATE_STREAM_JOB" => Ok(TelemetryEventStage::CreateStreamJob),
2314 "TELEMETRY_EVENT_STAGE_UPDATE_STREAM_JOB" => Ok(TelemetryEventStage::UpdateStreamJob),
2315 "TELEMETRY_EVENT_STAGE_DROP_STREAM_JOB" => Ok(TelemetryEventStage::DropStreamJob),
2316 "TELEMETRY_EVENT_STAGE_QUERY" => Ok(TelemetryEventStage::Query),
2317 "TELEMETRY_EVENT_STAGE_RECOVERY" => Ok(TelemetryEventStage::Recovery),
2318 _ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
2319 }
2320 }
2321 }
2322 deserializer.deserialize_any(GeneratedVisitor)
2323 }
2324}
2325impl serde::Serialize for TelemetryNodeType {
2326 #[allow(deprecated)]
2327 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2328 where
2329 S: serde::Serializer,
2330 {
2331 let variant = match self {
2332 Self::Unspecified => "TELEMETRY_NODE_TYPE_UNSPECIFIED",
2333 Self::Meta => "TELEMETRY_NODE_TYPE_META",
2334 Self::Compute => "TELEMETRY_NODE_TYPE_COMPUTE",
2335 Self::Frontend => "TELEMETRY_NODE_TYPE_FRONTEND",
2336 Self::Compactor => "TELEMETRY_NODE_TYPE_COMPACTOR",
2337 };
2338 serializer.serialize_str(variant)
2339 }
2340}
2341impl<'de> serde::Deserialize<'de> for TelemetryNodeType {
2342 #[allow(deprecated)]
2343 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2344 where
2345 D: serde::Deserializer<'de>,
2346 {
2347 const FIELDS: &[&str] = &[
2348 "TELEMETRY_NODE_TYPE_UNSPECIFIED",
2349 "TELEMETRY_NODE_TYPE_META",
2350 "TELEMETRY_NODE_TYPE_COMPUTE",
2351 "TELEMETRY_NODE_TYPE_FRONTEND",
2352 "TELEMETRY_NODE_TYPE_COMPACTOR",
2353 ];
2354
2355 struct GeneratedVisitor;
2356
2357 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2358 type Value = TelemetryNodeType;
2359
2360 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2361 write!(formatter, "expected one of: {:?}", &FIELDS)
2362 }
2363
2364 fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
2365 where
2366 E: serde::de::Error,
2367 {
2368 i32::try_from(v)
2369 .ok()
2370 .and_then(|x| x.try_into().ok())
2371 .ok_or_else(|| {
2372 serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
2373 })
2374 }
2375
2376 fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
2377 where
2378 E: serde::de::Error,
2379 {
2380 i32::try_from(v)
2381 .ok()
2382 .and_then(|x| x.try_into().ok())
2383 .ok_or_else(|| {
2384 serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
2385 })
2386 }
2387
2388 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2389 where
2390 E: serde::de::Error,
2391 {
2392 match value {
2393 "TELEMETRY_NODE_TYPE_UNSPECIFIED" => Ok(TelemetryNodeType::Unspecified),
2394 "TELEMETRY_NODE_TYPE_META" => Ok(TelemetryNodeType::Meta),
2395 "TELEMETRY_NODE_TYPE_COMPUTE" => Ok(TelemetryNodeType::Compute),
2396 "TELEMETRY_NODE_TYPE_FRONTEND" => Ok(TelemetryNodeType::Frontend),
2397 "TELEMETRY_NODE_TYPE_COMPACTOR" => Ok(TelemetryNodeType::Compactor),
2398 _ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
2399 }
2400 }
2401 }
2402 deserializer.deserialize_any(GeneratedVisitor)
2403 }
2404}