1use crate::connector_service::*;
2impl serde::Serialize for CdcMessage {
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.payload.is_empty() {
11 len += 1;
12 }
13 if !self.partition.is_empty() {
14 len += 1;
15 }
16 if !self.offset.is_empty() {
17 len += 1;
18 }
19 if !self.full_table_name.is_empty() {
20 len += 1;
21 }
22 if self.source_ts_ms != 0 {
23 len += 1;
24 }
25 if self.msg_type != 0 {
26 len += 1;
27 }
28 if !self.key.is_empty() {
29 len += 1;
30 }
31 let mut struct_ser = serializer.serialize_struct("connector_service.CdcMessage", len)?;
32 if !self.payload.is_empty() {
33 struct_ser.serialize_field("payload", &self.payload)?;
34 }
35 if !self.partition.is_empty() {
36 struct_ser.serialize_field("partition", &self.partition)?;
37 }
38 if !self.offset.is_empty() {
39 struct_ser.serialize_field("offset", &self.offset)?;
40 }
41 if !self.full_table_name.is_empty() {
42 struct_ser.serialize_field("fullTableName", &self.full_table_name)?;
43 }
44 if self.source_ts_ms != 0 {
45 #[allow(clippy::needless_borrow)]
46 #[allow(clippy::needless_borrows_for_generic_args)]
47 struct_ser.serialize_field("sourceTsMs", ToString::to_string(&self.source_ts_ms).as_str())?;
48 }
49 if self.msg_type != 0 {
50 let v = cdc_message::CdcMessageType::try_from(self.msg_type)
51 .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.msg_type)))?;
52 struct_ser.serialize_field("msgType", &v)?;
53 }
54 if !self.key.is_empty() {
55 struct_ser.serialize_field("key", &self.key)?;
56 }
57 struct_ser.end()
58 }
59}
60impl<'de> serde::Deserialize<'de> for CdcMessage {
61 #[allow(deprecated)]
62 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
63 where
64 D: serde::Deserializer<'de>,
65 {
66 const FIELDS: &[&str] = &[
67 "payload",
68 "partition",
69 "offset",
70 "full_table_name",
71 "fullTableName",
72 "source_ts_ms",
73 "sourceTsMs",
74 "msg_type",
75 "msgType",
76 "key",
77 ];
78
79 #[allow(clippy::enum_variant_names)]
80 enum GeneratedField {
81 Payload,
82 Partition,
83 Offset,
84 FullTableName,
85 SourceTsMs,
86 MsgType,
87 Key,
88 }
89 impl<'de> serde::Deserialize<'de> for GeneratedField {
90 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
91 where
92 D: serde::Deserializer<'de>,
93 {
94 struct GeneratedVisitor;
95
96 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
97 type Value = GeneratedField;
98
99 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
100 write!(formatter, "expected one of: {:?}", &FIELDS)
101 }
102
103 #[allow(unused_variables)]
104 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
105 where
106 E: serde::de::Error,
107 {
108 match value {
109 "payload" => Ok(GeneratedField::Payload),
110 "partition" => Ok(GeneratedField::Partition),
111 "offset" => Ok(GeneratedField::Offset),
112 "fullTableName" | "full_table_name" => Ok(GeneratedField::FullTableName),
113 "sourceTsMs" | "source_ts_ms" => Ok(GeneratedField::SourceTsMs),
114 "msgType" | "msg_type" => Ok(GeneratedField::MsgType),
115 "key" => Ok(GeneratedField::Key),
116 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
117 }
118 }
119 }
120 deserializer.deserialize_identifier(GeneratedVisitor)
121 }
122 }
123 struct GeneratedVisitor;
124 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
125 type Value = CdcMessage;
126
127 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
128 formatter.write_str("struct connector_service.CdcMessage")
129 }
130
131 fn visit_map<V>(self, mut map_: V) -> std::result::Result<CdcMessage, V::Error>
132 where
133 V: serde::de::MapAccess<'de>,
134 {
135 let mut payload__ = None;
136 let mut partition__ = None;
137 let mut offset__ = None;
138 let mut full_table_name__ = None;
139 let mut source_ts_ms__ = None;
140 let mut msg_type__ = None;
141 let mut key__ = None;
142 while let Some(k) = map_.next_key()? {
143 match k {
144 GeneratedField::Payload => {
145 if payload__.is_some() {
146 return Err(serde::de::Error::duplicate_field("payload"));
147 }
148 payload__ = Some(map_.next_value()?);
149 }
150 GeneratedField::Partition => {
151 if partition__.is_some() {
152 return Err(serde::de::Error::duplicate_field("partition"));
153 }
154 partition__ = Some(map_.next_value()?);
155 }
156 GeneratedField::Offset => {
157 if offset__.is_some() {
158 return Err(serde::de::Error::duplicate_field("offset"));
159 }
160 offset__ = Some(map_.next_value()?);
161 }
162 GeneratedField::FullTableName => {
163 if full_table_name__.is_some() {
164 return Err(serde::de::Error::duplicate_field("fullTableName"));
165 }
166 full_table_name__ = Some(map_.next_value()?);
167 }
168 GeneratedField::SourceTsMs => {
169 if source_ts_ms__.is_some() {
170 return Err(serde::de::Error::duplicate_field("sourceTsMs"));
171 }
172 source_ts_ms__ =
173 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
174 ;
175 }
176 GeneratedField::MsgType => {
177 if msg_type__.is_some() {
178 return Err(serde::de::Error::duplicate_field("msgType"));
179 }
180 msg_type__ = Some(map_.next_value::<cdc_message::CdcMessageType>()? as i32);
181 }
182 GeneratedField::Key => {
183 if key__.is_some() {
184 return Err(serde::de::Error::duplicate_field("key"));
185 }
186 key__ = Some(map_.next_value()?);
187 }
188 }
189 }
190 Ok(CdcMessage {
191 payload: payload__.unwrap_or_default(),
192 partition: partition__.unwrap_or_default(),
193 offset: offset__.unwrap_or_default(),
194 full_table_name: full_table_name__.unwrap_or_default(),
195 source_ts_ms: source_ts_ms__.unwrap_or_default(),
196 msg_type: msg_type__.unwrap_or_default(),
197 key: key__.unwrap_or_default(),
198 })
199 }
200 }
201 deserializer.deserialize_struct("connector_service.CdcMessage", FIELDS, GeneratedVisitor)
202 }
203}
204impl serde::Serialize for cdc_message::CdcMessageType {
205 #[allow(deprecated)]
206 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
207 where
208 S: serde::Serializer,
209 {
210 let variant = match self {
211 Self::Unspecified => "UNSPECIFIED",
212 Self::Heartbeat => "HEARTBEAT",
213 Self::Data => "DATA",
214 Self::TransactionMeta => "TRANSACTION_META",
215 Self::SchemaChange => "SCHEMA_CHANGE",
216 };
217 serializer.serialize_str(variant)
218 }
219}
220impl<'de> serde::Deserialize<'de> for cdc_message::CdcMessageType {
221 #[allow(deprecated)]
222 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
223 where
224 D: serde::Deserializer<'de>,
225 {
226 const FIELDS: &[&str] = &[
227 "UNSPECIFIED",
228 "HEARTBEAT",
229 "DATA",
230 "TRANSACTION_META",
231 "SCHEMA_CHANGE",
232 ];
233
234 struct GeneratedVisitor;
235
236 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
237 type Value = cdc_message::CdcMessageType;
238
239 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
240 write!(formatter, "expected one of: {:?}", &FIELDS)
241 }
242
243 fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
244 where
245 E: serde::de::Error,
246 {
247 i32::try_from(v)
248 .ok()
249 .and_then(|x| x.try_into().ok())
250 .ok_or_else(|| {
251 serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
252 })
253 }
254
255 fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
256 where
257 E: serde::de::Error,
258 {
259 i32::try_from(v)
260 .ok()
261 .and_then(|x| x.try_into().ok())
262 .ok_or_else(|| {
263 serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
264 })
265 }
266
267 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
268 where
269 E: serde::de::Error,
270 {
271 match value {
272 "UNSPECIFIED" => Ok(cdc_message::CdcMessageType::Unspecified),
273 "HEARTBEAT" => Ok(cdc_message::CdcMessageType::Heartbeat),
274 "DATA" => Ok(cdc_message::CdcMessageType::Data),
275 "TRANSACTION_META" => Ok(cdc_message::CdcMessageType::TransactionMeta),
276 "SCHEMA_CHANGE" => Ok(cdc_message::CdcMessageType::SchemaChange),
277 _ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
278 }
279 }
280 }
281 deserializer.deserialize_any(GeneratedVisitor)
282 }
283}
284impl serde::Serialize for CoordinateRequest {
285 #[allow(deprecated)]
286 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
287 where
288 S: serde::Serializer,
289 {
290 use serde::ser::SerializeStruct;
291 let mut len = 0;
292 if self.msg.is_some() {
293 len += 1;
294 }
295 let mut struct_ser = serializer.serialize_struct("connector_service.CoordinateRequest", len)?;
296 if let Some(v) = self.msg.as_ref() {
297 match v {
298 coordinate_request::Msg::StartRequest(v) => {
299 struct_ser.serialize_field("startRequest", v)?;
300 }
301 coordinate_request::Msg::CommitRequest(v) => {
302 struct_ser.serialize_field("commitRequest", v)?;
303 }
304 coordinate_request::Msg::UpdateVnodeRequest(v) => {
305 struct_ser.serialize_field("updateVnodeRequest", v)?;
306 }
307 coordinate_request::Msg::Stop(v) => {
308 struct_ser.serialize_field("stop", v)?;
309 }
310 }
311 }
312 struct_ser.end()
313 }
314}
315impl<'de> serde::Deserialize<'de> for CoordinateRequest {
316 #[allow(deprecated)]
317 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
318 where
319 D: serde::Deserializer<'de>,
320 {
321 const FIELDS: &[&str] = &[
322 "start_request",
323 "startRequest",
324 "commit_request",
325 "commitRequest",
326 "update_vnode_request",
327 "updateVnodeRequest",
328 "stop",
329 ];
330
331 #[allow(clippy::enum_variant_names)]
332 enum GeneratedField {
333 StartRequest,
334 CommitRequest,
335 UpdateVnodeRequest,
336 Stop,
337 }
338 impl<'de> serde::Deserialize<'de> for GeneratedField {
339 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
340 where
341 D: serde::Deserializer<'de>,
342 {
343 struct GeneratedVisitor;
344
345 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
346 type Value = GeneratedField;
347
348 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
349 write!(formatter, "expected one of: {:?}", &FIELDS)
350 }
351
352 #[allow(unused_variables)]
353 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
354 where
355 E: serde::de::Error,
356 {
357 match value {
358 "startRequest" | "start_request" => Ok(GeneratedField::StartRequest),
359 "commitRequest" | "commit_request" => Ok(GeneratedField::CommitRequest),
360 "updateVnodeRequest" | "update_vnode_request" => Ok(GeneratedField::UpdateVnodeRequest),
361 "stop" => Ok(GeneratedField::Stop),
362 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
363 }
364 }
365 }
366 deserializer.deserialize_identifier(GeneratedVisitor)
367 }
368 }
369 struct GeneratedVisitor;
370 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
371 type Value = CoordinateRequest;
372
373 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
374 formatter.write_str("struct connector_service.CoordinateRequest")
375 }
376
377 fn visit_map<V>(self, mut map_: V) -> std::result::Result<CoordinateRequest, V::Error>
378 where
379 V: serde::de::MapAccess<'de>,
380 {
381 let mut msg__ = None;
382 while let Some(k) = map_.next_key()? {
383 match k {
384 GeneratedField::StartRequest => {
385 if msg__.is_some() {
386 return Err(serde::de::Error::duplicate_field("startRequest"));
387 }
388 msg__ = map_.next_value::<::std::option::Option<_>>()?.map(coordinate_request::Msg::StartRequest)
389;
390 }
391 GeneratedField::CommitRequest => {
392 if msg__.is_some() {
393 return Err(serde::de::Error::duplicate_field("commitRequest"));
394 }
395 msg__ = map_.next_value::<::std::option::Option<_>>()?.map(coordinate_request::Msg::CommitRequest)
396;
397 }
398 GeneratedField::UpdateVnodeRequest => {
399 if msg__.is_some() {
400 return Err(serde::de::Error::duplicate_field("updateVnodeRequest"));
401 }
402 msg__ = map_.next_value::<::std::option::Option<_>>()?.map(coordinate_request::Msg::UpdateVnodeRequest)
403;
404 }
405 GeneratedField::Stop => {
406 if msg__.is_some() {
407 return Err(serde::de::Error::duplicate_field("stop"));
408 }
409 msg__ = map_.next_value::<::std::option::Option<_>>()?.map(coordinate_request::Msg::Stop);
410 }
411 }
412 }
413 Ok(CoordinateRequest {
414 msg: msg__,
415 })
416 }
417 }
418 deserializer.deserialize_struct("connector_service.CoordinateRequest", FIELDS, GeneratedVisitor)
419 }
420}
421impl serde::Serialize for coordinate_request::CommitRequest {
422 #[allow(deprecated)]
423 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
424 where
425 S: serde::Serializer,
426 {
427 use serde::ser::SerializeStruct;
428 let mut len = 0;
429 if self.epoch != 0 {
430 len += 1;
431 }
432 if self.metadata.is_some() {
433 len += 1;
434 }
435 let mut struct_ser = serializer.serialize_struct("connector_service.CoordinateRequest.CommitRequest", len)?;
436 if self.epoch != 0 {
437 #[allow(clippy::needless_borrow)]
438 #[allow(clippy::needless_borrows_for_generic_args)]
439 struct_ser.serialize_field("epoch", ToString::to_string(&self.epoch).as_str())?;
440 }
441 if let Some(v) = self.metadata.as_ref() {
442 struct_ser.serialize_field("metadata", v)?;
443 }
444 struct_ser.end()
445 }
446}
447impl<'de> serde::Deserialize<'de> for coordinate_request::CommitRequest {
448 #[allow(deprecated)]
449 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
450 where
451 D: serde::Deserializer<'de>,
452 {
453 const FIELDS: &[&str] = &[
454 "epoch",
455 "metadata",
456 ];
457
458 #[allow(clippy::enum_variant_names)]
459 enum GeneratedField {
460 Epoch,
461 Metadata,
462 }
463 impl<'de> serde::Deserialize<'de> for GeneratedField {
464 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
465 where
466 D: serde::Deserializer<'de>,
467 {
468 struct GeneratedVisitor;
469
470 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
471 type Value = GeneratedField;
472
473 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
474 write!(formatter, "expected one of: {:?}", &FIELDS)
475 }
476
477 #[allow(unused_variables)]
478 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
479 where
480 E: serde::de::Error,
481 {
482 match value {
483 "epoch" => Ok(GeneratedField::Epoch),
484 "metadata" => Ok(GeneratedField::Metadata),
485 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
486 }
487 }
488 }
489 deserializer.deserialize_identifier(GeneratedVisitor)
490 }
491 }
492 struct GeneratedVisitor;
493 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
494 type Value = coordinate_request::CommitRequest;
495
496 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
497 formatter.write_str("struct connector_service.CoordinateRequest.CommitRequest")
498 }
499
500 fn visit_map<V>(self, mut map_: V) -> std::result::Result<coordinate_request::CommitRequest, V::Error>
501 where
502 V: serde::de::MapAccess<'de>,
503 {
504 let mut epoch__ = None;
505 let mut metadata__ = None;
506 while let Some(k) = map_.next_key()? {
507 match k {
508 GeneratedField::Epoch => {
509 if epoch__.is_some() {
510 return Err(serde::de::Error::duplicate_field("epoch"));
511 }
512 epoch__ =
513 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
514 ;
515 }
516 GeneratedField::Metadata => {
517 if metadata__.is_some() {
518 return Err(serde::de::Error::duplicate_field("metadata"));
519 }
520 metadata__ = map_.next_value()?;
521 }
522 }
523 }
524 Ok(coordinate_request::CommitRequest {
525 epoch: epoch__.unwrap_or_default(),
526 metadata: metadata__,
527 })
528 }
529 }
530 deserializer.deserialize_struct("connector_service.CoordinateRequest.CommitRequest", FIELDS, GeneratedVisitor)
531 }
532}
533impl serde::Serialize for coordinate_request::StartCoordinationRequest {
534 #[allow(deprecated)]
535 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
536 where
537 S: serde::Serializer,
538 {
539 use serde::ser::SerializeStruct;
540 let mut len = 0;
541 if self.vnode_bitmap.is_some() {
542 len += 1;
543 }
544 if self.param.is_some() {
545 len += 1;
546 }
547 let mut struct_ser = serializer.serialize_struct("connector_service.CoordinateRequest.StartCoordinationRequest", len)?;
548 if let Some(v) = self.vnode_bitmap.as_ref() {
549 struct_ser.serialize_field("vnodeBitmap", v)?;
550 }
551 if let Some(v) = self.param.as_ref() {
552 struct_ser.serialize_field("param", v)?;
553 }
554 struct_ser.end()
555 }
556}
557impl<'de> serde::Deserialize<'de> for coordinate_request::StartCoordinationRequest {
558 #[allow(deprecated)]
559 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
560 where
561 D: serde::Deserializer<'de>,
562 {
563 const FIELDS: &[&str] = &[
564 "vnode_bitmap",
565 "vnodeBitmap",
566 "param",
567 ];
568
569 #[allow(clippy::enum_variant_names)]
570 enum GeneratedField {
571 VnodeBitmap,
572 Param,
573 }
574 impl<'de> serde::Deserialize<'de> for GeneratedField {
575 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
576 where
577 D: serde::Deserializer<'de>,
578 {
579 struct GeneratedVisitor;
580
581 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
582 type Value = GeneratedField;
583
584 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
585 write!(formatter, "expected one of: {:?}", &FIELDS)
586 }
587
588 #[allow(unused_variables)]
589 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
590 where
591 E: serde::de::Error,
592 {
593 match value {
594 "vnodeBitmap" | "vnode_bitmap" => Ok(GeneratedField::VnodeBitmap),
595 "param" => Ok(GeneratedField::Param),
596 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
597 }
598 }
599 }
600 deserializer.deserialize_identifier(GeneratedVisitor)
601 }
602 }
603 struct GeneratedVisitor;
604 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
605 type Value = coordinate_request::StartCoordinationRequest;
606
607 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
608 formatter.write_str("struct connector_service.CoordinateRequest.StartCoordinationRequest")
609 }
610
611 fn visit_map<V>(self, mut map_: V) -> std::result::Result<coordinate_request::StartCoordinationRequest, V::Error>
612 where
613 V: serde::de::MapAccess<'de>,
614 {
615 let mut vnode_bitmap__ = None;
616 let mut param__ = None;
617 while let Some(k) = map_.next_key()? {
618 match k {
619 GeneratedField::VnodeBitmap => {
620 if vnode_bitmap__.is_some() {
621 return Err(serde::de::Error::duplicate_field("vnodeBitmap"));
622 }
623 vnode_bitmap__ = map_.next_value()?;
624 }
625 GeneratedField::Param => {
626 if param__.is_some() {
627 return Err(serde::de::Error::duplicate_field("param"));
628 }
629 param__ = map_.next_value()?;
630 }
631 }
632 }
633 Ok(coordinate_request::StartCoordinationRequest {
634 vnode_bitmap: vnode_bitmap__,
635 param: param__,
636 })
637 }
638 }
639 deserializer.deserialize_struct("connector_service.CoordinateRequest.StartCoordinationRequest", FIELDS, GeneratedVisitor)
640 }
641}
642impl serde::Serialize for coordinate_request::UpdateVnodeBitmapRequest {
643 #[allow(deprecated)]
644 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
645 where
646 S: serde::Serializer,
647 {
648 use serde::ser::SerializeStruct;
649 let mut len = 0;
650 if self.vnode_bitmap.is_some() {
651 len += 1;
652 }
653 let mut struct_ser = serializer.serialize_struct("connector_service.CoordinateRequest.UpdateVnodeBitmapRequest", len)?;
654 if let Some(v) = self.vnode_bitmap.as_ref() {
655 struct_ser.serialize_field("vnodeBitmap", v)?;
656 }
657 struct_ser.end()
658 }
659}
660impl<'de> serde::Deserialize<'de> for coordinate_request::UpdateVnodeBitmapRequest {
661 #[allow(deprecated)]
662 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
663 where
664 D: serde::Deserializer<'de>,
665 {
666 const FIELDS: &[&str] = &[
667 "vnode_bitmap",
668 "vnodeBitmap",
669 ];
670
671 #[allow(clippy::enum_variant_names)]
672 enum GeneratedField {
673 VnodeBitmap,
674 }
675 impl<'de> serde::Deserialize<'de> for GeneratedField {
676 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
677 where
678 D: serde::Deserializer<'de>,
679 {
680 struct GeneratedVisitor;
681
682 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
683 type Value = GeneratedField;
684
685 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
686 write!(formatter, "expected one of: {:?}", &FIELDS)
687 }
688
689 #[allow(unused_variables)]
690 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
691 where
692 E: serde::de::Error,
693 {
694 match value {
695 "vnodeBitmap" | "vnode_bitmap" => Ok(GeneratedField::VnodeBitmap),
696 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
697 }
698 }
699 }
700 deserializer.deserialize_identifier(GeneratedVisitor)
701 }
702 }
703 struct GeneratedVisitor;
704 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
705 type Value = coordinate_request::UpdateVnodeBitmapRequest;
706
707 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
708 formatter.write_str("struct connector_service.CoordinateRequest.UpdateVnodeBitmapRequest")
709 }
710
711 fn visit_map<V>(self, mut map_: V) -> std::result::Result<coordinate_request::UpdateVnodeBitmapRequest, V::Error>
712 where
713 V: serde::de::MapAccess<'de>,
714 {
715 let mut vnode_bitmap__ = None;
716 while let Some(k) = map_.next_key()? {
717 match k {
718 GeneratedField::VnodeBitmap => {
719 if vnode_bitmap__.is_some() {
720 return Err(serde::de::Error::duplicate_field("vnodeBitmap"));
721 }
722 vnode_bitmap__ = map_.next_value()?;
723 }
724 }
725 }
726 Ok(coordinate_request::UpdateVnodeBitmapRequest {
727 vnode_bitmap: vnode_bitmap__,
728 })
729 }
730 }
731 deserializer.deserialize_struct("connector_service.CoordinateRequest.UpdateVnodeBitmapRequest", FIELDS, GeneratedVisitor)
732 }
733}
734impl serde::Serialize for CoordinateResponse {
735 #[allow(deprecated)]
736 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
737 where
738 S: serde::Serializer,
739 {
740 use serde::ser::SerializeStruct;
741 let mut len = 0;
742 if self.msg.is_some() {
743 len += 1;
744 }
745 let mut struct_ser = serializer.serialize_struct("connector_service.CoordinateResponse", len)?;
746 if let Some(v) = self.msg.as_ref() {
747 match v {
748 coordinate_response::Msg::StartResponse(v) => {
749 struct_ser.serialize_field("startResponse", v)?;
750 }
751 coordinate_response::Msg::CommitResponse(v) => {
752 struct_ser.serialize_field("commitResponse", v)?;
753 }
754 }
755 }
756 struct_ser.end()
757 }
758}
759impl<'de> serde::Deserialize<'de> for CoordinateResponse {
760 #[allow(deprecated)]
761 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
762 where
763 D: serde::Deserializer<'de>,
764 {
765 const FIELDS: &[&str] = &[
766 "start_response",
767 "startResponse",
768 "commit_response",
769 "commitResponse",
770 ];
771
772 #[allow(clippy::enum_variant_names)]
773 enum GeneratedField {
774 StartResponse,
775 CommitResponse,
776 }
777 impl<'de> serde::Deserialize<'de> for GeneratedField {
778 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
779 where
780 D: serde::Deserializer<'de>,
781 {
782 struct GeneratedVisitor;
783
784 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
785 type Value = GeneratedField;
786
787 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
788 write!(formatter, "expected one of: {:?}", &FIELDS)
789 }
790
791 #[allow(unused_variables)]
792 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
793 where
794 E: serde::de::Error,
795 {
796 match value {
797 "startResponse" | "start_response" => Ok(GeneratedField::StartResponse),
798 "commitResponse" | "commit_response" => Ok(GeneratedField::CommitResponse),
799 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
800 }
801 }
802 }
803 deserializer.deserialize_identifier(GeneratedVisitor)
804 }
805 }
806 struct GeneratedVisitor;
807 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
808 type Value = CoordinateResponse;
809
810 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
811 formatter.write_str("struct connector_service.CoordinateResponse")
812 }
813
814 fn visit_map<V>(self, mut map_: V) -> std::result::Result<CoordinateResponse, V::Error>
815 where
816 V: serde::de::MapAccess<'de>,
817 {
818 let mut msg__ = None;
819 while let Some(k) = map_.next_key()? {
820 match k {
821 GeneratedField::StartResponse => {
822 if msg__.is_some() {
823 return Err(serde::de::Error::duplicate_field("startResponse"));
824 }
825 msg__ = map_.next_value::<::std::option::Option<_>>()?.map(coordinate_response::Msg::StartResponse)
826;
827 }
828 GeneratedField::CommitResponse => {
829 if msg__.is_some() {
830 return Err(serde::de::Error::duplicate_field("commitResponse"));
831 }
832 msg__ = map_.next_value::<::std::option::Option<_>>()?.map(coordinate_response::Msg::CommitResponse)
833;
834 }
835 }
836 }
837 Ok(CoordinateResponse {
838 msg: msg__,
839 })
840 }
841 }
842 deserializer.deserialize_struct("connector_service.CoordinateResponse", FIELDS, GeneratedVisitor)
843 }
844}
845impl serde::Serialize for coordinate_response::CommitResponse {
846 #[allow(deprecated)]
847 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
848 where
849 S: serde::Serializer,
850 {
851 use serde::ser::SerializeStruct;
852 let mut len = 0;
853 if self.epoch != 0 {
854 len += 1;
855 }
856 let mut struct_ser = serializer.serialize_struct("connector_service.CoordinateResponse.CommitResponse", len)?;
857 if self.epoch != 0 {
858 #[allow(clippy::needless_borrow)]
859 #[allow(clippy::needless_borrows_for_generic_args)]
860 struct_ser.serialize_field("epoch", ToString::to_string(&self.epoch).as_str())?;
861 }
862 struct_ser.end()
863 }
864}
865impl<'de> serde::Deserialize<'de> for coordinate_response::CommitResponse {
866 #[allow(deprecated)]
867 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
868 where
869 D: serde::Deserializer<'de>,
870 {
871 const FIELDS: &[&str] = &[
872 "epoch",
873 ];
874
875 #[allow(clippy::enum_variant_names)]
876 enum GeneratedField {
877 Epoch,
878 }
879 impl<'de> serde::Deserialize<'de> for GeneratedField {
880 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
881 where
882 D: serde::Deserializer<'de>,
883 {
884 struct GeneratedVisitor;
885
886 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
887 type Value = GeneratedField;
888
889 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
890 write!(formatter, "expected one of: {:?}", &FIELDS)
891 }
892
893 #[allow(unused_variables)]
894 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
895 where
896 E: serde::de::Error,
897 {
898 match value {
899 "epoch" => Ok(GeneratedField::Epoch),
900 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
901 }
902 }
903 }
904 deserializer.deserialize_identifier(GeneratedVisitor)
905 }
906 }
907 struct GeneratedVisitor;
908 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
909 type Value = coordinate_response::CommitResponse;
910
911 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
912 formatter.write_str("struct connector_service.CoordinateResponse.CommitResponse")
913 }
914
915 fn visit_map<V>(self, mut map_: V) -> std::result::Result<coordinate_response::CommitResponse, V::Error>
916 where
917 V: serde::de::MapAccess<'de>,
918 {
919 let mut epoch__ = None;
920 while let Some(k) = map_.next_key()? {
921 match k {
922 GeneratedField::Epoch => {
923 if epoch__.is_some() {
924 return Err(serde::de::Error::duplicate_field("epoch"));
925 }
926 epoch__ =
927 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
928 ;
929 }
930 }
931 }
932 Ok(coordinate_response::CommitResponse {
933 epoch: epoch__.unwrap_or_default(),
934 })
935 }
936 }
937 deserializer.deserialize_struct("connector_service.CoordinateResponse.CommitResponse", FIELDS, GeneratedVisitor)
938 }
939}
940impl serde::Serialize for coordinate_response::StartCoordinationResponse {
941 #[allow(deprecated)]
942 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
943 where
944 S: serde::Serializer,
945 {
946 use serde::ser::SerializeStruct;
947 let mut len = 0;
948 if self.log_store_rewind_start_epoch.is_some() {
949 len += 1;
950 }
951 let mut struct_ser = serializer.serialize_struct("connector_service.CoordinateResponse.StartCoordinationResponse", len)?;
952 if let Some(v) = self.log_store_rewind_start_epoch.as_ref() {
953 #[allow(clippy::needless_borrow)]
954 #[allow(clippy::needless_borrows_for_generic_args)]
955 struct_ser.serialize_field("logStoreRewindStartEpoch", ToString::to_string(&v).as_str())?;
956 }
957 struct_ser.end()
958 }
959}
960impl<'de> serde::Deserialize<'de> for coordinate_response::StartCoordinationResponse {
961 #[allow(deprecated)]
962 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
963 where
964 D: serde::Deserializer<'de>,
965 {
966 const FIELDS: &[&str] = &[
967 "log_store_rewind_start_epoch",
968 "logStoreRewindStartEpoch",
969 ];
970
971 #[allow(clippy::enum_variant_names)]
972 enum GeneratedField {
973 LogStoreRewindStartEpoch,
974 }
975 impl<'de> serde::Deserialize<'de> for GeneratedField {
976 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
977 where
978 D: serde::Deserializer<'de>,
979 {
980 struct GeneratedVisitor;
981
982 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
983 type Value = GeneratedField;
984
985 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
986 write!(formatter, "expected one of: {:?}", &FIELDS)
987 }
988
989 #[allow(unused_variables)]
990 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
991 where
992 E: serde::de::Error,
993 {
994 match value {
995 "logStoreRewindStartEpoch" | "log_store_rewind_start_epoch" => Ok(GeneratedField::LogStoreRewindStartEpoch),
996 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
997 }
998 }
999 }
1000 deserializer.deserialize_identifier(GeneratedVisitor)
1001 }
1002 }
1003 struct GeneratedVisitor;
1004 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1005 type Value = coordinate_response::StartCoordinationResponse;
1006
1007 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1008 formatter.write_str("struct connector_service.CoordinateResponse.StartCoordinationResponse")
1009 }
1010
1011 fn visit_map<V>(self, mut map_: V) -> std::result::Result<coordinate_response::StartCoordinationResponse, V::Error>
1012 where
1013 V: serde::de::MapAccess<'de>,
1014 {
1015 let mut log_store_rewind_start_epoch__ = None;
1016 while let Some(k) = map_.next_key()? {
1017 match k {
1018 GeneratedField::LogStoreRewindStartEpoch => {
1019 if log_store_rewind_start_epoch__.is_some() {
1020 return Err(serde::de::Error::duplicate_field("logStoreRewindStartEpoch"));
1021 }
1022 log_store_rewind_start_epoch__ =
1023 map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
1024 ;
1025 }
1026 }
1027 }
1028 Ok(coordinate_response::StartCoordinationResponse {
1029 log_store_rewind_start_epoch: log_store_rewind_start_epoch__,
1030 })
1031 }
1032 }
1033 deserializer.deserialize_struct("connector_service.CoordinateResponse.StartCoordinationResponse", FIELDS, GeneratedVisitor)
1034 }
1035}
1036impl serde::Serialize for GetEventStreamRequest {
1037 #[allow(deprecated)]
1038 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1039 where
1040 S: serde::Serializer,
1041 {
1042 use serde::ser::SerializeStruct;
1043 let mut len = 0;
1044 if self.source_id != 0 {
1045 len += 1;
1046 }
1047 if self.source_type != 0 {
1048 len += 1;
1049 }
1050 if !self.start_offset.is_empty() {
1051 len += 1;
1052 }
1053 if !self.properties.is_empty() {
1054 len += 1;
1055 }
1056 if self.snapshot_done {
1057 len += 1;
1058 }
1059 if self.is_source_job {
1060 len += 1;
1061 }
1062 let mut struct_ser = serializer.serialize_struct("connector_service.GetEventStreamRequest", len)?;
1063 if self.source_id != 0 {
1064 #[allow(clippy::needless_borrow)]
1065 #[allow(clippy::needless_borrows_for_generic_args)]
1066 struct_ser.serialize_field("sourceId", ToString::to_string(&self.source_id).as_str())?;
1067 }
1068 if self.source_type != 0 {
1069 let v = SourceType::try_from(self.source_type)
1070 .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.source_type)))?;
1071 struct_ser.serialize_field("sourceType", &v)?;
1072 }
1073 if !self.start_offset.is_empty() {
1074 struct_ser.serialize_field("startOffset", &self.start_offset)?;
1075 }
1076 if !self.properties.is_empty() {
1077 struct_ser.serialize_field("properties", &self.properties)?;
1078 }
1079 if self.snapshot_done {
1080 struct_ser.serialize_field("snapshotDone", &self.snapshot_done)?;
1081 }
1082 if self.is_source_job {
1083 struct_ser.serialize_field("isSourceJob", &self.is_source_job)?;
1084 }
1085 struct_ser.end()
1086 }
1087}
1088impl<'de> serde::Deserialize<'de> for GetEventStreamRequest {
1089 #[allow(deprecated)]
1090 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1091 where
1092 D: serde::Deserializer<'de>,
1093 {
1094 const FIELDS: &[&str] = &[
1095 "source_id",
1096 "sourceId",
1097 "source_type",
1098 "sourceType",
1099 "start_offset",
1100 "startOffset",
1101 "properties",
1102 "snapshot_done",
1103 "snapshotDone",
1104 "is_source_job",
1105 "isSourceJob",
1106 ];
1107
1108 #[allow(clippy::enum_variant_names)]
1109 enum GeneratedField {
1110 SourceId,
1111 SourceType,
1112 StartOffset,
1113 Properties,
1114 SnapshotDone,
1115 IsSourceJob,
1116 }
1117 impl<'de> serde::Deserialize<'de> for GeneratedField {
1118 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1119 where
1120 D: serde::Deserializer<'de>,
1121 {
1122 struct GeneratedVisitor;
1123
1124 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1125 type Value = GeneratedField;
1126
1127 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1128 write!(formatter, "expected one of: {:?}", &FIELDS)
1129 }
1130
1131 #[allow(unused_variables)]
1132 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1133 where
1134 E: serde::de::Error,
1135 {
1136 match value {
1137 "sourceId" | "source_id" => Ok(GeneratedField::SourceId),
1138 "sourceType" | "source_type" => Ok(GeneratedField::SourceType),
1139 "startOffset" | "start_offset" => Ok(GeneratedField::StartOffset),
1140 "properties" => Ok(GeneratedField::Properties),
1141 "snapshotDone" | "snapshot_done" => Ok(GeneratedField::SnapshotDone),
1142 "isSourceJob" | "is_source_job" => Ok(GeneratedField::IsSourceJob),
1143 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1144 }
1145 }
1146 }
1147 deserializer.deserialize_identifier(GeneratedVisitor)
1148 }
1149 }
1150 struct GeneratedVisitor;
1151 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1152 type Value = GetEventStreamRequest;
1153
1154 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1155 formatter.write_str("struct connector_service.GetEventStreamRequest")
1156 }
1157
1158 fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetEventStreamRequest, V::Error>
1159 where
1160 V: serde::de::MapAccess<'de>,
1161 {
1162 let mut source_id__ = None;
1163 let mut source_type__ = None;
1164 let mut start_offset__ = None;
1165 let mut properties__ = None;
1166 let mut snapshot_done__ = None;
1167 let mut is_source_job__ = None;
1168 while let Some(k) = map_.next_key()? {
1169 match k {
1170 GeneratedField::SourceId => {
1171 if source_id__.is_some() {
1172 return Err(serde::de::Error::duplicate_field("sourceId"));
1173 }
1174 source_id__ =
1175 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
1176 ;
1177 }
1178 GeneratedField::SourceType => {
1179 if source_type__.is_some() {
1180 return Err(serde::de::Error::duplicate_field("sourceType"));
1181 }
1182 source_type__ = Some(map_.next_value::<SourceType>()? as i32);
1183 }
1184 GeneratedField::StartOffset => {
1185 if start_offset__.is_some() {
1186 return Err(serde::de::Error::duplicate_field("startOffset"));
1187 }
1188 start_offset__ = Some(map_.next_value()?);
1189 }
1190 GeneratedField::Properties => {
1191 if properties__.is_some() {
1192 return Err(serde::de::Error::duplicate_field("properties"));
1193 }
1194 properties__ = Some(
1195 map_.next_value::<std::collections::BTreeMap<_, _>>()?
1196 );
1197 }
1198 GeneratedField::SnapshotDone => {
1199 if snapshot_done__.is_some() {
1200 return Err(serde::de::Error::duplicate_field("snapshotDone"));
1201 }
1202 snapshot_done__ = Some(map_.next_value()?);
1203 }
1204 GeneratedField::IsSourceJob => {
1205 if is_source_job__.is_some() {
1206 return Err(serde::de::Error::duplicate_field("isSourceJob"));
1207 }
1208 is_source_job__ = Some(map_.next_value()?);
1209 }
1210 }
1211 }
1212 Ok(GetEventStreamRequest {
1213 source_id: source_id__.unwrap_or_default(),
1214 source_type: source_type__.unwrap_or_default(),
1215 start_offset: start_offset__.unwrap_or_default(),
1216 properties: properties__.unwrap_or_default(),
1217 snapshot_done: snapshot_done__.unwrap_or_default(),
1218 is_source_job: is_source_job__.unwrap_or_default(),
1219 })
1220 }
1221 }
1222 deserializer.deserialize_struct("connector_service.GetEventStreamRequest", FIELDS, GeneratedVisitor)
1223 }
1224}
1225impl serde::Serialize for GetEventStreamResponse {
1226 #[allow(deprecated)]
1227 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1228 where
1229 S: serde::Serializer,
1230 {
1231 use serde::ser::SerializeStruct;
1232 let mut len = 0;
1233 if self.source_id != 0 {
1234 len += 1;
1235 }
1236 if !self.events.is_empty() {
1237 len += 1;
1238 }
1239 if self.control.is_some() {
1240 len += 1;
1241 }
1242 let mut struct_ser = serializer.serialize_struct("connector_service.GetEventStreamResponse", len)?;
1243 if self.source_id != 0 {
1244 #[allow(clippy::needless_borrow)]
1245 #[allow(clippy::needless_borrows_for_generic_args)]
1246 struct_ser.serialize_field("sourceId", ToString::to_string(&self.source_id).as_str())?;
1247 }
1248 if !self.events.is_empty() {
1249 struct_ser.serialize_field("events", &self.events)?;
1250 }
1251 if let Some(v) = self.control.as_ref() {
1252 struct_ser.serialize_field("control", v)?;
1253 }
1254 struct_ser.end()
1255 }
1256}
1257impl<'de> serde::Deserialize<'de> for GetEventStreamResponse {
1258 #[allow(deprecated)]
1259 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1260 where
1261 D: serde::Deserializer<'de>,
1262 {
1263 const FIELDS: &[&str] = &[
1264 "source_id",
1265 "sourceId",
1266 "events",
1267 "control",
1268 ];
1269
1270 #[allow(clippy::enum_variant_names)]
1271 enum GeneratedField {
1272 SourceId,
1273 Events,
1274 Control,
1275 }
1276 impl<'de> serde::Deserialize<'de> for GeneratedField {
1277 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1278 where
1279 D: serde::Deserializer<'de>,
1280 {
1281 struct GeneratedVisitor;
1282
1283 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1284 type Value = GeneratedField;
1285
1286 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1287 write!(formatter, "expected one of: {:?}", &FIELDS)
1288 }
1289
1290 #[allow(unused_variables)]
1291 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1292 where
1293 E: serde::de::Error,
1294 {
1295 match value {
1296 "sourceId" | "source_id" => Ok(GeneratedField::SourceId),
1297 "events" => Ok(GeneratedField::Events),
1298 "control" => Ok(GeneratedField::Control),
1299 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1300 }
1301 }
1302 }
1303 deserializer.deserialize_identifier(GeneratedVisitor)
1304 }
1305 }
1306 struct GeneratedVisitor;
1307 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1308 type Value = GetEventStreamResponse;
1309
1310 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1311 formatter.write_str("struct connector_service.GetEventStreamResponse")
1312 }
1313
1314 fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetEventStreamResponse, V::Error>
1315 where
1316 V: serde::de::MapAccess<'de>,
1317 {
1318 let mut source_id__ = None;
1319 let mut events__ = None;
1320 let mut control__ = None;
1321 while let Some(k) = map_.next_key()? {
1322 match k {
1323 GeneratedField::SourceId => {
1324 if source_id__.is_some() {
1325 return Err(serde::de::Error::duplicate_field("sourceId"));
1326 }
1327 source_id__ =
1328 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
1329 ;
1330 }
1331 GeneratedField::Events => {
1332 if events__.is_some() {
1333 return Err(serde::de::Error::duplicate_field("events"));
1334 }
1335 events__ = Some(map_.next_value()?);
1336 }
1337 GeneratedField::Control => {
1338 if control__.is_some() {
1339 return Err(serde::de::Error::duplicate_field("control"));
1340 }
1341 control__ = map_.next_value()?;
1342 }
1343 }
1344 }
1345 Ok(GetEventStreamResponse {
1346 source_id: source_id__.unwrap_or_default(),
1347 events: events__.unwrap_or_default(),
1348 control: control__,
1349 })
1350 }
1351 }
1352 deserializer.deserialize_struct("connector_service.GetEventStreamResponse", FIELDS, GeneratedVisitor)
1353 }
1354}
1355impl serde::Serialize for get_event_stream_response::ControlInfo {
1356 #[allow(deprecated)]
1357 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1358 where
1359 S: serde::Serializer,
1360 {
1361 use serde::ser::SerializeStruct;
1362 let mut len = 0;
1363 if self.handshake_ok {
1364 len += 1;
1365 }
1366 let mut struct_ser = serializer.serialize_struct("connector_service.GetEventStreamResponse.ControlInfo", len)?;
1367 if self.handshake_ok {
1368 struct_ser.serialize_field("handshakeOk", &self.handshake_ok)?;
1369 }
1370 struct_ser.end()
1371 }
1372}
1373impl<'de> serde::Deserialize<'de> for get_event_stream_response::ControlInfo {
1374 #[allow(deprecated)]
1375 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1376 where
1377 D: serde::Deserializer<'de>,
1378 {
1379 const FIELDS: &[&str] = &[
1380 "handshake_ok",
1381 "handshakeOk",
1382 ];
1383
1384 #[allow(clippy::enum_variant_names)]
1385 enum GeneratedField {
1386 HandshakeOk,
1387 }
1388 impl<'de> serde::Deserialize<'de> for GeneratedField {
1389 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1390 where
1391 D: serde::Deserializer<'de>,
1392 {
1393 struct GeneratedVisitor;
1394
1395 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1396 type Value = GeneratedField;
1397
1398 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1399 write!(formatter, "expected one of: {:?}", &FIELDS)
1400 }
1401
1402 #[allow(unused_variables)]
1403 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1404 where
1405 E: serde::de::Error,
1406 {
1407 match value {
1408 "handshakeOk" | "handshake_ok" => Ok(GeneratedField::HandshakeOk),
1409 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1410 }
1411 }
1412 }
1413 deserializer.deserialize_identifier(GeneratedVisitor)
1414 }
1415 }
1416 struct GeneratedVisitor;
1417 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1418 type Value = get_event_stream_response::ControlInfo;
1419
1420 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1421 formatter.write_str("struct connector_service.GetEventStreamResponse.ControlInfo")
1422 }
1423
1424 fn visit_map<V>(self, mut map_: V) -> std::result::Result<get_event_stream_response::ControlInfo, V::Error>
1425 where
1426 V: serde::de::MapAccess<'de>,
1427 {
1428 let mut handshake_ok__ = None;
1429 while let Some(k) = map_.next_key()? {
1430 match k {
1431 GeneratedField::HandshakeOk => {
1432 if handshake_ok__.is_some() {
1433 return Err(serde::de::Error::duplicate_field("handshakeOk"));
1434 }
1435 handshake_ok__ = Some(map_.next_value()?);
1436 }
1437 }
1438 }
1439 Ok(get_event_stream_response::ControlInfo {
1440 handshake_ok: handshake_ok__.unwrap_or_default(),
1441 })
1442 }
1443 }
1444 deserializer.deserialize_struct("connector_service.GetEventStreamResponse.ControlInfo", FIELDS, GeneratedVisitor)
1445 }
1446}
1447impl serde::Serialize for SinkCoordinatorStreamRequest {
1448 #[allow(deprecated)]
1449 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1450 where
1451 S: serde::Serializer,
1452 {
1453 use serde::ser::SerializeStruct;
1454 let mut len = 0;
1455 if self.request.is_some() {
1456 len += 1;
1457 }
1458 let mut struct_ser = serializer.serialize_struct("connector_service.SinkCoordinatorStreamRequest", len)?;
1459 if let Some(v) = self.request.as_ref() {
1460 match v {
1461 sink_coordinator_stream_request::Request::Start(v) => {
1462 struct_ser.serialize_field("start", v)?;
1463 }
1464 sink_coordinator_stream_request::Request::Commit(v) => {
1465 struct_ser.serialize_field("commit", v)?;
1466 }
1467 }
1468 }
1469 struct_ser.end()
1470 }
1471}
1472impl<'de> serde::Deserialize<'de> for SinkCoordinatorStreamRequest {
1473 #[allow(deprecated)]
1474 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1475 where
1476 D: serde::Deserializer<'de>,
1477 {
1478 const FIELDS: &[&str] = &[
1479 "start",
1480 "commit",
1481 ];
1482
1483 #[allow(clippy::enum_variant_names)]
1484 enum GeneratedField {
1485 Start,
1486 Commit,
1487 }
1488 impl<'de> serde::Deserialize<'de> for GeneratedField {
1489 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1490 where
1491 D: serde::Deserializer<'de>,
1492 {
1493 struct GeneratedVisitor;
1494
1495 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1496 type Value = GeneratedField;
1497
1498 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1499 write!(formatter, "expected one of: {:?}", &FIELDS)
1500 }
1501
1502 #[allow(unused_variables)]
1503 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1504 where
1505 E: serde::de::Error,
1506 {
1507 match value {
1508 "start" => Ok(GeneratedField::Start),
1509 "commit" => Ok(GeneratedField::Commit),
1510 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1511 }
1512 }
1513 }
1514 deserializer.deserialize_identifier(GeneratedVisitor)
1515 }
1516 }
1517 struct GeneratedVisitor;
1518 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1519 type Value = SinkCoordinatorStreamRequest;
1520
1521 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1522 formatter.write_str("struct connector_service.SinkCoordinatorStreamRequest")
1523 }
1524
1525 fn visit_map<V>(self, mut map_: V) -> std::result::Result<SinkCoordinatorStreamRequest, V::Error>
1526 where
1527 V: serde::de::MapAccess<'de>,
1528 {
1529 let mut request__ = None;
1530 while let Some(k) = map_.next_key()? {
1531 match k {
1532 GeneratedField::Start => {
1533 if request__.is_some() {
1534 return Err(serde::de::Error::duplicate_field("start"));
1535 }
1536 request__ = map_.next_value::<::std::option::Option<_>>()?.map(sink_coordinator_stream_request::Request::Start)
1537;
1538 }
1539 GeneratedField::Commit => {
1540 if request__.is_some() {
1541 return Err(serde::de::Error::duplicate_field("commit"));
1542 }
1543 request__ = map_.next_value::<::std::option::Option<_>>()?.map(sink_coordinator_stream_request::Request::Commit)
1544;
1545 }
1546 }
1547 }
1548 Ok(SinkCoordinatorStreamRequest {
1549 request: request__,
1550 })
1551 }
1552 }
1553 deserializer.deserialize_struct("connector_service.SinkCoordinatorStreamRequest", FIELDS, GeneratedVisitor)
1554 }
1555}
1556impl serde::Serialize for sink_coordinator_stream_request::CommitMetadata {
1557 #[allow(deprecated)]
1558 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1559 where
1560 S: serde::Serializer,
1561 {
1562 use serde::ser::SerializeStruct;
1563 let mut len = 0;
1564 if self.epoch != 0 {
1565 len += 1;
1566 }
1567 if !self.metadata.is_empty() {
1568 len += 1;
1569 }
1570 let mut struct_ser = serializer.serialize_struct("connector_service.SinkCoordinatorStreamRequest.CommitMetadata", len)?;
1571 if self.epoch != 0 {
1572 #[allow(clippy::needless_borrow)]
1573 #[allow(clippy::needless_borrows_for_generic_args)]
1574 struct_ser.serialize_field("epoch", ToString::to_string(&self.epoch).as_str())?;
1575 }
1576 if !self.metadata.is_empty() {
1577 struct_ser.serialize_field("metadata", &self.metadata)?;
1578 }
1579 struct_ser.end()
1580 }
1581}
1582impl<'de> serde::Deserialize<'de> for sink_coordinator_stream_request::CommitMetadata {
1583 #[allow(deprecated)]
1584 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1585 where
1586 D: serde::Deserializer<'de>,
1587 {
1588 const FIELDS: &[&str] = &[
1589 "epoch",
1590 "metadata",
1591 ];
1592
1593 #[allow(clippy::enum_variant_names)]
1594 enum GeneratedField {
1595 Epoch,
1596 Metadata,
1597 }
1598 impl<'de> serde::Deserialize<'de> for GeneratedField {
1599 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1600 where
1601 D: serde::Deserializer<'de>,
1602 {
1603 struct GeneratedVisitor;
1604
1605 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1606 type Value = GeneratedField;
1607
1608 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1609 write!(formatter, "expected one of: {:?}", &FIELDS)
1610 }
1611
1612 #[allow(unused_variables)]
1613 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1614 where
1615 E: serde::de::Error,
1616 {
1617 match value {
1618 "epoch" => Ok(GeneratedField::Epoch),
1619 "metadata" => Ok(GeneratedField::Metadata),
1620 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1621 }
1622 }
1623 }
1624 deserializer.deserialize_identifier(GeneratedVisitor)
1625 }
1626 }
1627 struct GeneratedVisitor;
1628 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1629 type Value = sink_coordinator_stream_request::CommitMetadata;
1630
1631 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1632 formatter.write_str("struct connector_service.SinkCoordinatorStreamRequest.CommitMetadata")
1633 }
1634
1635 fn visit_map<V>(self, mut map_: V) -> std::result::Result<sink_coordinator_stream_request::CommitMetadata, V::Error>
1636 where
1637 V: serde::de::MapAccess<'de>,
1638 {
1639 let mut epoch__ = None;
1640 let mut metadata__ = None;
1641 while let Some(k) = map_.next_key()? {
1642 match k {
1643 GeneratedField::Epoch => {
1644 if epoch__.is_some() {
1645 return Err(serde::de::Error::duplicate_field("epoch"));
1646 }
1647 epoch__ =
1648 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
1649 ;
1650 }
1651 GeneratedField::Metadata => {
1652 if metadata__.is_some() {
1653 return Err(serde::de::Error::duplicate_field("metadata"));
1654 }
1655 metadata__ = Some(map_.next_value()?);
1656 }
1657 }
1658 }
1659 Ok(sink_coordinator_stream_request::CommitMetadata {
1660 epoch: epoch__.unwrap_or_default(),
1661 metadata: metadata__.unwrap_or_default(),
1662 })
1663 }
1664 }
1665 deserializer.deserialize_struct("connector_service.SinkCoordinatorStreamRequest.CommitMetadata", FIELDS, GeneratedVisitor)
1666 }
1667}
1668impl serde::Serialize for sink_coordinator_stream_request::StartCoordinator {
1669 #[allow(deprecated)]
1670 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1671 where
1672 S: serde::Serializer,
1673 {
1674 use serde::ser::SerializeStruct;
1675 let mut len = 0;
1676 if self.param.is_some() {
1677 len += 1;
1678 }
1679 let mut struct_ser = serializer.serialize_struct("connector_service.SinkCoordinatorStreamRequest.StartCoordinator", len)?;
1680 if let Some(v) = self.param.as_ref() {
1681 struct_ser.serialize_field("param", v)?;
1682 }
1683 struct_ser.end()
1684 }
1685}
1686impl<'de> serde::Deserialize<'de> for sink_coordinator_stream_request::StartCoordinator {
1687 #[allow(deprecated)]
1688 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1689 where
1690 D: serde::Deserializer<'de>,
1691 {
1692 const FIELDS: &[&str] = &[
1693 "param",
1694 ];
1695
1696 #[allow(clippy::enum_variant_names)]
1697 enum GeneratedField {
1698 Param,
1699 }
1700 impl<'de> serde::Deserialize<'de> for GeneratedField {
1701 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1702 where
1703 D: serde::Deserializer<'de>,
1704 {
1705 struct GeneratedVisitor;
1706
1707 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1708 type Value = GeneratedField;
1709
1710 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1711 write!(formatter, "expected one of: {:?}", &FIELDS)
1712 }
1713
1714 #[allow(unused_variables)]
1715 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1716 where
1717 E: serde::de::Error,
1718 {
1719 match value {
1720 "param" => Ok(GeneratedField::Param),
1721 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1722 }
1723 }
1724 }
1725 deserializer.deserialize_identifier(GeneratedVisitor)
1726 }
1727 }
1728 struct GeneratedVisitor;
1729 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1730 type Value = sink_coordinator_stream_request::StartCoordinator;
1731
1732 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1733 formatter.write_str("struct connector_service.SinkCoordinatorStreamRequest.StartCoordinator")
1734 }
1735
1736 fn visit_map<V>(self, mut map_: V) -> std::result::Result<sink_coordinator_stream_request::StartCoordinator, V::Error>
1737 where
1738 V: serde::de::MapAccess<'de>,
1739 {
1740 let mut param__ = None;
1741 while let Some(k) = map_.next_key()? {
1742 match k {
1743 GeneratedField::Param => {
1744 if param__.is_some() {
1745 return Err(serde::de::Error::duplicate_field("param"));
1746 }
1747 param__ = map_.next_value()?;
1748 }
1749 }
1750 }
1751 Ok(sink_coordinator_stream_request::StartCoordinator {
1752 param: param__,
1753 })
1754 }
1755 }
1756 deserializer.deserialize_struct("connector_service.SinkCoordinatorStreamRequest.StartCoordinator", FIELDS, GeneratedVisitor)
1757 }
1758}
1759impl serde::Serialize for SinkCoordinatorStreamResponse {
1760 #[allow(deprecated)]
1761 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1762 where
1763 S: serde::Serializer,
1764 {
1765 use serde::ser::SerializeStruct;
1766 let mut len = 0;
1767 if self.response.is_some() {
1768 len += 1;
1769 }
1770 let mut struct_ser = serializer.serialize_struct("connector_service.SinkCoordinatorStreamResponse", len)?;
1771 if let Some(v) = self.response.as_ref() {
1772 match v {
1773 sink_coordinator_stream_response::Response::Start(v) => {
1774 struct_ser.serialize_field("start", v)?;
1775 }
1776 sink_coordinator_stream_response::Response::Commit(v) => {
1777 struct_ser.serialize_field("commit", v)?;
1778 }
1779 }
1780 }
1781 struct_ser.end()
1782 }
1783}
1784impl<'de> serde::Deserialize<'de> for SinkCoordinatorStreamResponse {
1785 #[allow(deprecated)]
1786 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1787 where
1788 D: serde::Deserializer<'de>,
1789 {
1790 const FIELDS: &[&str] = &[
1791 "start",
1792 "commit",
1793 ];
1794
1795 #[allow(clippy::enum_variant_names)]
1796 enum GeneratedField {
1797 Start,
1798 Commit,
1799 }
1800 impl<'de> serde::Deserialize<'de> for GeneratedField {
1801 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1802 where
1803 D: serde::Deserializer<'de>,
1804 {
1805 struct GeneratedVisitor;
1806
1807 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1808 type Value = GeneratedField;
1809
1810 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1811 write!(formatter, "expected one of: {:?}", &FIELDS)
1812 }
1813
1814 #[allow(unused_variables)]
1815 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1816 where
1817 E: serde::de::Error,
1818 {
1819 match value {
1820 "start" => Ok(GeneratedField::Start),
1821 "commit" => Ok(GeneratedField::Commit),
1822 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1823 }
1824 }
1825 }
1826 deserializer.deserialize_identifier(GeneratedVisitor)
1827 }
1828 }
1829 struct GeneratedVisitor;
1830 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1831 type Value = SinkCoordinatorStreamResponse;
1832
1833 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1834 formatter.write_str("struct connector_service.SinkCoordinatorStreamResponse")
1835 }
1836
1837 fn visit_map<V>(self, mut map_: V) -> std::result::Result<SinkCoordinatorStreamResponse, V::Error>
1838 where
1839 V: serde::de::MapAccess<'de>,
1840 {
1841 let mut response__ = None;
1842 while let Some(k) = map_.next_key()? {
1843 match k {
1844 GeneratedField::Start => {
1845 if response__.is_some() {
1846 return Err(serde::de::Error::duplicate_field("start"));
1847 }
1848 response__ = map_.next_value::<::std::option::Option<_>>()?.map(sink_coordinator_stream_response::Response::Start)
1849;
1850 }
1851 GeneratedField::Commit => {
1852 if response__.is_some() {
1853 return Err(serde::de::Error::duplicate_field("commit"));
1854 }
1855 response__ = map_.next_value::<::std::option::Option<_>>()?.map(sink_coordinator_stream_response::Response::Commit)
1856;
1857 }
1858 }
1859 }
1860 Ok(SinkCoordinatorStreamResponse {
1861 response: response__,
1862 })
1863 }
1864 }
1865 deserializer.deserialize_struct("connector_service.SinkCoordinatorStreamResponse", FIELDS, GeneratedVisitor)
1866 }
1867}
1868impl serde::Serialize for sink_coordinator_stream_response::CommitResponse {
1869 #[allow(deprecated)]
1870 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1871 where
1872 S: serde::Serializer,
1873 {
1874 use serde::ser::SerializeStruct;
1875 let mut len = 0;
1876 if self.epoch != 0 {
1877 len += 1;
1878 }
1879 let mut struct_ser = serializer.serialize_struct("connector_service.SinkCoordinatorStreamResponse.CommitResponse", len)?;
1880 if self.epoch != 0 {
1881 #[allow(clippy::needless_borrow)]
1882 #[allow(clippy::needless_borrows_for_generic_args)]
1883 struct_ser.serialize_field("epoch", ToString::to_string(&self.epoch).as_str())?;
1884 }
1885 struct_ser.end()
1886 }
1887}
1888impl<'de> serde::Deserialize<'de> for sink_coordinator_stream_response::CommitResponse {
1889 #[allow(deprecated)]
1890 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1891 where
1892 D: serde::Deserializer<'de>,
1893 {
1894 const FIELDS: &[&str] = &[
1895 "epoch",
1896 ];
1897
1898 #[allow(clippy::enum_variant_names)]
1899 enum GeneratedField {
1900 Epoch,
1901 }
1902 impl<'de> serde::Deserialize<'de> for GeneratedField {
1903 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1904 where
1905 D: serde::Deserializer<'de>,
1906 {
1907 struct GeneratedVisitor;
1908
1909 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1910 type Value = GeneratedField;
1911
1912 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1913 write!(formatter, "expected one of: {:?}", &FIELDS)
1914 }
1915
1916 #[allow(unused_variables)]
1917 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1918 where
1919 E: serde::de::Error,
1920 {
1921 match value {
1922 "epoch" => Ok(GeneratedField::Epoch),
1923 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1924 }
1925 }
1926 }
1927 deserializer.deserialize_identifier(GeneratedVisitor)
1928 }
1929 }
1930 struct GeneratedVisitor;
1931 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1932 type Value = sink_coordinator_stream_response::CommitResponse;
1933
1934 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1935 formatter.write_str("struct connector_service.SinkCoordinatorStreamResponse.CommitResponse")
1936 }
1937
1938 fn visit_map<V>(self, mut map_: V) -> std::result::Result<sink_coordinator_stream_response::CommitResponse, V::Error>
1939 where
1940 V: serde::de::MapAccess<'de>,
1941 {
1942 let mut epoch__ = None;
1943 while let Some(k) = map_.next_key()? {
1944 match k {
1945 GeneratedField::Epoch => {
1946 if epoch__.is_some() {
1947 return Err(serde::de::Error::duplicate_field("epoch"));
1948 }
1949 epoch__ =
1950 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
1951 ;
1952 }
1953 }
1954 }
1955 Ok(sink_coordinator_stream_response::CommitResponse {
1956 epoch: epoch__.unwrap_or_default(),
1957 })
1958 }
1959 }
1960 deserializer.deserialize_struct("connector_service.SinkCoordinatorStreamResponse.CommitResponse", FIELDS, GeneratedVisitor)
1961 }
1962}
1963impl serde::Serialize for sink_coordinator_stream_response::StartResponse {
1964 #[allow(deprecated)]
1965 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1966 where
1967 S: serde::Serializer,
1968 {
1969 use serde::ser::SerializeStruct;
1970 let len = 0;
1971 let struct_ser = serializer.serialize_struct("connector_service.SinkCoordinatorStreamResponse.StartResponse", len)?;
1972 struct_ser.end()
1973 }
1974}
1975impl<'de> serde::Deserialize<'de> for sink_coordinator_stream_response::StartResponse {
1976 #[allow(deprecated)]
1977 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1978 where
1979 D: serde::Deserializer<'de>,
1980 {
1981 const FIELDS: &[&str] = &[
1982 ];
1983
1984 #[allow(clippy::enum_variant_names)]
1985 enum GeneratedField {
1986 }
1987 impl<'de> serde::Deserialize<'de> for GeneratedField {
1988 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1989 where
1990 D: serde::Deserializer<'de>,
1991 {
1992 struct GeneratedVisitor;
1993
1994 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1995 type Value = GeneratedField;
1996
1997 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1998 write!(formatter, "expected one of: {:?}", &FIELDS)
1999 }
2000
2001 #[allow(unused_variables)]
2002 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
2003 where
2004 E: serde::de::Error,
2005 {
2006 Err(serde::de::Error::unknown_field(value, FIELDS))
2007 }
2008 }
2009 deserializer.deserialize_identifier(GeneratedVisitor)
2010 }
2011 }
2012 struct GeneratedVisitor;
2013 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2014 type Value = sink_coordinator_stream_response::StartResponse;
2015
2016 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2017 formatter.write_str("struct connector_service.SinkCoordinatorStreamResponse.StartResponse")
2018 }
2019
2020 fn visit_map<V>(self, mut map_: V) -> std::result::Result<sink_coordinator_stream_response::StartResponse, V::Error>
2021 where
2022 V: serde::de::MapAccess<'de>,
2023 {
2024 while map_.next_key::<GeneratedField>()?.is_some() {
2025 let _ = map_.next_value::<serde::de::IgnoredAny>()?;
2026 }
2027 Ok(sink_coordinator_stream_response::StartResponse {
2028 })
2029 }
2030 }
2031 deserializer.deserialize_struct("connector_service.SinkCoordinatorStreamResponse.StartResponse", FIELDS, GeneratedVisitor)
2032 }
2033}
2034impl serde::Serialize for SinkMetadata {
2035 #[allow(deprecated)]
2036 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2037 where
2038 S: serde::Serializer,
2039 {
2040 use serde::ser::SerializeStruct;
2041 let mut len = 0;
2042 if self.metadata.is_some() {
2043 len += 1;
2044 }
2045 let mut struct_ser = serializer.serialize_struct("connector_service.SinkMetadata", len)?;
2046 if let Some(v) = self.metadata.as_ref() {
2047 match v {
2048 sink_metadata::Metadata::Serialized(v) => {
2049 struct_ser.serialize_field("serialized", v)?;
2050 }
2051 }
2052 }
2053 struct_ser.end()
2054 }
2055}
2056impl<'de> serde::Deserialize<'de> for SinkMetadata {
2057 #[allow(deprecated)]
2058 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2059 where
2060 D: serde::Deserializer<'de>,
2061 {
2062 const FIELDS: &[&str] = &[
2063 "serialized",
2064 ];
2065
2066 #[allow(clippy::enum_variant_names)]
2067 enum GeneratedField {
2068 Serialized,
2069 }
2070 impl<'de> serde::Deserialize<'de> for GeneratedField {
2071 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
2072 where
2073 D: serde::Deserializer<'de>,
2074 {
2075 struct GeneratedVisitor;
2076
2077 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2078 type Value = GeneratedField;
2079
2080 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2081 write!(formatter, "expected one of: {:?}", &FIELDS)
2082 }
2083
2084 #[allow(unused_variables)]
2085 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
2086 where
2087 E: serde::de::Error,
2088 {
2089 match value {
2090 "serialized" => Ok(GeneratedField::Serialized),
2091 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
2092 }
2093 }
2094 }
2095 deserializer.deserialize_identifier(GeneratedVisitor)
2096 }
2097 }
2098 struct GeneratedVisitor;
2099 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2100 type Value = SinkMetadata;
2101
2102 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2103 formatter.write_str("struct connector_service.SinkMetadata")
2104 }
2105
2106 fn visit_map<V>(self, mut map_: V) -> std::result::Result<SinkMetadata, V::Error>
2107 where
2108 V: serde::de::MapAccess<'de>,
2109 {
2110 let mut metadata__ = None;
2111 while let Some(k) = map_.next_key()? {
2112 match k {
2113 GeneratedField::Serialized => {
2114 if metadata__.is_some() {
2115 return Err(serde::de::Error::duplicate_field("serialized"));
2116 }
2117 metadata__ = map_.next_value::<::std::option::Option<_>>()?.map(sink_metadata::Metadata::Serialized)
2118;
2119 }
2120 }
2121 }
2122 Ok(SinkMetadata {
2123 metadata: metadata__,
2124 })
2125 }
2126 }
2127 deserializer.deserialize_struct("connector_service.SinkMetadata", FIELDS, GeneratedVisitor)
2128 }
2129}
2130impl serde::Serialize for sink_metadata::SerializedMetadata {
2131 #[allow(deprecated)]
2132 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2133 where
2134 S: serde::Serializer,
2135 {
2136 use serde::ser::SerializeStruct;
2137 let mut len = 0;
2138 if !self.metadata.is_empty() {
2139 len += 1;
2140 }
2141 let mut struct_ser = serializer.serialize_struct("connector_service.SinkMetadata.SerializedMetadata", len)?;
2142 if !self.metadata.is_empty() {
2143 #[allow(clippy::needless_borrow)]
2144 #[allow(clippy::needless_borrows_for_generic_args)]
2145 struct_ser.serialize_field("metadata", pbjson::private::base64::encode(&self.metadata).as_str())?;
2146 }
2147 struct_ser.end()
2148 }
2149}
2150impl<'de> serde::Deserialize<'de> for sink_metadata::SerializedMetadata {
2151 #[allow(deprecated)]
2152 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2153 where
2154 D: serde::Deserializer<'de>,
2155 {
2156 const FIELDS: &[&str] = &[
2157 "metadata",
2158 ];
2159
2160 #[allow(clippy::enum_variant_names)]
2161 enum GeneratedField {
2162 Metadata,
2163 }
2164 impl<'de> serde::Deserialize<'de> for GeneratedField {
2165 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
2166 where
2167 D: serde::Deserializer<'de>,
2168 {
2169 struct GeneratedVisitor;
2170
2171 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2172 type Value = GeneratedField;
2173
2174 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2175 write!(formatter, "expected one of: {:?}", &FIELDS)
2176 }
2177
2178 #[allow(unused_variables)]
2179 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
2180 where
2181 E: serde::de::Error,
2182 {
2183 match value {
2184 "metadata" => Ok(GeneratedField::Metadata),
2185 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
2186 }
2187 }
2188 }
2189 deserializer.deserialize_identifier(GeneratedVisitor)
2190 }
2191 }
2192 struct GeneratedVisitor;
2193 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2194 type Value = sink_metadata::SerializedMetadata;
2195
2196 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2197 formatter.write_str("struct connector_service.SinkMetadata.SerializedMetadata")
2198 }
2199
2200 fn visit_map<V>(self, mut map_: V) -> std::result::Result<sink_metadata::SerializedMetadata, V::Error>
2201 where
2202 V: serde::de::MapAccess<'de>,
2203 {
2204 let mut metadata__ = None;
2205 while let Some(k) = map_.next_key()? {
2206 match k {
2207 GeneratedField::Metadata => {
2208 if metadata__.is_some() {
2209 return Err(serde::de::Error::duplicate_field("metadata"));
2210 }
2211 metadata__ =
2212 Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0)
2213 ;
2214 }
2215 }
2216 }
2217 Ok(sink_metadata::SerializedMetadata {
2218 metadata: metadata__.unwrap_or_default(),
2219 })
2220 }
2221 }
2222 deserializer.deserialize_struct("connector_service.SinkMetadata.SerializedMetadata", FIELDS, GeneratedVisitor)
2223 }
2224}
2225impl serde::Serialize for SinkParam {
2226 #[allow(deprecated)]
2227 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2228 where
2229 S: serde::Serializer,
2230 {
2231 use serde::ser::SerializeStruct;
2232 let mut len = 0;
2233 if self.sink_id != 0 {
2234 len += 1;
2235 }
2236 if !self.properties.is_empty() {
2237 len += 1;
2238 }
2239 if self.table_schema.is_some() {
2240 len += 1;
2241 }
2242 if self.sink_type != 0 {
2243 len += 1;
2244 }
2245 if !self.db_name.is_empty() {
2246 len += 1;
2247 }
2248 if !self.sink_from_name.is_empty() {
2249 len += 1;
2250 }
2251 if self.format_desc.is_some() {
2252 len += 1;
2253 }
2254 if !self.sink_name.is_empty() {
2255 len += 1;
2256 }
2257 let mut struct_ser = serializer.serialize_struct("connector_service.SinkParam", len)?;
2258 if self.sink_id != 0 {
2259 struct_ser.serialize_field("sinkId", &self.sink_id)?;
2260 }
2261 if !self.properties.is_empty() {
2262 struct_ser.serialize_field("properties", &self.properties)?;
2263 }
2264 if let Some(v) = self.table_schema.as_ref() {
2265 struct_ser.serialize_field("tableSchema", v)?;
2266 }
2267 if self.sink_type != 0 {
2268 let v = super::catalog::SinkType::try_from(self.sink_type)
2269 .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.sink_type)))?;
2270 struct_ser.serialize_field("sinkType", &v)?;
2271 }
2272 if !self.db_name.is_empty() {
2273 struct_ser.serialize_field("dbName", &self.db_name)?;
2274 }
2275 if !self.sink_from_name.is_empty() {
2276 struct_ser.serialize_field("sinkFromName", &self.sink_from_name)?;
2277 }
2278 if let Some(v) = self.format_desc.as_ref() {
2279 struct_ser.serialize_field("formatDesc", v)?;
2280 }
2281 if !self.sink_name.is_empty() {
2282 struct_ser.serialize_field("sinkName", &self.sink_name)?;
2283 }
2284 struct_ser.end()
2285 }
2286}
2287impl<'de> serde::Deserialize<'de> for SinkParam {
2288 #[allow(deprecated)]
2289 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2290 where
2291 D: serde::Deserializer<'de>,
2292 {
2293 const FIELDS: &[&str] = &[
2294 "sink_id",
2295 "sinkId",
2296 "properties",
2297 "table_schema",
2298 "tableSchema",
2299 "sink_type",
2300 "sinkType",
2301 "db_name",
2302 "dbName",
2303 "sink_from_name",
2304 "sinkFromName",
2305 "format_desc",
2306 "formatDesc",
2307 "sink_name",
2308 "sinkName",
2309 ];
2310
2311 #[allow(clippy::enum_variant_names)]
2312 enum GeneratedField {
2313 SinkId,
2314 Properties,
2315 TableSchema,
2316 SinkType,
2317 DbName,
2318 SinkFromName,
2319 FormatDesc,
2320 SinkName,
2321 }
2322 impl<'de> serde::Deserialize<'de> for GeneratedField {
2323 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
2324 where
2325 D: serde::Deserializer<'de>,
2326 {
2327 struct GeneratedVisitor;
2328
2329 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2330 type Value = GeneratedField;
2331
2332 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2333 write!(formatter, "expected one of: {:?}", &FIELDS)
2334 }
2335
2336 #[allow(unused_variables)]
2337 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
2338 where
2339 E: serde::de::Error,
2340 {
2341 match value {
2342 "sinkId" | "sink_id" => Ok(GeneratedField::SinkId),
2343 "properties" => Ok(GeneratedField::Properties),
2344 "tableSchema" | "table_schema" => Ok(GeneratedField::TableSchema),
2345 "sinkType" | "sink_type" => Ok(GeneratedField::SinkType),
2346 "dbName" | "db_name" => Ok(GeneratedField::DbName),
2347 "sinkFromName" | "sink_from_name" => Ok(GeneratedField::SinkFromName),
2348 "formatDesc" | "format_desc" => Ok(GeneratedField::FormatDesc),
2349 "sinkName" | "sink_name" => Ok(GeneratedField::SinkName),
2350 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
2351 }
2352 }
2353 }
2354 deserializer.deserialize_identifier(GeneratedVisitor)
2355 }
2356 }
2357 struct GeneratedVisitor;
2358 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2359 type Value = SinkParam;
2360
2361 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2362 formatter.write_str("struct connector_service.SinkParam")
2363 }
2364
2365 fn visit_map<V>(self, mut map_: V) -> std::result::Result<SinkParam, V::Error>
2366 where
2367 V: serde::de::MapAccess<'de>,
2368 {
2369 let mut sink_id__ = None;
2370 let mut properties__ = None;
2371 let mut table_schema__ = None;
2372 let mut sink_type__ = None;
2373 let mut db_name__ = None;
2374 let mut sink_from_name__ = None;
2375 let mut format_desc__ = None;
2376 let mut sink_name__ = None;
2377 while let Some(k) = map_.next_key()? {
2378 match k {
2379 GeneratedField::SinkId => {
2380 if sink_id__.is_some() {
2381 return Err(serde::de::Error::duplicate_field("sinkId"));
2382 }
2383 sink_id__ =
2384 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
2385 ;
2386 }
2387 GeneratedField::Properties => {
2388 if properties__.is_some() {
2389 return Err(serde::de::Error::duplicate_field("properties"));
2390 }
2391 properties__ = Some(
2392 map_.next_value::<std::collections::BTreeMap<_, _>>()?
2393 );
2394 }
2395 GeneratedField::TableSchema => {
2396 if table_schema__.is_some() {
2397 return Err(serde::de::Error::duplicate_field("tableSchema"));
2398 }
2399 table_schema__ = map_.next_value()?;
2400 }
2401 GeneratedField::SinkType => {
2402 if sink_type__.is_some() {
2403 return Err(serde::de::Error::duplicate_field("sinkType"));
2404 }
2405 sink_type__ = Some(map_.next_value::<super::catalog::SinkType>()? as i32);
2406 }
2407 GeneratedField::DbName => {
2408 if db_name__.is_some() {
2409 return Err(serde::de::Error::duplicate_field("dbName"));
2410 }
2411 db_name__ = Some(map_.next_value()?);
2412 }
2413 GeneratedField::SinkFromName => {
2414 if sink_from_name__.is_some() {
2415 return Err(serde::de::Error::duplicate_field("sinkFromName"));
2416 }
2417 sink_from_name__ = Some(map_.next_value()?);
2418 }
2419 GeneratedField::FormatDesc => {
2420 if format_desc__.is_some() {
2421 return Err(serde::de::Error::duplicate_field("formatDesc"));
2422 }
2423 format_desc__ = map_.next_value()?;
2424 }
2425 GeneratedField::SinkName => {
2426 if sink_name__.is_some() {
2427 return Err(serde::de::Error::duplicate_field("sinkName"));
2428 }
2429 sink_name__ = Some(map_.next_value()?);
2430 }
2431 }
2432 }
2433 Ok(SinkParam {
2434 sink_id: sink_id__.unwrap_or_default(),
2435 properties: properties__.unwrap_or_default(),
2436 table_schema: table_schema__,
2437 sink_type: sink_type__.unwrap_or_default(),
2438 db_name: db_name__.unwrap_or_default(),
2439 sink_from_name: sink_from_name__.unwrap_or_default(),
2440 format_desc: format_desc__,
2441 sink_name: sink_name__.unwrap_or_default(),
2442 })
2443 }
2444 }
2445 deserializer.deserialize_struct("connector_service.SinkParam", FIELDS, GeneratedVisitor)
2446 }
2447}
2448impl serde::Serialize for SinkWriterStreamRequest {
2449 #[allow(deprecated)]
2450 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2451 where
2452 S: serde::Serializer,
2453 {
2454 use serde::ser::SerializeStruct;
2455 let mut len = 0;
2456 if self.request.is_some() {
2457 len += 1;
2458 }
2459 let mut struct_ser = serializer.serialize_struct("connector_service.SinkWriterStreamRequest", len)?;
2460 if let Some(v) = self.request.as_ref() {
2461 match v {
2462 sink_writer_stream_request::Request::Start(v) => {
2463 struct_ser.serialize_field("start", v)?;
2464 }
2465 sink_writer_stream_request::Request::WriteBatch(v) => {
2466 struct_ser.serialize_field("writeBatch", v)?;
2467 }
2468 sink_writer_stream_request::Request::Barrier(v) => {
2469 struct_ser.serialize_field("barrier", v)?;
2470 }
2471 }
2472 }
2473 struct_ser.end()
2474 }
2475}
2476impl<'de> serde::Deserialize<'de> for SinkWriterStreamRequest {
2477 #[allow(deprecated)]
2478 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2479 where
2480 D: serde::Deserializer<'de>,
2481 {
2482 const FIELDS: &[&str] = &[
2483 "start",
2484 "write_batch",
2485 "writeBatch",
2486 "barrier",
2487 ];
2488
2489 #[allow(clippy::enum_variant_names)]
2490 enum GeneratedField {
2491 Start,
2492 WriteBatch,
2493 Barrier,
2494 }
2495 impl<'de> serde::Deserialize<'de> for GeneratedField {
2496 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
2497 where
2498 D: serde::Deserializer<'de>,
2499 {
2500 struct GeneratedVisitor;
2501
2502 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2503 type Value = GeneratedField;
2504
2505 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2506 write!(formatter, "expected one of: {:?}", &FIELDS)
2507 }
2508
2509 #[allow(unused_variables)]
2510 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
2511 where
2512 E: serde::de::Error,
2513 {
2514 match value {
2515 "start" => Ok(GeneratedField::Start),
2516 "writeBatch" | "write_batch" => Ok(GeneratedField::WriteBatch),
2517 "barrier" => Ok(GeneratedField::Barrier),
2518 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
2519 }
2520 }
2521 }
2522 deserializer.deserialize_identifier(GeneratedVisitor)
2523 }
2524 }
2525 struct GeneratedVisitor;
2526 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2527 type Value = SinkWriterStreamRequest;
2528
2529 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2530 formatter.write_str("struct connector_service.SinkWriterStreamRequest")
2531 }
2532
2533 fn visit_map<V>(self, mut map_: V) -> std::result::Result<SinkWriterStreamRequest, V::Error>
2534 where
2535 V: serde::de::MapAccess<'de>,
2536 {
2537 let mut request__ = None;
2538 while let Some(k) = map_.next_key()? {
2539 match k {
2540 GeneratedField::Start => {
2541 if request__.is_some() {
2542 return Err(serde::de::Error::duplicate_field("start"));
2543 }
2544 request__ = map_.next_value::<::std::option::Option<_>>()?.map(sink_writer_stream_request::Request::Start)
2545;
2546 }
2547 GeneratedField::WriteBatch => {
2548 if request__.is_some() {
2549 return Err(serde::de::Error::duplicate_field("writeBatch"));
2550 }
2551 request__ = map_.next_value::<::std::option::Option<_>>()?.map(sink_writer_stream_request::Request::WriteBatch)
2552;
2553 }
2554 GeneratedField::Barrier => {
2555 if request__.is_some() {
2556 return Err(serde::de::Error::duplicate_field("barrier"));
2557 }
2558 request__ = map_.next_value::<::std::option::Option<_>>()?.map(sink_writer_stream_request::Request::Barrier)
2559;
2560 }
2561 }
2562 }
2563 Ok(SinkWriterStreamRequest {
2564 request: request__,
2565 })
2566 }
2567 }
2568 deserializer.deserialize_struct("connector_service.SinkWriterStreamRequest", FIELDS, GeneratedVisitor)
2569 }
2570}
2571impl serde::Serialize for sink_writer_stream_request::Barrier {
2572 #[allow(deprecated)]
2573 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2574 where
2575 S: serde::Serializer,
2576 {
2577 use serde::ser::SerializeStruct;
2578 let mut len = 0;
2579 if self.epoch != 0 {
2580 len += 1;
2581 }
2582 if self.is_checkpoint {
2583 len += 1;
2584 }
2585 let mut struct_ser = serializer.serialize_struct("connector_service.SinkWriterStreamRequest.Barrier", len)?;
2586 if self.epoch != 0 {
2587 #[allow(clippy::needless_borrow)]
2588 #[allow(clippy::needless_borrows_for_generic_args)]
2589 struct_ser.serialize_field("epoch", ToString::to_string(&self.epoch).as_str())?;
2590 }
2591 if self.is_checkpoint {
2592 struct_ser.serialize_field("isCheckpoint", &self.is_checkpoint)?;
2593 }
2594 struct_ser.end()
2595 }
2596}
2597impl<'de> serde::Deserialize<'de> for sink_writer_stream_request::Barrier {
2598 #[allow(deprecated)]
2599 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2600 where
2601 D: serde::Deserializer<'de>,
2602 {
2603 const FIELDS: &[&str] = &[
2604 "epoch",
2605 "is_checkpoint",
2606 "isCheckpoint",
2607 ];
2608
2609 #[allow(clippy::enum_variant_names)]
2610 enum GeneratedField {
2611 Epoch,
2612 IsCheckpoint,
2613 }
2614 impl<'de> serde::Deserialize<'de> for GeneratedField {
2615 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
2616 where
2617 D: serde::Deserializer<'de>,
2618 {
2619 struct GeneratedVisitor;
2620
2621 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2622 type Value = GeneratedField;
2623
2624 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2625 write!(formatter, "expected one of: {:?}", &FIELDS)
2626 }
2627
2628 #[allow(unused_variables)]
2629 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
2630 where
2631 E: serde::de::Error,
2632 {
2633 match value {
2634 "epoch" => Ok(GeneratedField::Epoch),
2635 "isCheckpoint" | "is_checkpoint" => Ok(GeneratedField::IsCheckpoint),
2636 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
2637 }
2638 }
2639 }
2640 deserializer.deserialize_identifier(GeneratedVisitor)
2641 }
2642 }
2643 struct GeneratedVisitor;
2644 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2645 type Value = sink_writer_stream_request::Barrier;
2646
2647 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2648 formatter.write_str("struct connector_service.SinkWriterStreamRequest.Barrier")
2649 }
2650
2651 fn visit_map<V>(self, mut map_: V) -> std::result::Result<sink_writer_stream_request::Barrier, V::Error>
2652 where
2653 V: serde::de::MapAccess<'de>,
2654 {
2655 let mut epoch__ = None;
2656 let mut is_checkpoint__ = None;
2657 while let Some(k) = map_.next_key()? {
2658 match k {
2659 GeneratedField::Epoch => {
2660 if epoch__.is_some() {
2661 return Err(serde::de::Error::duplicate_field("epoch"));
2662 }
2663 epoch__ =
2664 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
2665 ;
2666 }
2667 GeneratedField::IsCheckpoint => {
2668 if is_checkpoint__.is_some() {
2669 return Err(serde::de::Error::duplicate_field("isCheckpoint"));
2670 }
2671 is_checkpoint__ = Some(map_.next_value()?);
2672 }
2673 }
2674 }
2675 Ok(sink_writer_stream_request::Barrier {
2676 epoch: epoch__.unwrap_or_default(),
2677 is_checkpoint: is_checkpoint__.unwrap_or_default(),
2678 })
2679 }
2680 }
2681 deserializer.deserialize_struct("connector_service.SinkWriterStreamRequest.Barrier", FIELDS, GeneratedVisitor)
2682 }
2683}
2684impl serde::Serialize for sink_writer_stream_request::StartSink {
2685 #[allow(deprecated)]
2686 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2687 where
2688 S: serde::Serializer,
2689 {
2690 use serde::ser::SerializeStruct;
2691 let mut len = 0;
2692 if self.sink_param.is_some() {
2693 len += 1;
2694 }
2695 if self.payload_schema.is_some() {
2696 len += 1;
2697 }
2698 let mut struct_ser = serializer.serialize_struct("connector_service.SinkWriterStreamRequest.StartSink", len)?;
2699 if let Some(v) = self.sink_param.as_ref() {
2700 struct_ser.serialize_field("sinkParam", v)?;
2701 }
2702 if let Some(v) = self.payload_schema.as_ref() {
2703 struct_ser.serialize_field("payloadSchema", v)?;
2704 }
2705 struct_ser.end()
2706 }
2707}
2708impl<'de> serde::Deserialize<'de> for sink_writer_stream_request::StartSink {
2709 #[allow(deprecated)]
2710 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2711 where
2712 D: serde::Deserializer<'de>,
2713 {
2714 const FIELDS: &[&str] = &[
2715 "sink_param",
2716 "sinkParam",
2717 "payload_schema",
2718 "payloadSchema",
2719 ];
2720
2721 #[allow(clippy::enum_variant_names)]
2722 enum GeneratedField {
2723 SinkParam,
2724 PayloadSchema,
2725 }
2726 impl<'de> serde::Deserialize<'de> for GeneratedField {
2727 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
2728 where
2729 D: serde::Deserializer<'de>,
2730 {
2731 struct GeneratedVisitor;
2732
2733 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2734 type Value = GeneratedField;
2735
2736 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2737 write!(formatter, "expected one of: {:?}", &FIELDS)
2738 }
2739
2740 #[allow(unused_variables)]
2741 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
2742 where
2743 E: serde::de::Error,
2744 {
2745 match value {
2746 "sinkParam" | "sink_param" => Ok(GeneratedField::SinkParam),
2747 "payloadSchema" | "payload_schema" => Ok(GeneratedField::PayloadSchema),
2748 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
2749 }
2750 }
2751 }
2752 deserializer.deserialize_identifier(GeneratedVisitor)
2753 }
2754 }
2755 struct GeneratedVisitor;
2756 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2757 type Value = sink_writer_stream_request::StartSink;
2758
2759 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2760 formatter.write_str("struct connector_service.SinkWriterStreamRequest.StartSink")
2761 }
2762
2763 fn visit_map<V>(self, mut map_: V) -> std::result::Result<sink_writer_stream_request::StartSink, V::Error>
2764 where
2765 V: serde::de::MapAccess<'de>,
2766 {
2767 let mut sink_param__ = None;
2768 let mut payload_schema__ = None;
2769 while let Some(k) = map_.next_key()? {
2770 match k {
2771 GeneratedField::SinkParam => {
2772 if sink_param__.is_some() {
2773 return Err(serde::de::Error::duplicate_field("sinkParam"));
2774 }
2775 sink_param__ = map_.next_value()?;
2776 }
2777 GeneratedField::PayloadSchema => {
2778 if payload_schema__.is_some() {
2779 return Err(serde::de::Error::duplicate_field("payloadSchema"));
2780 }
2781 payload_schema__ = map_.next_value()?;
2782 }
2783 }
2784 }
2785 Ok(sink_writer_stream_request::StartSink {
2786 sink_param: sink_param__,
2787 payload_schema: payload_schema__,
2788 })
2789 }
2790 }
2791 deserializer.deserialize_struct("connector_service.SinkWriterStreamRequest.StartSink", FIELDS, GeneratedVisitor)
2792 }
2793}
2794impl serde::Serialize for sink_writer_stream_request::WriteBatch {
2795 #[allow(deprecated)]
2796 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2797 where
2798 S: serde::Serializer,
2799 {
2800 use serde::ser::SerializeStruct;
2801 let mut len = 0;
2802 if self.batch_id != 0 {
2803 len += 1;
2804 }
2805 if self.epoch != 0 {
2806 len += 1;
2807 }
2808 if self.payload.is_some() {
2809 len += 1;
2810 }
2811 let mut struct_ser = serializer.serialize_struct("connector_service.SinkWriterStreamRequest.WriteBatch", len)?;
2812 if self.batch_id != 0 {
2813 #[allow(clippy::needless_borrow)]
2814 #[allow(clippy::needless_borrows_for_generic_args)]
2815 struct_ser.serialize_field("batchId", ToString::to_string(&self.batch_id).as_str())?;
2816 }
2817 if self.epoch != 0 {
2818 #[allow(clippy::needless_borrow)]
2819 #[allow(clippy::needless_borrows_for_generic_args)]
2820 struct_ser.serialize_field("epoch", ToString::to_string(&self.epoch).as_str())?;
2821 }
2822 if let Some(v) = self.payload.as_ref() {
2823 match v {
2824 sink_writer_stream_request::write_batch::Payload::StreamChunkPayload(v) => {
2825 struct_ser.serialize_field("streamChunkPayload", v)?;
2826 }
2827 sink_writer_stream_request::write_batch::Payload::StreamChunkRefPointer(v) => {
2828 #[allow(clippy::needless_borrow)]
2829 #[allow(clippy::needless_borrows_for_generic_args)]
2830 struct_ser.serialize_field("streamChunkRefPointer", ToString::to_string(&v).as_str())?;
2831 }
2832 }
2833 }
2834 struct_ser.end()
2835 }
2836}
2837impl<'de> serde::Deserialize<'de> for sink_writer_stream_request::WriteBatch {
2838 #[allow(deprecated)]
2839 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2840 where
2841 D: serde::Deserializer<'de>,
2842 {
2843 const FIELDS: &[&str] = &[
2844 "batch_id",
2845 "batchId",
2846 "epoch",
2847 "stream_chunk_payload",
2848 "streamChunkPayload",
2849 "stream_chunk_ref_pointer",
2850 "streamChunkRefPointer",
2851 ];
2852
2853 #[allow(clippy::enum_variant_names)]
2854 enum GeneratedField {
2855 BatchId,
2856 Epoch,
2857 StreamChunkPayload,
2858 StreamChunkRefPointer,
2859 }
2860 impl<'de> serde::Deserialize<'de> for GeneratedField {
2861 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
2862 where
2863 D: serde::Deserializer<'de>,
2864 {
2865 struct GeneratedVisitor;
2866
2867 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2868 type Value = GeneratedField;
2869
2870 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2871 write!(formatter, "expected one of: {:?}", &FIELDS)
2872 }
2873
2874 #[allow(unused_variables)]
2875 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
2876 where
2877 E: serde::de::Error,
2878 {
2879 match value {
2880 "batchId" | "batch_id" => Ok(GeneratedField::BatchId),
2881 "epoch" => Ok(GeneratedField::Epoch),
2882 "streamChunkPayload" | "stream_chunk_payload" => Ok(GeneratedField::StreamChunkPayload),
2883 "streamChunkRefPointer" | "stream_chunk_ref_pointer" => Ok(GeneratedField::StreamChunkRefPointer),
2884 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
2885 }
2886 }
2887 }
2888 deserializer.deserialize_identifier(GeneratedVisitor)
2889 }
2890 }
2891 struct GeneratedVisitor;
2892 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2893 type Value = sink_writer_stream_request::WriteBatch;
2894
2895 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2896 formatter.write_str("struct connector_service.SinkWriterStreamRequest.WriteBatch")
2897 }
2898
2899 fn visit_map<V>(self, mut map_: V) -> std::result::Result<sink_writer_stream_request::WriteBatch, V::Error>
2900 where
2901 V: serde::de::MapAccess<'de>,
2902 {
2903 let mut batch_id__ = None;
2904 let mut epoch__ = None;
2905 let mut payload__ = None;
2906 while let Some(k) = map_.next_key()? {
2907 match k {
2908 GeneratedField::BatchId => {
2909 if batch_id__.is_some() {
2910 return Err(serde::de::Error::duplicate_field("batchId"));
2911 }
2912 batch_id__ =
2913 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
2914 ;
2915 }
2916 GeneratedField::Epoch => {
2917 if epoch__.is_some() {
2918 return Err(serde::de::Error::duplicate_field("epoch"));
2919 }
2920 epoch__ =
2921 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
2922 ;
2923 }
2924 GeneratedField::StreamChunkPayload => {
2925 if payload__.is_some() {
2926 return Err(serde::de::Error::duplicate_field("streamChunkPayload"));
2927 }
2928 payload__ = map_.next_value::<::std::option::Option<_>>()?.map(sink_writer_stream_request::write_batch::Payload::StreamChunkPayload)
2929;
2930 }
2931 GeneratedField::StreamChunkRefPointer => {
2932 if payload__.is_some() {
2933 return Err(serde::de::Error::duplicate_field("streamChunkRefPointer"));
2934 }
2935 payload__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| sink_writer_stream_request::write_batch::Payload::StreamChunkRefPointer(x.0));
2936 }
2937 }
2938 }
2939 Ok(sink_writer_stream_request::WriteBatch {
2940 batch_id: batch_id__.unwrap_or_default(),
2941 epoch: epoch__.unwrap_or_default(),
2942 payload: payload__,
2943 })
2944 }
2945 }
2946 deserializer.deserialize_struct("connector_service.SinkWriterStreamRequest.WriteBatch", FIELDS, GeneratedVisitor)
2947 }
2948}
2949impl serde::Serialize for sink_writer_stream_request::write_batch::StreamChunkPayload {
2950 #[allow(deprecated)]
2951 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2952 where
2953 S: serde::Serializer,
2954 {
2955 use serde::ser::SerializeStruct;
2956 let mut len = 0;
2957 if !self.binary_data.is_empty() {
2958 len += 1;
2959 }
2960 let mut struct_ser = serializer.serialize_struct("connector_service.SinkWriterStreamRequest.WriteBatch.StreamChunkPayload", len)?;
2961 if !self.binary_data.is_empty() {
2962 #[allow(clippy::needless_borrow)]
2963 #[allow(clippy::needless_borrows_for_generic_args)]
2964 struct_ser.serialize_field("binaryData", pbjson::private::base64::encode(&self.binary_data).as_str())?;
2965 }
2966 struct_ser.end()
2967 }
2968}
2969impl<'de> serde::Deserialize<'de> for sink_writer_stream_request::write_batch::StreamChunkPayload {
2970 #[allow(deprecated)]
2971 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2972 where
2973 D: serde::Deserializer<'de>,
2974 {
2975 const FIELDS: &[&str] = &[
2976 "binary_data",
2977 "binaryData",
2978 ];
2979
2980 #[allow(clippy::enum_variant_names)]
2981 enum GeneratedField {
2982 BinaryData,
2983 }
2984 impl<'de> serde::Deserialize<'de> for GeneratedField {
2985 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
2986 where
2987 D: serde::Deserializer<'de>,
2988 {
2989 struct GeneratedVisitor;
2990
2991 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2992 type Value = GeneratedField;
2993
2994 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2995 write!(formatter, "expected one of: {:?}", &FIELDS)
2996 }
2997
2998 #[allow(unused_variables)]
2999 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
3000 where
3001 E: serde::de::Error,
3002 {
3003 match value {
3004 "binaryData" | "binary_data" => Ok(GeneratedField::BinaryData),
3005 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
3006 }
3007 }
3008 }
3009 deserializer.deserialize_identifier(GeneratedVisitor)
3010 }
3011 }
3012 struct GeneratedVisitor;
3013 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3014 type Value = sink_writer_stream_request::write_batch::StreamChunkPayload;
3015
3016 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3017 formatter.write_str("struct connector_service.SinkWriterStreamRequest.WriteBatch.StreamChunkPayload")
3018 }
3019
3020 fn visit_map<V>(self, mut map_: V) -> std::result::Result<sink_writer_stream_request::write_batch::StreamChunkPayload, V::Error>
3021 where
3022 V: serde::de::MapAccess<'de>,
3023 {
3024 let mut binary_data__ = None;
3025 while let Some(k) = map_.next_key()? {
3026 match k {
3027 GeneratedField::BinaryData => {
3028 if binary_data__.is_some() {
3029 return Err(serde::de::Error::duplicate_field("binaryData"));
3030 }
3031 binary_data__ =
3032 Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0)
3033 ;
3034 }
3035 }
3036 }
3037 Ok(sink_writer_stream_request::write_batch::StreamChunkPayload {
3038 binary_data: binary_data__.unwrap_or_default(),
3039 })
3040 }
3041 }
3042 deserializer.deserialize_struct("connector_service.SinkWriterStreamRequest.WriteBatch.StreamChunkPayload", FIELDS, GeneratedVisitor)
3043 }
3044}
3045impl serde::Serialize for SinkWriterStreamResponse {
3046 #[allow(deprecated)]
3047 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3048 where
3049 S: serde::Serializer,
3050 {
3051 use serde::ser::SerializeStruct;
3052 let mut len = 0;
3053 if self.response.is_some() {
3054 len += 1;
3055 }
3056 let mut struct_ser = serializer.serialize_struct("connector_service.SinkWriterStreamResponse", len)?;
3057 if let Some(v) = self.response.as_ref() {
3058 match v {
3059 sink_writer_stream_response::Response::Start(v) => {
3060 struct_ser.serialize_field("start", v)?;
3061 }
3062 sink_writer_stream_response::Response::Commit(v) => {
3063 struct_ser.serialize_field("commit", v)?;
3064 }
3065 sink_writer_stream_response::Response::Batch(v) => {
3066 struct_ser.serialize_field("batch", v)?;
3067 }
3068 }
3069 }
3070 struct_ser.end()
3071 }
3072}
3073impl<'de> serde::Deserialize<'de> for SinkWriterStreamResponse {
3074 #[allow(deprecated)]
3075 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3076 where
3077 D: serde::Deserializer<'de>,
3078 {
3079 const FIELDS: &[&str] = &[
3080 "start",
3081 "commit",
3082 "batch",
3083 ];
3084
3085 #[allow(clippy::enum_variant_names)]
3086 enum GeneratedField {
3087 Start,
3088 Commit,
3089 Batch,
3090 }
3091 impl<'de> serde::Deserialize<'de> for GeneratedField {
3092 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
3093 where
3094 D: serde::Deserializer<'de>,
3095 {
3096 struct GeneratedVisitor;
3097
3098 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3099 type Value = GeneratedField;
3100
3101 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3102 write!(formatter, "expected one of: {:?}", &FIELDS)
3103 }
3104
3105 #[allow(unused_variables)]
3106 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
3107 where
3108 E: serde::de::Error,
3109 {
3110 match value {
3111 "start" => Ok(GeneratedField::Start),
3112 "commit" => Ok(GeneratedField::Commit),
3113 "batch" => Ok(GeneratedField::Batch),
3114 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
3115 }
3116 }
3117 }
3118 deserializer.deserialize_identifier(GeneratedVisitor)
3119 }
3120 }
3121 struct GeneratedVisitor;
3122 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3123 type Value = SinkWriterStreamResponse;
3124
3125 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3126 formatter.write_str("struct connector_service.SinkWriterStreamResponse")
3127 }
3128
3129 fn visit_map<V>(self, mut map_: V) -> std::result::Result<SinkWriterStreamResponse, V::Error>
3130 where
3131 V: serde::de::MapAccess<'de>,
3132 {
3133 let mut response__ = None;
3134 while let Some(k) = map_.next_key()? {
3135 match k {
3136 GeneratedField::Start => {
3137 if response__.is_some() {
3138 return Err(serde::de::Error::duplicate_field("start"));
3139 }
3140 response__ = map_.next_value::<::std::option::Option<_>>()?.map(sink_writer_stream_response::Response::Start)
3141;
3142 }
3143 GeneratedField::Commit => {
3144 if response__.is_some() {
3145 return Err(serde::de::Error::duplicate_field("commit"));
3146 }
3147 response__ = map_.next_value::<::std::option::Option<_>>()?.map(sink_writer_stream_response::Response::Commit)
3148;
3149 }
3150 GeneratedField::Batch => {
3151 if response__.is_some() {
3152 return Err(serde::de::Error::duplicate_field("batch"));
3153 }
3154 response__ = map_.next_value::<::std::option::Option<_>>()?.map(sink_writer_stream_response::Response::Batch)
3155;
3156 }
3157 }
3158 }
3159 Ok(SinkWriterStreamResponse {
3160 response: response__,
3161 })
3162 }
3163 }
3164 deserializer.deserialize_struct("connector_service.SinkWriterStreamResponse", FIELDS, GeneratedVisitor)
3165 }
3166}
3167impl serde::Serialize for sink_writer_stream_response::BatchWrittenResponse {
3168 #[allow(deprecated)]
3169 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3170 where
3171 S: serde::Serializer,
3172 {
3173 use serde::ser::SerializeStruct;
3174 let mut len = 0;
3175 if self.epoch != 0 {
3176 len += 1;
3177 }
3178 if self.batch_id != 0 {
3179 len += 1;
3180 }
3181 let mut struct_ser = serializer.serialize_struct("connector_service.SinkWriterStreamResponse.BatchWrittenResponse", len)?;
3182 if self.epoch != 0 {
3183 #[allow(clippy::needless_borrow)]
3184 #[allow(clippy::needless_borrows_for_generic_args)]
3185 struct_ser.serialize_field("epoch", ToString::to_string(&self.epoch).as_str())?;
3186 }
3187 if self.batch_id != 0 {
3188 #[allow(clippy::needless_borrow)]
3189 #[allow(clippy::needless_borrows_for_generic_args)]
3190 struct_ser.serialize_field("batchId", ToString::to_string(&self.batch_id).as_str())?;
3191 }
3192 struct_ser.end()
3193 }
3194}
3195impl<'de> serde::Deserialize<'de> for sink_writer_stream_response::BatchWrittenResponse {
3196 #[allow(deprecated)]
3197 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3198 where
3199 D: serde::Deserializer<'de>,
3200 {
3201 const FIELDS: &[&str] = &[
3202 "epoch",
3203 "batch_id",
3204 "batchId",
3205 ];
3206
3207 #[allow(clippy::enum_variant_names)]
3208 enum GeneratedField {
3209 Epoch,
3210 BatchId,
3211 }
3212 impl<'de> serde::Deserialize<'de> for GeneratedField {
3213 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
3214 where
3215 D: serde::Deserializer<'de>,
3216 {
3217 struct GeneratedVisitor;
3218
3219 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3220 type Value = GeneratedField;
3221
3222 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3223 write!(formatter, "expected one of: {:?}", &FIELDS)
3224 }
3225
3226 #[allow(unused_variables)]
3227 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
3228 where
3229 E: serde::de::Error,
3230 {
3231 match value {
3232 "epoch" => Ok(GeneratedField::Epoch),
3233 "batchId" | "batch_id" => Ok(GeneratedField::BatchId),
3234 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
3235 }
3236 }
3237 }
3238 deserializer.deserialize_identifier(GeneratedVisitor)
3239 }
3240 }
3241 struct GeneratedVisitor;
3242 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3243 type Value = sink_writer_stream_response::BatchWrittenResponse;
3244
3245 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3246 formatter.write_str("struct connector_service.SinkWriterStreamResponse.BatchWrittenResponse")
3247 }
3248
3249 fn visit_map<V>(self, mut map_: V) -> std::result::Result<sink_writer_stream_response::BatchWrittenResponse, V::Error>
3250 where
3251 V: serde::de::MapAccess<'de>,
3252 {
3253 let mut epoch__ = None;
3254 let mut batch_id__ = None;
3255 while let Some(k) = map_.next_key()? {
3256 match k {
3257 GeneratedField::Epoch => {
3258 if epoch__.is_some() {
3259 return Err(serde::de::Error::duplicate_field("epoch"));
3260 }
3261 epoch__ =
3262 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
3263 ;
3264 }
3265 GeneratedField::BatchId => {
3266 if batch_id__.is_some() {
3267 return Err(serde::de::Error::duplicate_field("batchId"));
3268 }
3269 batch_id__ =
3270 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
3271 ;
3272 }
3273 }
3274 }
3275 Ok(sink_writer_stream_response::BatchWrittenResponse {
3276 epoch: epoch__.unwrap_or_default(),
3277 batch_id: batch_id__.unwrap_or_default(),
3278 })
3279 }
3280 }
3281 deserializer.deserialize_struct("connector_service.SinkWriterStreamResponse.BatchWrittenResponse", FIELDS, GeneratedVisitor)
3282 }
3283}
3284impl serde::Serialize for sink_writer_stream_response::CommitResponse {
3285 #[allow(deprecated)]
3286 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3287 where
3288 S: serde::Serializer,
3289 {
3290 use serde::ser::SerializeStruct;
3291 let mut len = 0;
3292 if self.epoch != 0 {
3293 len += 1;
3294 }
3295 if self.metadata.is_some() {
3296 len += 1;
3297 }
3298 let mut struct_ser = serializer.serialize_struct("connector_service.SinkWriterStreamResponse.CommitResponse", len)?;
3299 if self.epoch != 0 {
3300 #[allow(clippy::needless_borrow)]
3301 #[allow(clippy::needless_borrows_for_generic_args)]
3302 struct_ser.serialize_field("epoch", ToString::to_string(&self.epoch).as_str())?;
3303 }
3304 if let Some(v) = self.metadata.as_ref() {
3305 struct_ser.serialize_field("metadata", v)?;
3306 }
3307 struct_ser.end()
3308 }
3309}
3310impl<'de> serde::Deserialize<'de> for sink_writer_stream_response::CommitResponse {
3311 #[allow(deprecated)]
3312 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3313 where
3314 D: serde::Deserializer<'de>,
3315 {
3316 const FIELDS: &[&str] = &[
3317 "epoch",
3318 "metadata",
3319 ];
3320
3321 #[allow(clippy::enum_variant_names)]
3322 enum GeneratedField {
3323 Epoch,
3324 Metadata,
3325 }
3326 impl<'de> serde::Deserialize<'de> for GeneratedField {
3327 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
3328 where
3329 D: serde::Deserializer<'de>,
3330 {
3331 struct GeneratedVisitor;
3332
3333 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3334 type Value = GeneratedField;
3335
3336 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3337 write!(formatter, "expected one of: {:?}", &FIELDS)
3338 }
3339
3340 #[allow(unused_variables)]
3341 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
3342 where
3343 E: serde::de::Error,
3344 {
3345 match value {
3346 "epoch" => Ok(GeneratedField::Epoch),
3347 "metadata" => Ok(GeneratedField::Metadata),
3348 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
3349 }
3350 }
3351 }
3352 deserializer.deserialize_identifier(GeneratedVisitor)
3353 }
3354 }
3355 struct GeneratedVisitor;
3356 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3357 type Value = sink_writer_stream_response::CommitResponse;
3358
3359 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3360 formatter.write_str("struct connector_service.SinkWriterStreamResponse.CommitResponse")
3361 }
3362
3363 fn visit_map<V>(self, mut map_: V) -> std::result::Result<sink_writer_stream_response::CommitResponse, V::Error>
3364 where
3365 V: serde::de::MapAccess<'de>,
3366 {
3367 let mut epoch__ = None;
3368 let mut metadata__ = None;
3369 while let Some(k) = map_.next_key()? {
3370 match k {
3371 GeneratedField::Epoch => {
3372 if epoch__.is_some() {
3373 return Err(serde::de::Error::duplicate_field("epoch"));
3374 }
3375 epoch__ =
3376 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
3377 ;
3378 }
3379 GeneratedField::Metadata => {
3380 if metadata__.is_some() {
3381 return Err(serde::de::Error::duplicate_field("metadata"));
3382 }
3383 metadata__ = map_.next_value()?;
3384 }
3385 }
3386 }
3387 Ok(sink_writer_stream_response::CommitResponse {
3388 epoch: epoch__.unwrap_or_default(),
3389 metadata: metadata__,
3390 })
3391 }
3392 }
3393 deserializer.deserialize_struct("connector_service.SinkWriterStreamResponse.CommitResponse", FIELDS, GeneratedVisitor)
3394 }
3395}
3396impl serde::Serialize for sink_writer_stream_response::StartResponse {
3397 #[allow(deprecated)]
3398 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3399 where
3400 S: serde::Serializer,
3401 {
3402 use serde::ser::SerializeStruct;
3403 let len = 0;
3404 let struct_ser = serializer.serialize_struct("connector_service.SinkWriterStreamResponse.StartResponse", len)?;
3405 struct_ser.end()
3406 }
3407}
3408impl<'de> serde::Deserialize<'de> for sink_writer_stream_response::StartResponse {
3409 #[allow(deprecated)]
3410 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3411 where
3412 D: serde::Deserializer<'de>,
3413 {
3414 const FIELDS: &[&str] = &[
3415 ];
3416
3417 #[allow(clippy::enum_variant_names)]
3418 enum GeneratedField {
3419 }
3420 impl<'de> serde::Deserialize<'de> for GeneratedField {
3421 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
3422 where
3423 D: serde::Deserializer<'de>,
3424 {
3425 struct GeneratedVisitor;
3426
3427 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3428 type Value = GeneratedField;
3429
3430 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3431 write!(formatter, "expected one of: {:?}", &FIELDS)
3432 }
3433
3434 #[allow(unused_variables)]
3435 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
3436 where
3437 E: serde::de::Error,
3438 {
3439 Err(serde::de::Error::unknown_field(value, FIELDS))
3440 }
3441 }
3442 deserializer.deserialize_identifier(GeneratedVisitor)
3443 }
3444 }
3445 struct GeneratedVisitor;
3446 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3447 type Value = sink_writer_stream_response::StartResponse;
3448
3449 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3450 formatter.write_str("struct connector_service.SinkWriterStreamResponse.StartResponse")
3451 }
3452
3453 fn visit_map<V>(self, mut map_: V) -> std::result::Result<sink_writer_stream_response::StartResponse, V::Error>
3454 where
3455 V: serde::de::MapAccess<'de>,
3456 {
3457 while map_.next_key::<GeneratedField>()?.is_some() {
3458 let _ = map_.next_value::<serde::de::IgnoredAny>()?;
3459 }
3460 Ok(sink_writer_stream_response::StartResponse {
3461 })
3462 }
3463 }
3464 deserializer.deserialize_struct("connector_service.SinkWriterStreamResponse.StartResponse", FIELDS, GeneratedVisitor)
3465 }
3466}
3467impl serde::Serialize for SourceType {
3468 #[allow(deprecated)]
3469 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3470 where
3471 S: serde::Serializer,
3472 {
3473 let variant = match self {
3474 Self::Unspecified => "UNSPECIFIED",
3475 Self::Mysql => "MYSQL",
3476 Self::Postgres => "POSTGRES",
3477 Self::Citus => "CITUS",
3478 Self::Mongodb => "MONGODB",
3479 Self::SqlServer => "SQL_SERVER",
3480 };
3481 serializer.serialize_str(variant)
3482 }
3483}
3484impl<'de> serde::Deserialize<'de> for SourceType {
3485 #[allow(deprecated)]
3486 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3487 where
3488 D: serde::Deserializer<'de>,
3489 {
3490 const FIELDS: &[&str] = &[
3491 "UNSPECIFIED",
3492 "MYSQL",
3493 "POSTGRES",
3494 "CITUS",
3495 "MONGODB",
3496 "SQL_SERVER",
3497 ];
3498
3499 struct GeneratedVisitor;
3500
3501 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3502 type Value = SourceType;
3503
3504 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3505 write!(formatter, "expected one of: {:?}", &FIELDS)
3506 }
3507
3508 fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
3509 where
3510 E: serde::de::Error,
3511 {
3512 i32::try_from(v)
3513 .ok()
3514 .and_then(|x| x.try_into().ok())
3515 .ok_or_else(|| {
3516 serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
3517 })
3518 }
3519
3520 fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
3521 where
3522 E: serde::de::Error,
3523 {
3524 i32::try_from(v)
3525 .ok()
3526 .and_then(|x| x.try_into().ok())
3527 .ok_or_else(|| {
3528 serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
3529 })
3530 }
3531
3532 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3533 where
3534 E: serde::de::Error,
3535 {
3536 match value {
3537 "UNSPECIFIED" => Ok(SourceType::Unspecified),
3538 "MYSQL" => Ok(SourceType::Mysql),
3539 "POSTGRES" => Ok(SourceType::Postgres),
3540 "CITUS" => Ok(SourceType::Citus),
3541 "MONGODB" => Ok(SourceType::Mongodb),
3542 "SQL_SERVER" => Ok(SourceType::SqlServer),
3543 _ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
3544 }
3545 }
3546 }
3547 deserializer.deserialize_any(GeneratedVisitor)
3548 }
3549}
3550impl serde::Serialize for TableSchema {
3551 #[allow(deprecated)]
3552 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3553 where
3554 S: serde::Serializer,
3555 {
3556 use serde::ser::SerializeStruct;
3557 let mut len = 0;
3558 if !self.columns.is_empty() {
3559 len += 1;
3560 }
3561 if !self.pk_indices.is_empty() {
3562 len += 1;
3563 }
3564 let mut struct_ser = serializer.serialize_struct("connector_service.TableSchema", len)?;
3565 if !self.columns.is_empty() {
3566 struct_ser.serialize_field("columns", &self.columns)?;
3567 }
3568 if !self.pk_indices.is_empty() {
3569 struct_ser.serialize_field("pkIndices", &self.pk_indices)?;
3570 }
3571 struct_ser.end()
3572 }
3573}
3574impl<'de> serde::Deserialize<'de> for TableSchema {
3575 #[allow(deprecated)]
3576 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3577 where
3578 D: serde::Deserializer<'de>,
3579 {
3580 const FIELDS: &[&str] = &[
3581 "columns",
3582 "pk_indices",
3583 "pkIndices",
3584 ];
3585
3586 #[allow(clippy::enum_variant_names)]
3587 enum GeneratedField {
3588 Columns,
3589 PkIndices,
3590 }
3591 impl<'de> serde::Deserialize<'de> for GeneratedField {
3592 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
3593 where
3594 D: serde::Deserializer<'de>,
3595 {
3596 struct GeneratedVisitor;
3597
3598 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3599 type Value = GeneratedField;
3600
3601 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3602 write!(formatter, "expected one of: {:?}", &FIELDS)
3603 }
3604
3605 #[allow(unused_variables)]
3606 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
3607 where
3608 E: serde::de::Error,
3609 {
3610 match value {
3611 "columns" => Ok(GeneratedField::Columns),
3612 "pkIndices" | "pk_indices" => Ok(GeneratedField::PkIndices),
3613 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
3614 }
3615 }
3616 }
3617 deserializer.deserialize_identifier(GeneratedVisitor)
3618 }
3619 }
3620 struct GeneratedVisitor;
3621 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3622 type Value = TableSchema;
3623
3624 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3625 formatter.write_str("struct connector_service.TableSchema")
3626 }
3627
3628 fn visit_map<V>(self, mut map_: V) -> std::result::Result<TableSchema, V::Error>
3629 where
3630 V: serde::de::MapAccess<'de>,
3631 {
3632 let mut columns__ = None;
3633 let mut pk_indices__ = None;
3634 while let Some(k) = map_.next_key()? {
3635 match k {
3636 GeneratedField::Columns => {
3637 if columns__.is_some() {
3638 return Err(serde::de::Error::duplicate_field("columns"));
3639 }
3640 columns__ = Some(map_.next_value()?);
3641 }
3642 GeneratedField::PkIndices => {
3643 if pk_indices__.is_some() {
3644 return Err(serde::de::Error::duplicate_field("pkIndices"));
3645 }
3646 pk_indices__ =
3647 Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
3648 .into_iter().map(|x| x.0).collect())
3649 ;
3650 }
3651 }
3652 }
3653 Ok(TableSchema {
3654 columns: columns__.unwrap_or_default(),
3655 pk_indices: pk_indices__.unwrap_or_default(),
3656 })
3657 }
3658 }
3659 deserializer.deserialize_struct("connector_service.TableSchema", FIELDS, GeneratedVisitor)
3660 }
3661}
3662impl serde::Serialize for ValidateSinkRequest {
3663 #[allow(deprecated)]
3664 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3665 where
3666 S: serde::Serializer,
3667 {
3668 use serde::ser::SerializeStruct;
3669 let mut len = 0;
3670 if self.sink_param.is_some() {
3671 len += 1;
3672 }
3673 let mut struct_ser = serializer.serialize_struct("connector_service.ValidateSinkRequest", len)?;
3674 if let Some(v) = self.sink_param.as_ref() {
3675 struct_ser.serialize_field("sinkParam", v)?;
3676 }
3677 struct_ser.end()
3678 }
3679}
3680impl<'de> serde::Deserialize<'de> for ValidateSinkRequest {
3681 #[allow(deprecated)]
3682 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3683 where
3684 D: serde::Deserializer<'de>,
3685 {
3686 const FIELDS: &[&str] = &[
3687 "sink_param",
3688 "sinkParam",
3689 ];
3690
3691 #[allow(clippy::enum_variant_names)]
3692 enum GeneratedField {
3693 SinkParam,
3694 }
3695 impl<'de> serde::Deserialize<'de> for GeneratedField {
3696 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
3697 where
3698 D: serde::Deserializer<'de>,
3699 {
3700 struct GeneratedVisitor;
3701
3702 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3703 type Value = GeneratedField;
3704
3705 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3706 write!(formatter, "expected one of: {:?}", &FIELDS)
3707 }
3708
3709 #[allow(unused_variables)]
3710 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
3711 where
3712 E: serde::de::Error,
3713 {
3714 match value {
3715 "sinkParam" | "sink_param" => Ok(GeneratedField::SinkParam),
3716 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
3717 }
3718 }
3719 }
3720 deserializer.deserialize_identifier(GeneratedVisitor)
3721 }
3722 }
3723 struct GeneratedVisitor;
3724 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3725 type Value = ValidateSinkRequest;
3726
3727 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3728 formatter.write_str("struct connector_service.ValidateSinkRequest")
3729 }
3730
3731 fn visit_map<V>(self, mut map_: V) -> std::result::Result<ValidateSinkRequest, V::Error>
3732 where
3733 V: serde::de::MapAccess<'de>,
3734 {
3735 let mut sink_param__ = None;
3736 while let Some(k) = map_.next_key()? {
3737 match k {
3738 GeneratedField::SinkParam => {
3739 if sink_param__.is_some() {
3740 return Err(serde::de::Error::duplicate_field("sinkParam"));
3741 }
3742 sink_param__ = map_.next_value()?;
3743 }
3744 }
3745 }
3746 Ok(ValidateSinkRequest {
3747 sink_param: sink_param__,
3748 })
3749 }
3750 }
3751 deserializer.deserialize_struct("connector_service.ValidateSinkRequest", FIELDS, GeneratedVisitor)
3752 }
3753}
3754impl serde::Serialize for ValidateSinkResponse {
3755 #[allow(deprecated)]
3756 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3757 where
3758 S: serde::Serializer,
3759 {
3760 use serde::ser::SerializeStruct;
3761 let mut len = 0;
3762 if self.error.is_some() {
3763 len += 1;
3764 }
3765 let mut struct_ser = serializer.serialize_struct("connector_service.ValidateSinkResponse", len)?;
3766 if let Some(v) = self.error.as_ref() {
3767 struct_ser.serialize_field("error", v)?;
3768 }
3769 struct_ser.end()
3770 }
3771}
3772impl<'de> serde::Deserialize<'de> for ValidateSinkResponse {
3773 #[allow(deprecated)]
3774 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3775 where
3776 D: serde::Deserializer<'de>,
3777 {
3778 const FIELDS: &[&str] = &[
3779 "error",
3780 ];
3781
3782 #[allow(clippy::enum_variant_names)]
3783 enum GeneratedField {
3784 Error,
3785 }
3786 impl<'de> serde::Deserialize<'de> for GeneratedField {
3787 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
3788 where
3789 D: serde::Deserializer<'de>,
3790 {
3791 struct GeneratedVisitor;
3792
3793 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3794 type Value = GeneratedField;
3795
3796 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3797 write!(formatter, "expected one of: {:?}", &FIELDS)
3798 }
3799
3800 #[allow(unused_variables)]
3801 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
3802 where
3803 E: serde::de::Error,
3804 {
3805 match value {
3806 "error" => Ok(GeneratedField::Error),
3807 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
3808 }
3809 }
3810 }
3811 deserializer.deserialize_identifier(GeneratedVisitor)
3812 }
3813 }
3814 struct GeneratedVisitor;
3815 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3816 type Value = ValidateSinkResponse;
3817
3818 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3819 formatter.write_str("struct connector_service.ValidateSinkResponse")
3820 }
3821
3822 fn visit_map<V>(self, mut map_: V) -> std::result::Result<ValidateSinkResponse, V::Error>
3823 where
3824 V: serde::de::MapAccess<'de>,
3825 {
3826 let mut error__ = None;
3827 while let Some(k) = map_.next_key()? {
3828 match k {
3829 GeneratedField::Error => {
3830 if error__.is_some() {
3831 return Err(serde::de::Error::duplicate_field("error"));
3832 }
3833 error__ = map_.next_value()?;
3834 }
3835 }
3836 }
3837 Ok(ValidateSinkResponse {
3838 error: error__,
3839 })
3840 }
3841 }
3842 deserializer.deserialize_struct("connector_service.ValidateSinkResponse", FIELDS, GeneratedVisitor)
3843 }
3844}
3845impl serde::Serialize for ValidateSourceRequest {
3846 #[allow(deprecated)]
3847 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3848 where
3849 S: serde::Serializer,
3850 {
3851 use serde::ser::SerializeStruct;
3852 let mut len = 0;
3853 if self.source_id != 0 {
3854 len += 1;
3855 }
3856 if self.source_type != 0 {
3857 len += 1;
3858 }
3859 if !self.properties.is_empty() {
3860 len += 1;
3861 }
3862 if self.table_schema.is_some() {
3863 len += 1;
3864 }
3865 if self.is_source_job {
3866 len += 1;
3867 }
3868 if self.is_backfill_table {
3869 len += 1;
3870 }
3871 let mut struct_ser = serializer.serialize_struct("connector_service.ValidateSourceRequest", len)?;
3872 if self.source_id != 0 {
3873 #[allow(clippy::needless_borrow)]
3874 #[allow(clippy::needless_borrows_for_generic_args)]
3875 struct_ser.serialize_field("sourceId", ToString::to_string(&self.source_id).as_str())?;
3876 }
3877 if self.source_type != 0 {
3878 let v = SourceType::try_from(self.source_type)
3879 .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.source_type)))?;
3880 struct_ser.serialize_field("sourceType", &v)?;
3881 }
3882 if !self.properties.is_empty() {
3883 struct_ser.serialize_field("properties", &self.properties)?;
3884 }
3885 if let Some(v) = self.table_schema.as_ref() {
3886 struct_ser.serialize_field("tableSchema", v)?;
3887 }
3888 if self.is_source_job {
3889 struct_ser.serialize_field("isSourceJob", &self.is_source_job)?;
3890 }
3891 if self.is_backfill_table {
3892 struct_ser.serialize_field("isBackfillTable", &self.is_backfill_table)?;
3893 }
3894 struct_ser.end()
3895 }
3896}
3897impl<'de> serde::Deserialize<'de> for ValidateSourceRequest {
3898 #[allow(deprecated)]
3899 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3900 where
3901 D: serde::Deserializer<'de>,
3902 {
3903 const FIELDS: &[&str] = &[
3904 "source_id",
3905 "sourceId",
3906 "source_type",
3907 "sourceType",
3908 "properties",
3909 "table_schema",
3910 "tableSchema",
3911 "is_source_job",
3912 "isSourceJob",
3913 "is_backfill_table",
3914 "isBackfillTable",
3915 ];
3916
3917 #[allow(clippy::enum_variant_names)]
3918 enum GeneratedField {
3919 SourceId,
3920 SourceType,
3921 Properties,
3922 TableSchema,
3923 IsSourceJob,
3924 IsBackfillTable,
3925 }
3926 impl<'de> serde::Deserialize<'de> for GeneratedField {
3927 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
3928 where
3929 D: serde::Deserializer<'de>,
3930 {
3931 struct GeneratedVisitor;
3932
3933 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3934 type Value = GeneratedField;
3935
3936 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3937 write!(formatter, "expected one of: {:?}", &FIELDS)
3938 }
3939
3940 #[allow(unused_variables)]
3941 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
3942 where
3943 E: serde::de::Error,
3944 {
3945 match value {
3946 "sourceId" | "source_id" => Ok(GeneratedField::SourceId),
3947 "sourceType" | "source_type" => Ok(GeneratedField::SourceType),
3948 "properties" => Ok(GeneratedField::Properties),
3949 "tableSchema" | "table_schema" => Ok(GeneratedField::TableSchema),
3950 "isSourceJob" | "is_source_job" => Ok(GeneratedField::IsSourceJob),
3951 "isBackfillTable" | "is_backfill_table" => Ok(GeneratedField::IsBackfillTable),
3952 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
3953 }
3954 }
3955 }
3956 deserializer.deserialize_identifier(GeneratedVisitor)
3957 }
3958 }
3959 struct GeneratedVisitor;
3960 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3961 type Value = ValidateSourceRequest;
3962
3963 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3964 formatter.write_str("struct connector_service.ValidateSourceRequest")
3965 }
3966
3967 fn visit_map<V>(self, mut map_: V) -> std::result::Result<ValidateSourceRequest, V::Error>
3968 where
3969 V: serde::de::MapAccess<'de>,
3970 {
3971 let mut source_id__ = None;
3972 let mut source_type__ = None;
3973 let mut properties__ = None;
3974 let mut table_schema__ = None;
3975 let mut is_source_job__ = None;
3976 let mut is_backfill_table__ = None;
3977 while let Some(k) = map_.next_key()? {
3978 match k {
3979 GeneratedField::SourceId => {
3980 if source_id__.is_some() {
3981 return Err(serde::de::Error::duplicate_field("sourceId"));
3982 }
3983 source_id__ =
3984 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
3985 ;
3986 }
3987 GeneratedField::SourceType => {
3988 if source_type__.is_some() {
3989 return Err(serde::de::Error::duplicate_field("sourceType"));
3990 }
3991 source_type__ = Some(map_.next_value::<SourceType>()? as i32);
3992 }
3993 GeneratedField::Properties => {
3994 if properties__.is_some() {
3995 return Err(serde::de::Error::duplicate_field("properties"));
3996 }
3997 properties__ = Some(
3998 map_.next_value::<std::collections::BTreeMap<_, _>>()?
3999 );
4000 }
4001 GeneratedField::TableSchema => {
4002 if table_schema__.is_some() {
4003 return Err(serde::de::Error::duplicate_field("tableSchema"));
4004 }
4005 table_schema__ = map_.next_value()?;
4006 }
4007 GeneratedField::IsSourceJob => {
4008 if is_source_job__.is_some() {
4009 return Err(serde::de::Error::duplicate_field("isSourceJob"));
4010 }
4011 is_source_job__ = Some(map_.next_value()?);
4012 }
4013 GeneratedField::IsBackfillTable => {
4014 if is_backfill_table__.is_some() {
4015 return Err(serde::de::Error::duplicate_field("isBackfillTable"));
4016 }
4017 is_backfill_table__ = Some(map_.next_value()?);
4018 }
4019 }
4020 }
4021 Ok(ValidateSourceRequest {
4022 source_id: source_id__.unwrap_or_default(),
4023 source_type: source_type__.unwrap_or_default(),
4024 properties: properties__.unwrap_or_default(),
4025 table_schema: table_schema__,
4026 is_source_job: is_source_job__.unwrap_or_default(),
4027 is_backfill_table: is_backfill_table__.unwrap_or_default(),
4028 })
4029 }
4030 }
4031 deserializer.deserialize_struct("connector_service.ValidateSourceRequest", FIELDS, GeneratedVisitor)
4032 }
4033}
4034impl serde::Serialize for ValidateSourceResponse {
4035 #[allow(deprecated)]
4036 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4037 where
4038 S: serde::Serializer,
4039 {
4040 use serde::ser::SerializeStruct;
4041 let mut len = 0;
4042 if self.error.is_some() {
4043 len += 1;
4044 }
4045 let mut struct_ser = serializer.serialize_struct("connector_service.ValidateSourceResponse", len)?;
4046 if let Some(v) = self.error.as_ref() {
4047 struct_ser.serialize_field("error", v)?;
4048 }
4049 struct_ser.end()
4050 }
4051}
4052impl<'de> serde::Deserialize<'de> for ValidateSourceResponse {
4053 #[allow(deprecated)]
4054 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4055 where
4056 D: serde::Deserializer<'de>,
4057 {
4058 const FIELDS: &[&str] = &[
4059 "error",
4060 ];
4061
4062 #[allow(clippy::enum_variant_names)]
4063 enum GeneratedField {
4064 Error,
4065 }
4066 impl<'de> serde::Deserialize<'de> for GeneratedField {
4067 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
4068 where
4069 D: serde::Deserializer<'de>,
4070 {
4071 struct GeneratedVisitor;
4072
4073 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
4074 type Value = GeneratedField;
4075
4076 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4077 write!(formatter, "expected one of: {:?}", &FIELDS)
4078 }
4079
4080 #[allow(unused_variables)]
4081 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
4082 where
4083 E: serde::de::Error,
4084 {
4085 match value {
4086 "error" => Ok(GeneratedField::Error),
4087 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
4088 }
4089 }
4090 }
4091 deserializer.deserialize_identifier(GeneratedVisitor)
4092 }
4093 }
4094 struct GeneratedVisitor;
4095 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
4096 type Value = ValidateSourceResponse;
4097
4098 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4099 formatter.write_str("struct connector_service.ValidateSourceResponse")
4100 }
4101
4102 fn visit_map<V>(self, mut map_: V) -> std::result::Result<ValidateSourceResponse, V::Error>
4103 where
4104 V: serde::de::MapAccess<'de>,
4105 {
4106 let mut error__ = None;
4107 while let Some(k) = map_.next_key()? {
4108 match k {
4109 GeneratedField::Error => {
4110 if error__.is_some() {
4111 return Err(serde::de::Error::duplicate_field("error"));
4112 }
4113 error__ = map_.next_value()?;
4114 }
4115 }
4116 }
4117 Ok(ValidateSourceResponse {
4118 error: error__,
4119 })
4120 }
4121 }
4122 deserializer.deserialize_struct("connector_service.ValidateSourceResponse", FIELDS, GeneratedVisitor)
4123 }
4124}
4125impl serde::Serialize for ValidationError {
4126 #[allow(deprecated)]
4127 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4128 where
4129 S: serde::Serializer,
4130 {
4131 use serde::ser::SerializeStruct;
4132 let mut len = 0;
4133 if !self.error_message.is_empty() {
4134 len += 1;
4135 }
4136 let mut struct_ser = serializer.serialize_struct("connector_service.ValidationError", len)?;
4137 if !self.error_message.is_empty() {
4138 struct_ser.serialize_field("errorMessage", &self.error_message)?;
4139 }
4140 struct_ser.end()
4141 }
4142}
4143impl<'de> serde::Deserialize<'de> for ValidationError {
4144 #[allow(deprecated)]
4145 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4146 where
4147 D: serde::Deserializer<'de>,
4148 {
4149 const FIELDS: &[&str] = &[
4150 "error_message",
4151 "errorMessage",
4152 ];
4153
4154 #[allow(clippy::enum_variant_names)]
4155 enum GeneratedField {
4156 ErrorMessage,
4157 }
4158 impl<'de> serde::Deserialize<'de> for GeneratedField {
4159 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
4160 where
4161 D: serde::Deserializer<'de>,
4162 {
4163 struct GeneratedVisitor;
4164
4165 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
4166 type Value = GeneratedField;
4167
4168 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4169 write!(formatter, "expected one of: {:?}", &FIELDS)
4170 }
4171
4172 #[allow(unused_variables)]
4173 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
4174 where
4175 E: serde::de::Error,
4176 {
4177 match value {
4178 "errorMessage" | "error_message" => Ok(GeneratedField::ErrorMessage),
4179 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
4180 }
4181 }
4182 }
4183 deserializer.deserialize_identifier(GeneratedVisitor)
4184 }
4185 }
4186 struct GeneratedVisitor;
4187 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
4188 type Value = ValidationError;
4189
4190 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4191 formatter.write_str("struct connector_service.ValidationError")
4192 }
4193
4194 fn visit_map<V>(self, mut map_: V) -> std::result::Result<ValidationError, V::Error>
4195 where
4196 V: serde::de::MapAccess<'de>,
4197 {
4198 let mut error_message__ = None;
4199 while let Some(k) = map_.next_key()? {
4200 match k {
4201 GeneratedField::ErrorMessage => {
4202 if error_message__.is_some() {
4203 return Err(serde::de::Error::duplicate_field("errorMessage"));
4204 }
4205 error_message__ = Some(map_.next_value()?);
4206 }
4207 }
4208 }
4209 Ok(ValidationError {
4210 error_message: error_message__.unwrap_or_default(),
4211 })
4212 }
4213 }
4214 deserializer.deserialize_struct("connector_service.ValidationError", FIELDS, GeneratedVisitor)
4215 }
4216}