1use crate::task_service::*;
2impl serde::Serialize for CancelTaskRequest {
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.task_id.is_some() {
11 len += 1;
12 }
13 let mut struct_ser = serializer.serialize_struct("task_service.CancelTaskRequest", len)?;
14 if let Some(v) = self.task_id.as_ref() {
15 struct_ser.serialize_field("taskId", v)?;
16 }
17 struct_ser.end()
18 }
19}
20impl<'de> serde::Deserialize<'de> for CancelTaskRequest {
21 #[allow(deprecated)]
22 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23 where
24 D: serde::Deserializer<'de>,
25 {
26 const FIELDS: &[&str] = &[
27 "task_id",
28 "taskId",
29 ];
30
31 #[allow(clippy::enum_variant_names)]
32 enum GeneratedField {
33 TaskId,
34 }
35 impl<'de> serde::Deserialize<'de> for GeneratedField {
36 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
37 where
38 D: serde::Deserializer<'de>,
39 {
40 struct GeneratedVisitor;
41
42 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
43 type Value = GeneratedField;
44
45 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
46 write!(formatter, "expected one of: {:?}", &FIELDS)
47 }
48
49 #[allow(unused_variables)]
50 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
51 where
52 E: serde::de::Error,
53 {
54 match value {
55 "taskId" | "task_id" => Ok(GeneratedField::TaskId),
56 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
57 }
58 }
59 }
60 deserializer.deserialize_identifier(GeneratedVisitor)
61 }
62 }
63 struct GeneratedVisitor;
64 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
65 type Value = CancelTaskRequest;
66
67 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
68 formatter.write_str("struct task_service.CancelTaskRequest")
69 }
70
71 fn visit_map<V>(self, mut map_: V) -> std::result::Result<CancelTaskRequest, V::Error>
72 where
73 V: serde::de::MapAccess<'de>,
74 {
75 let mut task_id__ = None;
76 while let Some(k) = map_.next_key()? {
77 match k {
78 GeneratedField::TaskId => {
79 if task_id__.is_some() {
80 return Err(serde::de::Error::duplicate_field("taskId"));
81 }
82 task_id__ = map_.next_value()?;
83 }
84 }
85 }
86 Ok(CancelTaskRequest {
87 task_id: task_id__,
88 })
89 }
90 }
91 deserializer.deserialize_struct("task_service.CancelTaskRequest", FIELDS, GeneratedVisitor)
92 }
93}
94impl serde::Serialize for CancelTaskResponse {
95 #[allow(deprecated)]
96 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
97 where
98 S: serde::Serializer,
99 {
100 use serde::ser::SerializeStruct;
101 let mut len = 0;
102 if self.status.is_some() {
103 len += 1;
104 }
105 let mut struct_ser = serializer.serialize_struct("task_service.CancelTaskResponse", len)?;
106 if let Some(v) = self.status.as_ref() {
107 struct_ser.serialize_field("status", v)?;
108 }
109 struct_ser.end()
110 }
111}
112impl<'de> serde::Deserialize<'de> for CancelTaskResponse {
113 #[allow(deprecated)]
114 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
115 where
116 D: serde::Deserializer<'de>,
117 {
118 const FIELDS: &[&str] = &[
119 "status",
120 ];
121
122 #[allow(clippy::enum_variant_names)]
123 enum GeneratedField {
124 Status,
125 }
126 impl<'de> serde::Deserialize<'de> for GeneratedField {
127 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
128 where
129 D: serde::Deserializer<'de>,
130 {
131 struct GeneratedVisitor;
132
133 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
134 type Value = GeneratedField;
135
136 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
137 write!(formatter, "expected one of: {:?}", &FIELDS)
138 }
139
140 #[allow(unused_variables)]
141 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
142 where
143 E: serde::de::Error,
144 {
145 match value {
146 "status" => Ok(GeneratedField::Status),
147 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
148 }
149 }
150 }
151 deserializer.deserialize_identifier(GeneratedVisitor)
152 }
153 }
154 struct GeneratedVisitor;
155 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
156 type Value = CancelTaskResponse;
157
158 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
159 formatter.write_str("struct task_service.CancelTaskResponse")
160 }
161
162 fn visit_map<V>(self, mut map_: V) -> std::result::Result<CancelTaskResponse, V::Error>
163 where
164 V: serde::de::MapAccess<'de>,
165 {
166 let mut status__ = None;
167 while let Some(k) = map_.next_key()? {
168 match k {
169 GeneratedField::Status => {
170 if status__.is_some() {
171 return Err(serde::de::Error::duplicate_field("status"));
172 }
173 status__ = map_.next_value()?;
174 }
175 }
176 }
177 Ok(CancelTaskResponse {
178 status: status__,
179 })
180 }
181 }
182 deserializer.deserialize_struct("task_service.CancelTaskResponse", FIELDS, GeneratedVisitor)
183 }
184}
185impl serde::Serialize for CreateTaskRequest {
186 #[allow(deprecated)]
187 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
188 where
189 S: serde::Serializer,
190 {
191 use serde::ser::SerializeStruct;
192 let mut len = 0;
193 if self.task_id.is_some() {
194 len += 1;
195 }
196 if self.plan.is_some() {
197 len += 1;
198 }
199 if self.epoch.is_some() {
200 len += 1;
201 }
202 if !self.tracing_context.is_empty() {
203 len += 1;
204 }
205 if self.expr_context.is_some() {
206 len += 1;
207 }
208 let mut struct_ser = serializer.serialize_struct("task_service.CreateTaskRequest", len)?;
209 if let Some(v) = self.task_id.as_ref() {
210 struct_ser.serialize_field("taskId", v)?;
211 }
212 if let Some(v) = self.plan.as_ref() {
213 struct_ser.serialize_field("plan", v)?;
214 }
215 if let Some(v) = self.epoch.as_ref() {
216 struct_ser.serialize_field("epoch", v)?;
217 }
218 if !self.tracing_context.is_empty() {
219 struct_ser.serialize_field("tracingContext", &self.tracing_context)?;
220 }
221 if let Some(v) = self.expr_context.as_ref() {
222 struct_ser.serialize_field("exprContext", v)?;
223 }
224 struct_ser.end()
225 }
226}
227impl<'de> serde::Deserialize<'de> for CreateTaskRequest {
228 #[allow(deprecated)]
229 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
230 where
231 D: serde::Deserializer<'de>,
232 {
233 const FIELDS: &[&str] = &[
234 "task_id",
235 "taskId",
236 "plan",
237 "epoch",
238 "tracing_context",
239 "tracingContext",
240 "expr_context",
241 "exprContext",
242 ];
243
244 #[allow(clippy::enum_variant_names)]
245 enum GeneratedField {
246 TaskId,
247 Plan,
248 Epoch,
249 TracingContext,
250 ExprContext,
251 }
252 impl<'de> serde::Deserialize<'de> for GeneratedField {
253 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
254 where
255 D: serde::Deserializer<'de>,
256 {
257 struct GeneratedVisitor;
258
259 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
260 type Value = GeneratedField;
261
262 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
263 write!(formatter, "expected one of: {:?}", &FIELDS)
264 }
265
266 #[allow(unused_variables)]
267 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
268 where
269 E: serde::de::Error,
270 {
271 match value {
272 "taskId" | "task_id" => Ok(GeneratedField::TaskId),
273 "plan" => Ok(GeneratedField::Plan),
274 "epoch" => Ok(GeneratedField::Epoch),
275 "tracingContext" | "tracing_context" => Ok(GeneratedField::TracingContext),
276 "exprContext" | "expr_context" => Ok(GeneratedField::ExprContext),
277 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
278 }
279 }
280 }
281 deserializer.deserialize_identifier(GeneratedVisitor)
282 }
283 }
284 struct GeneratedVisitor;
285 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
286 type Value = CreateTaskRequest;
287
288 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
289 formatter.write_str("struct task_service.CreateTaskRequest")
290 }
291
292 fn visit_map<V>(self, mut map_: V) -> std::result::Result<CreateTaskRequest, V::Error>
293 where
294 V: serde::de::MapAccess<'de>,
295 {
296 let mut task_id__ = None;
297 let mut plan__ = None;
298 let mut epoch__ = None;
299 let mut tracing_context__ = None;
300 let mut expr_context__ = None;
301 while let Some(k) = map_.next_key()? {
302 match k {
303 GeneratedField::TaskId => {
304 if task_id__.is_some() {
305 return Err(serde::de::Error::duplicate_field("taskId"));
306 }
307 task_id__ = map_.next_value()?;
308 }
309 GeneratedField::Plan => {
310 if plan__.is_some() {
311 return Err(serde::de::Error::duplicate_field("plan"));
312 }
313 plan__ = map_.next_value()?;
314 }
315 GeneratedField::Epoch => {
316 if epoch__.is_some() {
317 return Err(serde::de::Error::duplicate_field("epoch"));
318 }
319 epoch__ = map_.next_value()?;
320 }
321 GeneratedField::TracingContext => {
322 if tracing_context__.is_some() {
323 return Err(serde::de::Error::duplicate_field("tracingContext"));
324 }
325 tracing_context__ = Some(
326 map_.next_value::<std::collections::HashMap<_, _>>()?
327 );
328 }
329 GeneratedField::ExprContext => {
330 if expr_context__.is_some() {
331 return Err(serde::de::Error::duplicate_field("exprContext"));
332 }
333 expr_context__ = map_.next_value()?;
334 }
335 }
336 }
337 Ok(CreateTaskRequest {
338 task_id: task_id__,
339 plan: plan__,
340 epoch: epoch__,
341 tracing_context: tracing_context__.unwrap_or_default(),
342 expr_context: expr_context__,
343 })
344 }
345 }
346 deserializer.deserialize_struct("task_service.CreateTaskRequest", FIELDS, GeneratedVisitor)
347 }
348}
349impl serde::Serialize for ExecuteRequest {
350 #[allow(deprecated)]
351 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
352 where
353 S: serde::Serializer,
354 {
355 use serde::ser::SerializeStruct;
356 let mut len = 0;
357 if self.task_id.is_some() {
358 len += 1;
359 }
360 if self.plan.is_some() {
361 len += 1;
362 }
363 if self.epoch.is_some() {
364 len += 1;
365 }
366 if !self.tracing_context.is_empty() {
367 len += 1;
368 }
369 if self.expr_context.is_some() {
370 len += 1;
371 }
372 let mut struct_ser = serializer.serialize_struct("task_service.ExecuteRequest", len)?;
373 if let Some(v) = self.task_id.as_ref() {
374 struct_ser.serialize_field("taskId", v)?;
375 }
376 if let Some(v) = self.plan.as_ref() {
377 struct_ser.serialize_field("plan", v)?;
378 }
379 if let Some(v) = self.epoch.as_ref() {
380 struct_ser.serialize_field("epoch", v)?;
381 }
382 if !self.tracing_context.is_empty() {
383 struct_ser.serialize_field("tracingContext", &self.tracing_context)?;
384 }
385 if let Some(v) = self.expr_context.as_ref() {
386 struct_ser.serialize_field("exprContext", v)?;
387 }
388 struct_ser.end()
389 }
390}
391impl<'de> serde::Deserialize<'de> for ExecuteRequest {
392 #[allow(deprecated)]
393 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
394 where
395 D: serde::Deserializer<'de>,
396 {
397 const FIELDS: &[&str] = &[
398 "task_id",
399 "taskId",
400 "plan",
401 "epoch",
402 "tracing_context",
403 "tracingContext",
404 "expr_context",
405 "exprContext",
406 ];
407
408 #[allow(clippy::enum_variant_names)]
409 enum GeneratedField {
410 TaskId,
411 Plan,
412 Epoch,
413 TracingContext,
414 ExprContext,
415 }
416 impl<'de> serde::Deserialize<'de> for GeneratedField {
417 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
418 where
419 D: serde::Deserializer<'de>,
420 {
421 struct GeneratedVisitor;
422
423 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
424 type Value = GeneratedField;
425
426 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
427 write!(formatter, "expected one of: {:?}", &FIELDS)
428 }
429
430 #[allow(unused_variables)]
431 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
432 where
433 E: serde::de::Error,
434 {
435 match value {
436 "taskId" | "task_id" => Ok(GeneratedField::TaskId),
437 "plan" => Ok(GeneratedField::Plan),
438 "epoch" => Ok(GeneratedField::Epoch),
439 "tracingContext" | "tracing_context" => Ok(GeneratedField::TracingContext),
440 "exprContext" | "expr_context" => Ok(GeneratedField::ExprContext),
441 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
442 }
443 }
444 }
445 deserializer.deserialize_identifier(GeneratedVisitor)
446 }
447 }
448 struct GeneratedVisitor;
449 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
450 type Value = ExecuteRequest;
451
452 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
453 formatter.write_str("struct task_service.ExecuteRequest")
454 }
455
456 fn visit_map<V>(self, mut map_: V) -> std::result::Result<ExecuteRequest, V::Error>
457 where
458 V: serde::de::MapAccess<'de>,
459 {
460 let mut task_id__ = None;
461 let mut plan__ = None;
462 let mut epoch__ = None;
463 let mut tracing_context__ = None;
464 let mut expr_context__ = None;
465 while let Some(k) = map_.next_key()? {
466 match k {
467 GeneratedField::TaskId => {
468 if task_id__.is_some() {
469 return Err(serde::de::Error::duplicate_field("taskId"));
470 }
471 task_id__ = map_.next_value()?;
472 }
473 GeneratedField::Plan => {
474 if plan__.is_some() {
475 return Err(serde::de::Error::duplicate_field("plan"));
476 }
477 plan__ = map_.next_value()?;
478 }
479 GeneratedField::Epoch => {
480 if epoch__.is_some() {
481 return Err(serde::de::Error::duplicate_field("epoch"));
482 }
483 epoch__ = map_.next_value()?;
484 }
485 GeneratedField::TracingContext => {
486 if tracing_context__.is_some() {
487 return Err(serde::de::Error::duplicate_field("tracingContext"));
488 }
489 tracing_context__ = Some(
490 map_.next_value::<std::collections::HashMap<_, _>>()?
491 );
492 }
493 GeneratedField::ExprContext => {
494 if expr_context__.is_some() {
495 return Err(serde::de::Error::duplicate_field("exprContext"));
496 }
497 expr_context__ = map_.next_value()?;
498 }
499 }
500 }
501 Ok(ExecuteRequest {
502 task_id: task_id__,
503 plan: plan__,
504 epoch: epoch__,
505 tracing_context: tracing_context__.unwrap_or_default(),
506 expr_context: expr_context__,
507 })
508 }
509 }
510 deserializer.deserialize_struct("task_service.ExecuteRequest", FIELDS, GeneratedVisitor)
511 }
512}
513impl serde::Serialize for FastInsertRequest {
514 #[allow(deprecated)]
515 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
516 where
517 S: serde::Serializer,
518 {
519 use serde::ser::SerializeStruct;
520 let mut len = 0;
521 if self.table_id != 0 {
522 len += 1;
523 }
524 if self.table_version_id != 0 {
525 len += 1;
526 }
527 if !self.column_indices.is_empty() {
528 len += 1;
529 }
530 if self.data_chunk.is_some() {
531 len += 1;
532 }
533 if self.row_id_index.is_some() {
534 len += 1;
535 }
536 if self.request_id != 0 {
537 len += 1;
538 }
539 if self.wait_for_persistence {
540 len += 1;
541 }
542 let mut struct_ser = serializer.serialize_struct("task_service.FastInsertRequest", len)?;
543 if self.table_id != 0 {
544 struct_ser.serialize_field("tableId", &self.table_id)?;
545 }
546 if self.table_version_id != 0 {
547 #[allow(clippy::needless_borrow)]
548 #[allow(clippy::needless_borrows_for_generic_args)]
549 struct_ser.serialize_field("tableVersionId", ToString::to_string(&self.table_version_id).as_str())?;
550 }
551 if !self.column_indices.is_empty() {
552 struct_ser.serialize_field("columnIndices", &self.column_indices)?;
553 }
554 if let Some(v) = self.data_chunk.as_ref() {
555 struct_ser.serialize_field("dataChunk", v)?;
556 }
557 if let Some(v) = self.row_id_index.as_ref() {
558 struct_ser.serialize_field("rowIdIndex", v)?;
559 }
560 if self.request_id != 0 {
561 struct_ser.serialize_field("requestId", &self.request_id)?;
562 }
563 if self.wait_for_persistence {
564 struct_ser.serialize_field("waitForPersistence", &self.wait_for_persistence)?;
565 }
566 struct_ser.end()
567 }
568}
569impl<'de> serde::Deserialize<'de> for FastInsertRequest {
570 #[allow(deprecated)]
571 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
572 where
573 D: serde::Deserializer<'de>,
574 {
575 const FIELDS: &[&str] = &[
576 "table_id",
577 "tableId",
578 "table_version_id",
579 "tableVersionId",
580 "column_indices",
581 "columnIndices",
582 "data_chunk",
583 "dataChunk",
584 "row_id_index",
585 "rowIdIndex",
586 "request_id",
587 "requestId",
588 "wait_for_persistence",
589 "waitForPersistence",
590 ];
591
592 #[allow(clippy::enum_variant_names)]
593 enum GeneratedField {
594 TableId,
595 TableVersionId,
596 ColumnIndices,
597 DataChunk,
598 RowIdIndex,
599 RequestId,
600 WaitForPersistence,
601 }
602 impl<'de> serde::Deserialize<'de> for GeneratedField {
603 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
604 where
605 D: serde::Deserializer<'de>,
606 {
607 struct GeneratedVisitor;
608
609 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
610 type Value = GeneratedField;
611
612 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
613 write!(formatter, "expected one of: {:?}", &FIELDS)
614 }
615
616 #[allow(unused_variables)]
617 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
618 where
619 E: serde::de::Error,
620 {
621 match value {
622 "tableId" | "table_id" => Ok(GeneratedField::TableId),
623 "tableVersionId" | "table_version_id" => Ok(GeneratedField::TableVersionId),
624 "columnIndices" | "column_indices" => Ok(GeneratedField::ColumnIndices),
625 "dataChunk" | "data_chunk" => Ok(GeneratedField::DataChunk),
626 "rowIdIndex" | "row_id_index" => Ok(GeneratedField::RowIdIndex),
627 "requestId" | "request_id" => Ok(GeneratedField::RequestId),
628 "waitForPersistence" | "wait_for_persistence" => Ok(GeneratedField::WaitForPersistence),
629 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
630 }
631 }
632 }
633 deserializer.deserialize_identifier(GeneratedVisitor)
634 }
635 }
636 struct GeneratedVisitor;
637 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
638 type Value = FastInsertRequest;
639
640 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
641 formatter.write_str("struct task_service.FastInsertRequest")
642 }
643
644 fn visit_map<V>(self, mut map_: V) -> std::result::Result<FastInsertRequest, V::Error>
645 where
646 V: serde::de::MapAccess<'de>,
647 {
648 let mut table_id__ = None;
649 let mut table_version_id__ = None;
650 let mut column_indices__ = None;
651 let mut data_chunk__ = None;
652 let mut row_id_index__ = None;
653 let mut request_id__ = None;
654 let mut wait_for_persistence__ = None;
655 while let Some(k) = map_.next_key()? {
656 match k {
657 GeneratedField::TableId => {
658 if table_id__.is_some() {
659 return Err(serde::de::Error::duplicate_field("tableId"));
660 }
661 table_id__ =
662 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
663 ;
664 }
665 GeneratedField::TableVersionId => {
666 if table_version_id__.is_some() {
667 return Err(serde::de::Error::duplicate_field("tableVersionId"));
668 }
669 table_version_id__ =
670 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
671 ;
672 }
673 GeneratedField::ColumnIndices => {
674 if column_indices__.is_some() {
675 return Err(serde::de::Error::duplicate_field("columnIndices"));
676 }
677 column_indices__ =
678 Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
679 .into_iter().map(|x| x.0).collect())
680 ;
681 }
682 GeneratedField::DataChunk => {
683 if data_chunk__.is_some() {
684 return Err(serde::de::Error::duplicate_field("dataChunk"));
685 }
686 data_chunk__ = map_.next_value()?;
687 }
688 GeneratedField::RowIdIndex => {
689 if row_id_index__.is_some() {
690 return Err(serde::de::Error::duplicate_field("rowIdIndex"));
691 }
692 row_id_index__ =
693 map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
694 ;
695 }
696 GeneratedField::RequestId => {
697 if request_id__.is_some() {
698 return Err(serde::de::Error::duplicate_field("requestId"));
699 }
700 request_id__ =
701 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
702 ;
703 }
704 GeneratedField::WaitForPersistence => {
705 if wait_for_persistence__.is_some() {
706 return Err(serde::de::Error::duplicate_field("waitForPersistence"));
707 }
708 wait_for_persistence__ = Some(map_.next_value()?);
709 }
710 }
711 }
712 Ok(FastInsertRequest {
713 table_id: table_id__.unwrap_or_default(),
714 table_version_id: table_version_id__.unwrap_or_default(),
715 column_indices: column_indices__.unwrap_or_default(),
716 data_chunk: data_chunk__,
717 row_id_index: row_id_index__,
718 request_id: request_id__.unwrap_or_default(),
719 wait_for_persistence: wait_for_persistence__.unwrap_or_default(),
720 })
721 }
722 }
723 deserializer.deserialize_struct("task_service.FastInsertRequest", FIELDS, GeneratedVisitor)
724 }
725}
726impl serde::Serialize for FastInsertResponse {
727 #[allow(deprecated)]
728 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
729 where
730 S: serde::Serializer,
731 {
732 use serde::ser::SerializeStruct;
733 let mut len = 0;
734 if self.status != 0 {
735 len += 1;
736 }
737 if !self.error_message.is_empty() {
738 len += 1;
739 }
740 let mut struct_ser = serializer.serialize_struct("task_service.FastInsertResponse", len)?;
741 if self.status != 0 {
742 let v = fast_insert_response::Status::try_from(self.status)
743 .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.status)))?;
744 struct_ser.serialize_field("status", &v)?;
745 }
746 if !self.error_message.is_empty() {
747 struct_ser.serialize_field("errorMessage", &self.error_message)?;
748 }
749 struct_ser.end()
750 }
751}
752impl<'de> serde::Deserialize<'de> for FastInsertResponse {
753 #[allow(deprecated)]
754 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
755 where
756 D: serde::Deserializer<'de>,
757 {
758 const FIELDS: &[&str] = &[
759 "status",
760 "error_message",
761 "errorMessage",
762 ];
763
764 #[allow(clippy::enum_variant_names)]
765 enum GeneratedField {
766 Status,
767 ErrorMessage,
768 }
769 impl<'de> serde::Deserialize<'de> for GeneratedField {
770 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
771 where
772 D: serde::Deserializer<'de>,
773 {
774 struct GeneratedVisitor;
775
776 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
777 type Value = GeneratedField;
778
779 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
780 write!(formatter, "expected one of: {:?}", &FIELDS)
781 }
782
783 #[allow(unused_variables)]
784 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
785 where
786 E: serde::de::Error,
787 {
788 match value {
789 "status" => Ok(GeneratedField::Status),
790 "errorMessage" | "error_message" => Ok(GeneratedField::ErrorMessage),
791 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
792 }
793 }
794 }
795 deserializer.deserialize_identifier(GeneratedVisitor)
796 }
797 }
798 struct GeneratedVisitor;
799 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
800 type Value = FastInsertResponse;
801
802 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
803 formatter.write_str("struct task_service.FastInsertResponse")
804 }
805
806 fn visit_map<V>(self, mut map_: V) -> std::result::Result<FastInsertResponse, V::Error>
807 where
808 V: serde::de::MapAccess<'de>,
809 {
810 let mut status__ = None;
811 let mut error_message__ = None;
812 while let Some(k) = map_.next_key()? {
813 match k {
814 GeneratedField::Status => {
815 if status__.is_some() {
816 return Err(serde::de::Error::duplicate_field("status"));
817 }
818 status__ = Some(map_.next_value::<fast_insert_response::Status>()? as i32);
819 }
820 GeneratedField::ErrorMessage => {
821 if error_message__.is_some() {
822 return Err(serde::de::Error::duplicate_field("errorMessage"));
823 }
824 error_message__ = Some(map_.next_value()?);
825 }
826 }
827 }
828 Ok(FastInsertResponse {
829 status: status__.unwrap_or_default(),
830 error_message: error_message__.unwrap_or_default(),
831 })
832 }
833 }
834 deserializer.deserialize_struct("task_service.FastInsertResponse", FIELDS, GeneratedVisitor)
835 }
836}
837impl serde::Serialize for fast_insert_response::Status {
838 #[allow(deprecated)]
839 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
840 where
841 S: serde::Serializer,
842 {
843 let variant = match self {
844 Self::Unspecified => "UNSPECIFIED",
845 Self::Succeeded => "SUCCEEDED",
846 Self::DmlFailed => "DML_FAILED",
847 };
848 serializer.serialize_str(variant)
849 }
850}
851impl<'de> serde::Deserialize<'de> for fast_insert_response::Status {
852 #[allow(deprecated)]
853 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
854 where
855 D: serde::Deserializer<'de>,
856 {
857 const FIELDS: &[&str] = &[
858 "UNSPECIFIED",
859 "SUCCEEDED",
860 "DML_FAILED",
861 ];
862
863 struct GeneratedVisitor;
864
865 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
866 type Value = fast_insert_response::Status;
867
868 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
869 write!(formatter, "expected one of: {:?}", &FIELDS)
870 }
871
872 fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
873 where
874 E: serde::de::Error,
875 {
876 i32::try_from(v)
877 .ok()
878 .and_then(|x| x.try_into().ok())
879 .ok_or_else(|| {
880 serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
881 })
882 }
883
884 fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
885 where
886 E: serde::de::Error,
887 {
888 i32::try_from(v)
889 .ok()
890 .and_then(|x| x.try_into().ok())
891 .ok_or_else(|| {
892 serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
893 })
894 }
895
896 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
897 where
898 E: serde::de::Error,
899 {
900 match value {
901 "UNSPECIFIED" => Ok(fast_insert_response::Status::Unspecified),
902 "SUCCEEDED" => Ok(fast_insert_response::Status::Succeeded),
903 "DML_FAILED" => Ok(fast_insert_response::Status::DmlFailed),
904 _ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
905 }
906 }
907 }
908 deserializer.deserialize_any(GeneratedVisitor)
909 }
910}
911impl serde::Serialize for GetDataRequest {
912 #[allow(deprecated)]
913 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
914 where
915 S: serde::Serializer,
916 {
917 use serde::ser::SerializeStruct;
918 let mut len = 0;
919 if self.task_output_id.is_some() {
920 len += 1;
921 }
922 let mut struct_ser = serializer.serialize_struct("task_service.GetDataRequest", len)?;
923 if let Some(v) = self.task_output_id.as_ref() {
924 struct_ser.serialize_field("taskOutputId", v)?;
925 }
926 struct_ser.end()
927 }
928}
929impl<'de> serde::Deserialize<'de> for GetDataRequest {
930 #[allow(deprecated)]
931 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
932 where
933 D: serde::Deserializer<'de>,
934 {
935 const FIELDS: &[&str] = &[
936 "task_output_id",
937 "taskOutputId",
938 ];
939
940 #[allow(clippy::enum_variant_names)]
941 enum GeneratedField {
942 TaskOutputId,
943 }
944 impl<'de> serde::Deserialize<'de> for GeneratedField {
945 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
946 where
947 D: serde::Deserializer<'de>,
948 {
949 struct GeneratedVisitor;
950
951 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
952 type Value = GeneratedField;
953
954 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
955 write!(formatter, "expected one of: {:?}", &FIELDS)
956 }
957
958 #[allow(unused_variables)]
959 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
960 where
961 E: serde::de::Error,
962 {
963 match value {
964 "taskOutputId" | "task_output_id" => Ok(GeneratedField::TaskOutputId),
965 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
966 }
967 }
968 }
969 deserializer.deserialize_identifier(GeneratedVisitor)
970 }
971 }
972 struct GeneratedVisitor;
973 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
974 type Value = GetDataRequest;
975
976 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
977 formatter.write_str("struct task_service.GetDataRequest")
978 }
979
980 fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetDataRequest, V::Error>
981 where
982 V: serde::de::MapAccess<'de>,
983 {
984 let mut task_output_id__ = None;
985 while let Some(k) = map_.next_key()? {
986 match k {
987 GeneratedField::TaskOutputId => {
988 if task_output_id__.is_some() {
989 return Err(serde::de::Error::duplicate_field("taskOutputId"));
990 }
991 task_output_id__ = map_.next_value()?;
992 }
993 }
994 }
995 Ok(GetDataRequest {
996 task_output_id: task_output_id__,
997 })
998 }
999 }
1000 deserializer.deserialize_struct("task_service.GetDataRequest", FIELDS, GeneratedVisitor)
1001 }
1002}
1003impl serde::Serialize for GetDataResponse {
1004 #[allow(deprecated)]
1005 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1006 where
1007 S: serde::Serializer,
1008 {
1009 use serde::ser::SerializeStruct;
1010 let mut len = 0;
1011 if self.record_batch.is_some() {
1012 len += 1;
1013 }
1014 let mut struct_ser = serializer.serialize_struct("task_service.GetDataResponse", len)?;
1015 if let Some(v) = self.record_batch.as_ref() {
1016 struct_ser.serialize_field("recordBatch", v)?;
1017 }
1018 struct_ser.end()
1019 }
1020}
1021impl<'de> serde::Deserialize<'de> for GetDataResponse {
1022 #[allow(deprecated)]
1023 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1024 where
1025 D: serde::Deserializer<'de>,
1026 {
1027 const FIELDS: &[&str] = &[
1028 "record_batch",
1029 "recordBatch",
1030 ];
1031
1032 #[allow(clippy::enum_variant_names)]
1033 enum GeneratedField {
1034 RecordBatch,
1035 }
1036 impl<'de> serde::Deserialize<'de> for GeneratedField {
1037 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1038 where
1039 D: serde::Deserializer<'de>,
1040 {
1041 struct GeneratedVisitor;
1042
1043 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1044 type Value = GeneratedField;
1045
1046 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1047 write!(formatter, "expected one of: {:?}", &FIELDS)
1048 }
1049
1050 #[allow(unused_variables)]
1051 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1052 where
1053 E: serde::de::Error,
1054 {
1055 match value {
1056 "recordBatch" | "record_batch" => Ok(GeneratedField::RecordBatch),
1057 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1058 }
1059 }
1060 }
1061 deserializer.deserialize_identifier(GeneratedVisitor)
1062 }
1063 }
1064 struct GeneratedVisitor;
1065 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1066 type Value = GetDataResponse;
1067
1068 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1069 formatter.write_str("struct task_service.GetDataResponse")
1070 }
1071
1072 fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetDataResponse, V::Error>
1073 where
1074 V: serde::de::MapAccess<'de>,
1075 {
1076 let mut record_batch__ = None;
1077 while let Some(k) = map_.next_key()? {
1078 match k {
1079 GeneratedField::RecordBatch => {
1080 if record_batch__.is_some() {
1081 return Err(serde::de::Error::duplicate_field("recordBatch"));
1082 }
1083 record_batch__ = map_.next_value()?;
1084 }
1085 }
1086 }
1087 Ok(GetDataResponse {
1088 record_batch: record_batch__,
1089 })
1090 }
1091 }
1092 deserializer.deserialize_struct("task_service.GetDataResponse", FIELDS, GeneratedVisitor)
1093 }
1094}
1095impl serde::Serialize for GetStreamRequest {
1096 #[allow(deprecated)]
1097 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1098 where
1099 S: serde::Serializer,
1100 {
1101 use serde::ser::SerializeStruct;
1102 let mut len = 0;
1103 if self.value.is_some() {
1104 len += 1;
1105 }
1106 let mut struct_ser = serializer.serialize_struct("task_service.GetStreamRequest", len)?;
1107 if let Some(v) = self.value.as_ref() {
1108 match v {
1109 get_stream_request::Value::Get(v) => {
1110 struct_ser.serialize_field("get", v)?;
1111 }
1112 get_stream_request::Value::AddPermits(v) => {
1113 struct_ser.serialize_field("addPermits", v)?;
1114 }
1115 }
1116 }
1117 struct_ser.end()
1118 }
1119}
1120impl<'de> serde::Deserialize<'de> for GetStreamRequest {
1121 #[allow(deprecated)]
1122 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1123 where
1124 D: serde::Deserializer<'de>,
1125 {
1126 const FIELDS: &[&str] = &[
1127 "get",
1128 "add_permits",
1129 "addPermits",
1130 ];
1131
1132 #[allow(clippy::enum_variant_names)]
1133 enum GeneratedField {
1134 Get,
1135 AddPermits,
1136 }
1137 impl<'de> serde::Deserialize<'de> for GeneratedField {
1138 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1139 where
1140 D: serde::Deserializer<'de>,
1141 {
1142 struct GeneratedVisitor;
1143
1144 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1145 type Value = GeneratedField;
1146
1147 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1148 write!(formatter, "expected one of: {:?}", &FIELDS)
1149 }
1150
1151 #[allow(unused_variables)]
1152 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1153 where
1154 E: serde::de::Error,
1155 {
1156 match value {
1157 "get" => Ok(GeneratedField::Get),
1158 "addPermits" | "add_permits" => Ok(GeneratedField::AddPermits),
1159 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1160 }
1161 }
1162 }
1163 deserializer.deserialize_identifier(GeneratedVisitor)
1164 }
1165 }
1166 struct GeneratedVisitor;
1167 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1168 type Value = GetStreamRequest;
1169
1170 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1171 formatter.write_str("struct task_service.GetStreamRequest")
1172 }
1173
1174 fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetStreamRequest, V::Error>
1175 where
1176 V: serde::de::MapAccess<'de>,
1177 {
1178 let mut value__ = None;
1179 while let Some(k) = map_.next_key()? {
1180 match k {
1181 GeneratedField::Get => {
1182 if value__.is_some() {
1183 return Err(serde::de::Error::duplicate_field("get"));
1184 }
1185 value__ = map_.next_value::<::std::option::Option<_>>()?.map(get_stream_request::Value::Get)
1186;
1187 }
1188 GeneratedField::AddPermits => {
1189 if value__.is_some() {
1190 return Err(serde::de::Error::duplicate_field("addPermits"));
1191 }
1192 value__ = map_.next_value::<::std::option::Option<_>>()?.map(get_stream_request::Value::AddPermits)
1193;
1194 }
1195 }
1196 }
1197 Ok(GetStreamRequest {
1198 value: value__,
1199 })
1200 }
1201 }
1202 deserializer.deserialize_struct("task_service.GetStreamRequest", FIELDS, GeneratedVisitor)
1203 }
1204}
1205impl serde::Serialize for get_stream_request::Get {
1206 #[allow(deprecated)]
1207 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1208 where
1209 S: serde::Serializer,
1210 {
1211 use serde::ser::SerializeStruct;
1212 let mut len = 0;
1213 if self.up_actor_id != 0 {
1214 len += 1;
1215 }
1216 if self.down_actor_id != 0 {
1217 len += 1;
1218 }
1219 if self.up_fragment_id != 0 {
1220 len += 1;
1221 }
1222 if self.down_fragment_id != 0 {
1223 len += 1;
1224 }
1225 if self.database_id != 0 {
1226 len += 1;
1227 }
1228 if !self.term_id.is_empty() {
1229 len += 1;
1230 }
1231 let mut struct_ser = serializer.serialize_struct("task_service.GetStreamRequest.Get", len)?;
1232 if self.up_actor_id != 0 {
1233 struct_ser.serialize_field("upActorId", &self.up_actor_id)?;
1234 }
1235 if self.down_actor_id != 0 {
1236 struct_ser.serialize_field("downActorId", &self.down_actor_id)?;
1237 }
1238 if self.up_fragment_id != 0 {
1239 struct_ser.serialize_field("upFragmentId", &self.up_fragment_id)?;
1240 }
1241 if self.down_fragment_id != 0 {
1242 struct_ser.serialize_field("downFragmentId", &self.down_fragment_id)?;
1243 }
1244 if self.database_id != 0 {
1245 struct_ser.serialize_field("databaseId", &self.database_id)?;
1246 }
1247 if !self.term_id.is_empty() {
1248 struct_ser.serialize_field("termId", &self.term_id)?;
1249 }
1250 struct_ser.end()
1251 }
1252}
1253impl<'de> serde::Deserialize<'de> for get_stream_request::Get {
1254 #[allow(deprecated)]
1255 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1256 where
1257 D: serde::Deserializer<'de>,
1258 {
1259 const FIELDS: &[&str] = &[
1260 "up_actor_id",
1261 "upActorId",
1262 "down_actor_id",
1263 "downActorId",
1264 "up_fragment_id",
1265 "upFragmentId",
1266 "down_fragment_id",
1267 "downFragmentId",
1268 "database_id",
1269 "databaseId",
1270 "term_id",
1271 "termId",
1272 ];
1273
1274 #[allow(clippy::enum_variant_names)]
1275 enum GeneratedField {
1276 UpActorId,
1277 DownActorId,
1278 UpFragmentId,
1279 DownFragmentId,
1280 DatabaseId,
1281 TermId,
1282 }
1283 impl<'de> serde::Deserialize<'de> for GeneratedField {
1284 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1285 where
1286 D: serde::Deserializer<'de>,
1287 {
1288 struct GeneratedVisitor;
1289
1290 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1291 type Value = GeneratedField;
1292
1293 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1294 write!(formatter, "expected one of: {:?}", &FIELDS)
1295 }
1296
1297 #[allow(unused_variables)]
1298 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1299 where
1300 E: serde::de::Error,
1301 {
1302 match value {
1303 "upActorId" | "up_actor_id" => Ok(GeneratedField::UpActorId),
1304 "downActorId" | "down_actor_id" => Ok(GeneratedField::DownActorId),
1305 "upFragmentId" | "up_fragment_id" => Ok(GeneratedField::UpFragmentId),
1306 "downFragmentId" | "down_fragment_id" => Ok(GeneratedField::DownFragmentId),
1307 "databaseId" | "database_id" => Ok(GeneratedField::DatabaseId),
1308 "termId" | "term_id" => Ok(GeneratedField::TermId),
1309 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1310 }
1311 }
1312 }
1313 deserializer.deserialize_identifier(GeneratedVisitor)
1314 }
1315 }
1316 struct GeneratedVisitor;
1317 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1318 type Value = get_stream_request::Get;
1319
1320 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1321 formatter.write_str("struct task_service.GetStreamRequest.Get")
1322 }
1323
1324 fn visit_map<V>(self, mut map_: V) -> std::result::Result<get_stream_request::Get, V::Error>
1325 where
1326 V: serde::de::MapAccess<'de>,
1327 {
1328 let mut up_actor_id__ = None;
1329 let mut down_actor_id__ = None;
1330 let mut up_fragment_id__ = None;
1331 let mut down_fragment_id__ = None;
1332 let mut database_id__ = None;
1333 let mut term_id__ = None;
1334 while let Some(k) = map_.next_key()? {
1335 match k {
1336 GeneratedField::UpActorId => {
1337 if up_actor_id__.is_some() {
1338 return Err(serde::de::Error::duplicate_field("upActorId"));
1339 }
1340 up_actor_id__ =
1341 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
1342 ;
1343 }
1344 GeneratedField::DownActorId => {
1345 if down_actor_id__.is_some() {
1346 return Err(serde::de::Error::duplicate_field("downActorId"));
1347 }
1348 down_actor_id__ =
1349 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
1350 ;
1351 }
1352 GeneratedField::UpFragmentId => {
1353 if up_fragment_id__.is_some() {
1354 return Err(serde::de::Error::duplicate_field("upFragmentId"));
1355 }
1356 up_fragment_id__ =
1357 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
1358 ;
1359 }
1360 GeneratedField::DownFragmentId => {
1361 if down_fragment_id__.is_some() {
1362 return Err(serde::de::Error::duplicate_field("downFragmentId"));
1363 }
1364 down_fragment_id__ =
1365 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
1366 ;
1367 }
1368 GeneratedField::DatabaseId => {
1369 if database_id__.is_some() {
1370 return Err(serde::de::Error::duplicate_field("databaseId"));
1371 }
1372 database_id__ =
1373 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
1374 ;
1375 }
1376 GeneratedField::TermId => {
1377 if term_id__.is_some() {
1378 return Err(serde::de::Error::duplicate_field("termId"));
1379 }
1380 term_id__ = Some(map_.next_value()?);
1381 }
1382 }
1383 }
1384 Ok(get_stream_request::Get {
1385 up_actor_id: up_actor_id__.unwrap_or_default(),
1386 down_actor_id: down_actor_id__.unwrap_or_default(),
1387 up_fragment_id: up_fragment_id__.unwrap_or_default(),
1388 down_fragment_id: down_fragment_id__.unwrap_or_default(),
1389 database_id: database_id__.unwrap_or_default(),
1390 term_id: term_id__.unwrap_or_default(),
1391 })
1392 }
1393 }
1394 deserializer.deserialize_struct("task_service.GetStreamRequest.Get", FIELDS, GeneratedVisitor)
1395 }
1396}
1397impl serde::Serialize for GetStreamResponse {
1398 #[allow(deprecated)]
1399 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1400 where
1401 S: serde::Serializer,
1402 {
1403 use serde::ser::SerializeStruct;
1404 let mut len = 0;
1405 if self.message.is_some() {
1406 len += 1;
1407 }
1408 if self.permits.is_some() {
1409 len += 1;
1410 }
1411 let mut struct_ser = serializer.serialize_struct("task_service.GetStreamResponse", len)?;
1412 if let Some(v) = self.message.as_ref() {
1413 struct_ser.serialize_field("message", v)?;
1414 }
1415 if let Some(v) = self.permits.as_ref() {
1416 struct_ser.serialize_field("permits", v)?;
1417 }
1418 struct_ser.end()
1419 }
1420}
1421impl<'de> serde::Deserialize<'de> for GetStreamResponse {
1422 #[allow(deprecated)]
1423 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1424 where
1425 D: serde::Deserializer<'de>,
1426 {
1427 const FIELDS: &[&str] = &[
1428 "message",
1429 "permits",
1430 ];
1431
1432 #[allow(clippy::enum_variant_names)]
1433 enum GeneratedField {
1434 Message,
1435 Permits,
1436 }
1437 impl<'de> serde::Deserialize<'de> for GeneratedField {
1438 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1439 where
1440 D: serde::Deserializer<'de>,
1441 {
1442 struct GeneratedVisitor;
1443
1444 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1445 type Value = GeneratedField;
1446
1447 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1448 write!(formatter, "expected one of: {:?}", &FIELDS)
1449 }
1450
1451 #[allow(unused_variables)]
1452 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1453 where
1454 E: serde::de::Error,
1455 {
1456 match value {
1457 "message" => Ok(GeneratedField::Message),
1458 "permits" => Ok(GeneratedField::Permits),
1459 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1460 }
1461 }
1462 }
1463 deserializer.deserialize_identifier(GeneratedVisitor)
1464 }
1465 }
1466 struct GeneratedVisitor;
1467 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1468 type Value = GetStreamResponse;
1469
1470 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1471 formatter.write_str("struct task_service.GetStreamResponse")
1472 }
1473
1474 fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetStreamResponse, V::Error>
1475 where
1476 V: serde::de::MapAccess<'de>,
1477 {
1478 let mut message__ = None;
1479 let mut permits__ = None;
1480 while let Some(k) = map_.next_key()? {
1481 match k {
1482 GeneratedField::Message => {
1483 if message__.is_some() {
1484 return Err(serde::de::Error::duplicate_field("message"));
1485 }
1486 message__ = map_.next_value()?;
1487 }
1488 GeneratedField::Permits => {
1489 if permits__.is_some() {
1490 return Err(serde::de::Error::duplicate_field("permits"));
1491 }
1492 permits__ = map_.next_value()?;
1493 }
1494 }
1495 }
1496 Ok(GetStreamResponse {
1497 message: message__,
1498 permits: permits__,
1499 })
1500 }
1501 }
1502 deserializer.deserialize_struct("task_service.GetStreamResponse", FIELDS, GeneratedVisitor)
1503 }
1504}
1505impl serde::Serialize for GetTaskInfoRequest {
1506 #[allow(deprecated)]
1507 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1508 where
1509 S: serde::Serializer,
1510 {
1511 use serde::ser::SerializeStruct;
1512 let mut len = 0;
1513 if self.task_id.is_some() {
1514 len += 1;
1515 }
1516 let mut struct_ser = serializer.serialize_struct("task_service.GetTaskInfoRequest", len)?;
1517 if let Some(v) = self.task_id.as_ref() {
1518 struct_ser.serialize_field("taskId", v)?;
1519 }
1520 struct_ser.end()
1521 }
1522}
1523impl<'de> serde::Deserialize<'de> for GetTaskInfoRequest {
1524 #[allow(deprecated)]
1525 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1526 where
1527 D: serde::Deserializer<'de>,
1528 {
1529 const FIELDS: &[&str] = &[
1530 "task_id",
1531 "taskId",
1532 ];
1533
1534 #[allow(clippy::enum_variant_names)]
1535 enum GeneratedField {
1536 TaskId,
1537 }
1538 impl<'de> serde::Deserialize<'de> for GeneratedField {
1539 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1540 where
1541 D: serde::Deserializer<'de>,
1542 {
1543 struct GeneratedVisitor;
1544
1545 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1546 type Value = GeneratedField;
1547
1548 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1549 write!(formatter, "expected one of: {:?}", &FIELDS)
1550 }
1551
1552 #[allow(unused_variables)]
1553 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1554 where
1555 E: serde::de::Error,
1556 {
1557 match value {
1558 "taskId" | "task_id" => Ok(GeneratedField::TaskId),
1559 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1560 }
1561 }
1562 }
1563 deserializer.deserialize_identifier(GeneratedVisitor)
1564 }
1565 }
1566 struct GeneratedVisitor;
1567 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1568 type Value = GetTaskInfoRequest;
1569
1570 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1571 formatter.write_str("struct task_service.GetTaskInfoRequest")
1572 }
1573
1574 fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetTaskInfoRequest, V::Error>
1575 where
1576 V: serde::de::MapAccess<'de>,
1577 {
1578 let mut task_id__ = None;
1579 while let Some(k) = map_.next_key()? {
1580 match k {
1581 GeneratedField::TaskId => {
1582 if task_id__.is_some() {
1583 return Err(serde::de::Error::duplicate_field("taskId"));
1584 }
1585 task_id__ = map_.next_value()?;
1586 }
1587 }
1588 }
1589 Ok(GetTaskInfoRequest {
1590 task_id: task_id__,
1591 })
1592 }
1593 }
1594 deserializer.deserialize_struct("task_service.GetTaskInfoRequest", FIELDS, GeneratedVisitor)
1595 }
1596}
1597impl serde::Serialize for Permits {
1598 #[allow(deprecated)]
1599 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1600 where
1601 S: serde::Serializer,
1602 {
1603 use serde::ser::SerializeStruct;
1604 let mut len = 0;
1605 if self.value.is_some() {
1606 len += 1;
1607 }
1608 let mut struct_ser = serializer.serialize_struct("task_service.Permits", len)?;
1609 if let Some(v) = self.value.as_ref() {
1610 match v {
1611 permits::Value::Record(v) => {
1612 struct_ser.serialize_field("record", v)?;
1613 }
1614 permits::Value::Barrier(v) => {
1615 struct_ser.serialize_field("barrier", v)?;
1616 }
1617 }
1618 }
1619 struct_ser.end()
1620 }
1621}
1622impl<'de> serde::Deserialize<'de> for Permits {
1623 #[allow(deprecated)]
1624 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1625 where
1626 D: serde::Deserializer<'de>,
1627 {
1628 const FIELDS: &[&str] = &[
1629 "record",
1630 "barrier",
1631 ];
1632
1633 #[allow(clippy::enum_variant_names)]
1634 enum GeneratedField {
1635 Record,
1636 Barrier,
1637 }
1638 impl<'de> serde::Deserialize<'de> for GeneratedField {
1639 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1640 where
1641 D: serde::Deserializer<'de>,
1642 {
1643 struct GeneratedVisitor;
1644
1645 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1646 type Value = GeneratedField;
1647
1648 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1649 write!(formatter, "expected one of: {:?}", &FIELDS)
1650 }
1651
1652 #[allow(unused_variables)]
1653 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1654 where
1655 E: serde::de::Error,
1656 {
1657 match value {
1658 "record" => Ok(GeneratedField::Record),
1659 "barrier" => Ok(GeneratedField::Barrier),
1660 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1661 }
1662 }
1663 }
1664 deserializer.deserialize_identifier(GeneratedVisitor)
1665 }
1666 }
1667 struct GeneratedVisitor;
1668 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1669 type Value = Permits;
1670
1671 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1672 formatter.write_str("struct task_service.Permits")
1673 }
1674
1675 fn visit_map<V>(self, mut map_: V) -> std::result::Result<Permits, V::Error>
1676 where
1677 V: serde::de::MapAccess<'de>,
1678 {
1679 let mut value__ = None;
1680 while let Some(k) = map_.next_key()? {
1681 match k {
1682 GeneratedField::Record => {
1683 if value__.is_some() {
1684 return Err(serde::de::Error::duplicate_field("record"));
1685 }
1686 value__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| permits::Value::Record(x.0));
1687 }
1688 GeneratedField::Barrier => {
1689 if value__.is_some() {
1690 return Err(serde::de::Error::duplicate_field("barrier"));
1691 }
1692 value__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| permits::Value::Barrier(x.0));
1693 }
1694 }
1695 }
1696 Ok(Permits {
1697 value: value__,
1698 })
1699 }
1700 }
1701 deserializer.deserialize_struct("task_service.Permits", FIELDS, GeneratedVisitor)
1702 }
1703}
1704impl serde::Serialize for TaskId {
1705 #[allow(deprecated)]
1706 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1707 where
1708 S: serde::Serializer,
1709 {
1710 use serde::ser::SerializeStruct;
1711 let mut len = 0;
1712 if !self.query_id.is_empty() {
1713 len += 1;
1714 }
1715 if self.stage_id != 0 {
1716 len += 1;
1717 }
1718 if self.task_id != 0 {
1719 len += 1;
1720 }
1721 let mut struct_ser = serializer.serialize_struct("task_service.TaskId", len)?;
1722 if !self.query_id.is_empty() {
1723 struct_ser.serialize_field("queryId", &self.query_id)?;
1724 }
1725 if self.stage_id != 0 {
1726 struct_ser.serialize_field("stageId", &self.stage_id)?;
1727 }
1728 if self.task_id != 0 {
1729 struct_ser.serialize_field("taskId", &self.task_id)?;
1730 }
1731 struct_ser.end()
1732 }
1733}
1734impl<'de> serde::Deserialize<'de> for TaskId {
1735 #[allow(deprecated)]
1736 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1737 where
1738 D: serde::Deserializer<'de>,
1739 {
1740 const FIELDS: &[&str] = &[
1741 "query_id",
1742 "queryId",
1743 "stage_id",
1744 "stageId",
1745 "task_id",
1746 "taskId",
1747 ];
1748
1749 #[allow(clippy::enum_variant_names)]
1750 enum GeneratedField {
1751 QueryId,
1752 StageId,
1753 TaskId,
1754 }
1755 impl<'de> serde::Deserialize<'de> for GeneratedField {
1756 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1757 where
1758 D: serde::Deserializer<'de>,
1759 {
1760 struct GeneratedVisitor;
1761
1762 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1763 type Value = GeneratedField;
1764
1765 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1766 write!(formatter, "expected one of: {:?}", &FIELDS)
1767 }
1768
1769 #[allow(unused_variables)]
1770 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1771 where
1772 E: serde::de::Error,
1773 {
1774 match value {
1775 "queryId" | "query_id" => Ok(GeneratedField::QueryId),
1776 "stageId" | "stage_id" => Ok(GeneratedField::StageId),
1777 "taskId" | "task_id" => Ok(GeneratedField::TaskId),
1778 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1779 }
1780 }
1781 }
1782 deserializer.deserialize_identifier(GeneratedVisitor)
1783 }
1784 }
1785 struct GeneratedVisitor;
1786 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1787 type Value = TaskId;
1788
1789 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1790 formatter.write_str("struct task_service.TaskId")
1791 }
1792
1793 fn visit_map<V>(self, mut map_: V) -> std::result::Result<TaskId, V::Error>
1794 where
1795 V: serde::de::MapAccess<'de>,
1796 {
1797 let mut query_id__ = None;
1798 let mut stage_id__ = None;
1799 let mut task_id__ = None;
1800 while let Some(k) = map_.next_key()? {
1801 match k {
1802 GeneratedField::QueryId => {
1803 if query_id__.is_some() {
1804 return Err(serde::de::Error::duplicate_field("queryId"));
1805 }
1806 query_id__ = Some(map_.next_value()?);
1807 }
1808 GeneratedField::StageId => {
1809 if stage_id__.is_some() {
1810 return Err(serde::de::Error::duplicate_field("stageId"));
1811 }
1812 stage_id__ =
1813 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
1814 ;
1815 }
1816 GeneratedField::TaskId => {
1817 if task_id__.is_some() {
1818 return Err(serde::de::Error::duplicate_field("taskId"));
1819 }
1820 task_id__ =
1821 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
1822 ;
1823 }
1824 }
1825 }
1826 Ok(TaskId {
1827 query_id: query_id__.unwrap_or_default(),
1828 stage_id: stage_id__.unwrap_or_default(),
1829 task_id: task_id__.unwrap_or_default(),
1830 })
1831 }
1832 }
1833 deserializer.deserialize_struct("task_service.TaskId", FIELDS, GeneratedVisitor)
1834 }
1835}
1836impl serde::Serialize for TaskInfoResponse {
1837 #[allow(deprecated)]
1838 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1839 where
1840 S: serde::Serializer,
1841 {
1842 use serde::ser::SerializeStruct;
1843 let mut len = 0;
1844 if self.task_id.is_some() {
1845 len += 1;
1846 }
1847 if self.task_status != 0 {
1848 len += 1;
1849 }
1850 if !self.error_message.is_empty() {
1851 len += 1;
1852 }
1853 let mut struct_ser = serializer.serialize_struct("task_service.TaskInfoResponse", len)?;
1854 if let Some(v) = self.task_id.as_ref() {
1855 struct_ser.serialize_field("taskId", v)?;
1856 }
1857 if self.task_status != 0 {
1858 let v = task_info_response::TaskStatus::try_from(self.task_status)
1859 .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.task_status)))?;
1860 struct_ser.serialize_field("taskStatus", &v)?;
1861 }
1862 if !self.error_message.is_empty() {
1863 struct_ser.serialize_field("errorMessage", &self.error_message)?;
1864 }
1865 struct_ser.end()
1866 }
1867}
1868impl<'de> serde::Deserialize<'de> for TaskInfoResponse {
1869 #[allow(deprecated)]
1870 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1871 where
1872 D: serde::Deserializer<'de>,
1873 {
1874 const FIELDS: &[&str] = &[
1875 "task_id",
1876 "taskId",
1877 "task_status",
1878 "taskStatus",
1879 "error_message",
1880 "errorMessage",
1881 ];
1882
1883 #[allow(clippy::enum_variant_names)]
1884 enum GeneratedField {
1885 TaskId,
1886 TaskStatus,
1887 ErrorMessage,
1888 }
1889 impl<'de> serde::Deserialize<'de> for GeneratedField {
1890 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1891 where
1892 D: serde::Deserializer<'de>,
1893 {
1894 struct GeneratedVisitor;
1895
1896 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1897 type Value = GeneratedField;
1898
1899 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1900 write!(formatter, "expected one of: {:?}", &FIELDS)
1901 }
1902
1903 #[allow(unused_variables)]
1904 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1905 where
1906 E: serde::de::Error,
1907 {
1908 match value {
1909 "taskId" | "task_id" => Ok(GeneratedField::TaskId),
1910 "taskStatus" | "task_status" => Ok(GeneratedField::TaskStatus),
1911 "errorMessage" | "error_message" => Ok(GeneratedField::ErrorMessage),
1912 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1913 }
1914 }
1915 }
1916 deserializer.deserialize_identifier(GeneratedVisitor)
1917 }
1918 }
1919 struct GeneratedVisitor;
1920 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1921 type Value = TaskInfoResponse;
1922
1923 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1924 formatter.write_str("struct task_service.TaskInfoResponse")
1925 }
1926
1927 fn visit_map<V>(self, mut map_: V) -> std::result::Result<TaskInfoResponse, V::Error>
1928 where
1929 V: serde::de::MapAccess<'de>,
1930 {
1931 let mut task_id__ = None;
1932 let mut task_status__ = None;
1933 let mut error_message__ = None;
1934 while let Some(k) = map_.next_key()? {
1935 match k {
1936 GeneratedField::TaskId => {
1937 if task_id__.is_some() {
1938 return Err(serde::de::Error::duplicate_field("taskId"));
1939 }
1940 task_id__ = map_.next_value()?;
1941 }
1942 GeneratedField::TaskStatus => {
1943 if task_status__.is_some() {
1944 return Err(serde::de::Error::duplicate_field("taskStatus"));
1945 }
1946 task_status__ = Some(map_.next_value::<task_info_response::TaskStatus>()? as i32);
1947 }
1948 GeneratedField::ErrorMessage => {
1949 if error_message__.is_some() {
1950 return Err(serde::de::Error::duplicate_field("errorMessage"));
1951 }
1952 error_message__ = Some(map_.next_value()?);
1953 }
1954 }
1955 }
1956 Ok(TaskInfoResponse {
1957 task_id: task_id__,
1958 task_status: task_status__.unwrap_or_default(),
1959 error_message: error_message__.unwrap_or_default(),
1960 })
1961 }
1962 }
1963 deserializer.deserialize_struct("task_service.TaskInfoResponse", FIELDS, GeneratedVisitor)
1964 }
1965}
1966impl serde::Serialize for task_info_response::TaskStatus {
1967 #[allow(deprecated)]
1968 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1969 where
1970 S: serde::Serializer,
1971 {
1972 let variant = match self {
1973 Self::Unspecified => "UNSPECIFIED",
1974 Self::Pending => "PENDING",
1975 Self::Running => "RUNNING",
1976 Self::Finished => "FINISHED",
1977 Self::Failed => "FAILED",
1978 Self::Aborted => "ABORTED",
1979 Self::Cancelled => "CANCELLED",
1980 Self::Ping => "PING",
1981 };
1982 serializer.serialize_str(variant)
1983 }
1984}
1985impl<'de> serde::Deserialize<'de> for task_info_response::TaskStatus {
1986 #[allow(deprecated)]
1987 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1988 where
1989 D: serde::Deserializer<'de>,
1990 {
1991 const FIELDS: &[&str] = &[
1992 "UNSPECIFIED",
1993 "PENDING",
1994 "RUNNING",
1995 "FINISHED",
1996 "FAILED",
1997 "ABORTED",
1998 "CANCELLED",
1999 "PING",
2000 ];
2001
2002 struct GeneratedVisitor;
2003
2004 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2005 type Value = task_info_response::TaskStatus;
2006
2007 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2008 write!(formatter, "expected one of: {:?}", &FIELDS)
2009 }
2010
2011 fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
2012 where
2013 E: serde::de::Error,
2014 {
2015 i32::try_from(v)
2016 .ok()
2017 .and_then(|x| x.try_into().ok())
2018 .ok_or_else(|| {
2019 serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
2020 })
2021 }
2022
2023 fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
2024 where
2025 E: serde::de::Error,
2026 {
2027 i32::try_from(v)
2028 .ok()
2029 .and_then(|x| x.try_into().ok())
2030 .ok_or_else(|| {
2031 serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
2032 })
2033 }
2034
2035 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2036 where
2037 E: serde::de::Error,
2038 {
2039 match value {
2040 "UNSPECIFIED" => Ok(task_info_response::TaskStatus::Unspecified),
2041 "PENDING" => Ok(task_info_response::TaskStatus::Pending),
2042 "RUNNING" => Ok(task_info_response::TaskStatus::Running),
2043 "FINISHED" => Ok(task_info_response::TaskStatus::Finished),
2044 "FAILED" => Ok(task_info_response::TaskStatus::Failed),
2045 "ABORTED" => Ok(task_info_response::TaskStatus::Aborted),
2046 "CANCELLED" => Ok(task_info_response::TaskStatus::Cancelled),
2047 "PING" => Ok(task_info_response::TaskStatus::Ping),
2048 _ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
2049 }
2050 }
2051 }
2052 deserializer.deserialize_any(GeneratedVisitor)
2053 }
2054}