1#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate api;
21extern crate async_trait;
22extern crate bytes;
23extern crate gax;
24extern crate gaxi;
25extern crate lazy_static;
26extern crate reqwest;
27extern crate rpc;
28extern crate serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35mod debug;
36mod deserialize;
37mod serialize;
38
39#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct MigrationWorkflow {
44 pub name: std::string::String,
49
50 pub display_name: std::string::String,
53
54 pub tasks: std::collections::HashMap<std::string::String, crate::model::MigrationTask>,
58
59 pub state: crate::model::migration_workflow::State,
61
62 pub create_time: std::option::Option<wkt::Timestamp>,
64
65 pub last_update_time: std::option::Option<wkt::Timestamp>,
67
68 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
69}
70
71impl MigrationWorkflow {
72 pub fn new() -> Self {
73 std::default::Default::default()
74 }
75
76 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
78 self.name = v.into();
79 self
80 }
81
82 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
84 self.display_name = v.into();
85 self
86 }
87
88 pub fn set_tasks<T, K, V>(mut self, v: T) -> Self
90 where
91 T: std::iter::IntoIterator<Item = (K, V)>,
92 K: std::convert::Into<std::string::String>,
93 V: std::convert::Into<crate::model::MigrationTask>,
94 {
95 use std::iter::Iterator;
96 self.tasks = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
97 self
98 }
99
100 pub fn set_state<T: std::convert::Into<crate::model::migration_workflow::State>>(
102 mut self,
103 v: T,
104 ) -> Self {
105 self.state = v.into();
106 self
107 }
108
109 pub fn set_create_time<T>(mut self, v: T) -> Self
111 where
112 T: std::convert::Into<wkt::Timestamp>,
113 {
114 self.create_time = std::option::Option::Some(v.into());
115 self
116 }
117
118 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
120 where
121 T: std::convert::Into<wkt::Timestamp>,
122 {
123 self.create_time = v.map(|x| x.into());
124 self
125 }
126
127 pub fn set_last_update_time<T>(mut self, v: T) -> Self
129 where
130 T: std::convert::Into<wkt::Timestamp>,
131 {
132 self.last_update_time = std::option::Option::Some(v.into());
133 self
134 }
135
136 pub fn set_or_clear_last_update_time<T>(mut self, v: std::option::Option<T>) -> Self
138 where
139 T: std::convert::Into<wkt::Timestamp>,
140 {
141 self.last_update_time = v.map(|x| x.into());
142 self
143 }
144}
145
146impl wkt::message::Message for MigrationWorkflow {
147 fn typename() -> &'static str {
148 "type.googleapis.com/google.cloud.bigquery.migration.v2.MigrationWorkflow"
149 }
150}
151
152pub mod migration_workflow {
154 #[allow(unused_imports)]
155 use super::*;
156
157 #[derive(Clone, Debug, PartialEq)]
173 #[non_exhaustive]
174 pub enum State {
175 Unspecified,
177 Draft,
180 Running,
182 Paused,
185 Completed,
189 UnknownValue(state::UnknownValue),
194 }
195
196 #[doc(hidden)]
197 pub mod state {
198 #[allow(unused_imports)]
199 use super::*;
200 #[derive(Clone, Debug, PartialEq)]
201 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
202 }
203
204 impl State {
205 pub fn value(&self) -> std::option::Option<i32> {
210 match self {
211 Self::Unspecified => std::option::Option::Some(0),
212 Self::Draft => std::option::Option::Some(1),
213 Self::Running => std::option::Option::Some(2),
214 Self::Paused => std::option::Option::Some(3),
215 Self::Completed => std::option::Option::Some(4),
216 Self::UnknownValue(u) => u.0.value(),
217 }
218 }
219
220 pub fn name(&self) -> std::option::Option<&str> {
225 match self {
226 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
227 Self::Draft => std::option::Option::Some("DRAFT"),
228 Self::Running => std::option::Option::Some("RUNNING"),
229 Self::Paused => std::option::Option::Some("PAUSED"),
230 Self::Completed => std::option::Option::Some("COMPLETED"),
231 Self::UnknownValue(u) => u.0.name(),
232 }
233 }
234 }
235
236 impl std::default::Default for State {
237 fn default() -> Self {
238 use std::convert::From;
239 Self::from(0)
240 }
241 }
242
243 impl std::fmt::Display for State {
244 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
245 wkt::internal::display_enum(f, self.name(), self.value())
246 }
247 }
248
249 impl std::convert::From<i32> for State {
250 fn from(value: i32) -> Self {
251 match value {
252 0 => Self::Unspecified,
253 1 => Self::Draft,
254 2 => Self::Running,
255 3 => Self::Paused,
256 4 => Self::Completed,
257 _ => Self::UnknownValue(state::UnknownValue(
258 wkt::internal::UnknownEnumValue::Integer(value),
259 )),
260 }
261 }
262 }
263
264 impl std::convert::From<&str> for State {
265 fn from(value: &str) -> Self {
266 use std::string::ToString;
267 match value {
268 "STATE_UNSPECIFIED" => Self::Unspecified,
269 "DRAFT" => Self::Draft,
270 "RUNNING" => Self::Running,
271 "PAUSED" => Self::Paused,
272 "COMPLETED" => Self::Completed,
273 _ => Self::UnknownValue(state::UnknownValue(
274 wkt::internal::UnknownEnumValue::String(value.to_string()),
275 )),
276 }
277 }
278 }
279
280 impl serde::ser::Serialize for State {
281 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
282 where
283 S: serde::Serializer,
284 {
285 match self {
286 Self::Unspecified => serializer.serialize_i32(0),
287 Self::Draft => serializer.serialize_i32(1),
288 Self::Running => serializer.serialize_i32(2),
289 Self::Paused => serializer.serialize_i32(3),
290 Self::Completed => serializer.serialize_i32(4),
291 Self::UnknownValue(u) => u.0.serialize(serializer),
292 }
293 }
294 }
295
296 impl<'de> serde::de::Deserialize<'de> for State {
297 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
298 where
299 D: serde::Deserializer<'de>,
300 {
301 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
302 ".google.cloud.bigquery.migration.v2.MigrationWorkflow.State",
303 ))
304 }
305 }
306}
307
308#[derive(Clone, Default, PartialEq)]
311#[non_exhaustive]
312pub struct MigrationTask {
313 pub id: std::string::String,
316
317 pub r#type: std::string::String,
325
326 pub state: crate::model::migration_task::State,
328
329 pub processing_error: std::option::Option<rpc::model::ErrorInfo>,
332
333 pub create_time: std::option::Option<wkt::Timestamp>,
335
336 pub last_update_time: std::option::Option<wkt::Timestamp>,
338
339 pub resource_error_details: std::vec::Vec<crate::model::ResourceErrorDetail>,
343
344 pub resource_error_count: i32,
349
350 pub metrics: std::vec::Vec<crate::model::TimeSeries>,
352
353 pub task_result: std::option::Option<crate::model::MigrationTaskResult>,
355
356 pub total_processing_error_count: i32,
358
359 pub total_resource_error_count: i32,
361
362 pub task_details: std::option::Option<crate::model::migration_task::TaskDetails>,
364
365 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
366}
367
368impl MigrationTask {
369 pub fn new() -> Self {
370 std::default::Default::default()
371 }
372
373 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
375 self.id = v.into();
376 self
377 }
378
379 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
381 self.r#type = v.into();
382 self
383 }
384
385 pub fn set_state<T: std::convert::Into<crate::model::migration_task::State>>(
387 mut self,
388 v: T,
389 ) -> Self {
390 self.state = v.into();
391 self
392 }
393
394 pub fn set_processing_error<T>(mut self, v: T) -> Self
396 where
397 T: std::convert::Into<rpc::model::ErrorInfo>,
398 {
399 self.processing_error = std::option::Option::Some(v.into());
400 self
401 }
402
403 pub fn set_or_clear_processing_error<T>(mut self, v: std::option::Option<T>) -> Self
405 where
406 T: std::convert::Into<rpc::model::ErrorInfo>,
407 {
408 self.processing_error = v.map(|x| x.into());
409 self
410 }
411
412 pub fn set_create_time<T>(mut self, v: T) -> Self
414 where
415 T: std::convert::Into<wkt::Timestamp>,
416 {
417 self.create_time = std::option::Option::Some(v.into());
418 self
419 }
420
421 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
423 where
424 T: std::convert::Into<wkt::Timestamp>,
425 {
426 self.create_time = v.map(|x| x.into());
427 self
428 }
429
430 pub fn set_last_update_time<T>(mut self, v: T) -> Self
432 where
433 T: std::convert::Into<wkt::Timestamp>,
434 {
435 self.last_update_time = std::option::Option::Some(v.into());
436 self
437 }
438
439 pub fn set_or_clear_last_update_time<T>(mut self, v: std::option::Option<T>) -> Self
441 where
442 T: std::convert::Into<wkt::Timestamp>,
443 {
444 self.last_update_time = v.map(|x| x.into());
445 self
446 }
447
448 pub fn set_resource_error_details<T, V>(mut self, v: T) -> Self
450 where
451 T: std::iter::IntoIterator<Item = V>,
452 V: std::convert::Into<crate::model::ResourceErrorDetail>,
453 {
454 use std::iter::Iterator;
455 self.resource_error_details = v.into_iter().map(|i| i.into()).collect();
456 self
457 }
458
459 pub fn set_resource_error_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
461 self.resource_error_count = v.into();
462 self
463 }
464
465 pub fn set_metrics<T, V>(mut self, v: T) -> Self
467 where
468 T: std::iter::IntoIterator<Item = V>,
469 V: std::convert::Into<crate::model::TimeSeries>,
470 {
471 use std::iter::Iterator;
472 self.metrics = v.into_iter().map(|i| i.into()).collect();
473 self
474 }
475
476 pub fn set_task_result<T>(mut self, v: T) -> Self
478 where
479 T: std::convert::Into<crate::model::MigrationTaskResult>,
480 {
481 self.task_result = std::option::Option::Some(v.into());
482 self
483 }
484
485 pub fn set_or_clear_task_result<T>(mut self, v: std::option::Option<T>) -> Self
487 where
488 T: std::convert::Into<crate::model::MigrationTaskResult>,
489 {
490 self.task_result = v.map(|x| x.into());
491 self
492 }
493
494 pub fn set_total_processing_error_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
496 self.total_processing_error_count = v.into();
497 self
498 }
499
500 pub fn set_total_resource_error_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
502 self.total_resource_error_count = v.into();
503 self
504 }
505
506 pub fn set_task_details<
511 T: std::convert::Into<std::option::Option<crate::model::migration_task::TaskDetails>>,
512 >(
513 mut self,
514 v: T,
515 ) -> Self {
516 self.task_details = v.into();
517 self
518 }
519
520 pub fn translation_config_details(
524 &self,
525 ) -> std::option::Option<&std::boxed::Box<crate::model::TranslationConfigDetails>> {
526 #[allow(unreachable_patterns)]
527 self.task_details.as_ref().and_then(|v| match v {
528 crate::model::migration_task::TaskDetails::TranslationConfigDetails(v) => {
529 std::option::Option::Some(v)
530 }
531 _ => std::option::Option::None,
532 })
533 }
534
535 pub fn set_translation_config_details<
541 T: std::convert::Into<std::boxed::Box<crate::model::TranslationConfigDetails>>,
542 >(
543 mut self,
544 v: T,
545 ) -> Self {
546 self.task_details = std::option::Option::Some(
547 crate::model::migration_task::TaskDetails::TranslationConfigDetails(v.into()),
548 );
549 self
550 }
551
552 pub fn translation_details(
556 &self,
557 ) -> std::option::Option<&std::boxed::Box<crate::model::TranslationDetails>> {
558 #[allow(unreachable_patterns)]
559 self.task_details.as_ref().and_then(|v| match v {
560 crate::model::migration_task::TaskDetails::TranslationDetails(v) => {
561 std::option::Option::Some(v)
562 }
563 _ => std::option::Option::None,
564 })
565 }
566
567 pub fn set_translation_details<
573 T: std::convert::Into<std::boxed::Box<crate::model::TranslationDetails>>,
574 >(
575 mut self,
576 v: T,
577 ) -> Self {
578 self.task_details = std::option::Option::Some(
579 crate::model::migration_task::TaskDetails::TranslationDetails(v.into()),
580 );
581 self
582 }
583}
584
585impl wkt::message::Message for MigrationTask {
586 fn typename() -> &'static str {
587 "type.googleapis.com/google.cloud.bigquery.migration.v2.MigrationTask"
588 }
589}
590
591pub mod migration_task {
593 #[allow(unused_imports)]
594 use super::*;
595
596 #[derive(Clone, Debug, PartialEq)]
612 #[non_exhaustive]
613 pub enum State {
614 Unspecified,
616 Pending,
618 Orchestrating,
620 Running,
622 Paused,
625 Succeeded,
627 Failed,
629 UnknownValue(state::UnknownValue),
634 }
635
636 #[doc(hidden)]
637 pub mod state {
638 #[allow(unused_imports)]
639 use super::*;
640 #[derive(Clone, Debug, PartialEq)]
641 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
642 }
643
644 impl State {
645 pub fn value(&self) -> std::option::Option<i32> {
650 match self {
651 Self::Unspecified => std::option::Option::Some(0),
652 Self::Pending => std::option::Option::Some(1),
653 Self::Orchestrating => std::option::Option::Some(2),
654 Self::Running => std::option::Option::Some(3),
655 Self::Paused => std::option::Option::Some(4),
656 Self::Succeeded => std::option::Option::Some(5),
657 Self::Failed => std::option::Option::Some(6),
658 Self::UnknownValue(u) => u.0.value(),
659 }
660 }
661
662 pub fn name(&self) -> std::option::Option<&str> {
667 match self {
668 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
669 Self::Pending => std::option::Option::Some("PENDING"),
670 Self::Orchestrating => std::option::Option::Some("ORCHESTRATING"),
671 Self::Running => std::option::Option::Some("RUNNING"),
672 Self::Paused => std::option::Option::Some("PAUSED"),
673 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
674 Self::Failed => std::option::Option::Some("FAILED"),
675 Self::UnknownValue(u) => u.0.name(),
676 }
677 }
678 }
679
680 impl std::default::Default for State {
681 fn default() -> Self {
682 use std::convert::From;
683 Self::from(0)
684 }
685 }
686
687 impl std::fmt::Display for State {
688 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
689 wkt::internal::display_enum(f, self.name(), self.value())
690 }
691 }
692
693 impl std::convert::From<i32> for State {
694 fn from(value: i32) -> Self {
695 match value {
696 0 => Self::Unspecified,
697 1 => Self::Pending,
698 2 => Self::Orchestrating,
699 3 => Self::Running,
700 4 => Self::Paused,
701 5 => Self::Succeeded,
702 6 => Self::Failed,
703 _ => Self::UnknownValue(state::UnknownValue(
704 wkt::internal::UnknownEnumValue::Integer(value),
705 )),
706 }
707 }
708 }
709
710 impl std::convert::From<&str> for State {
711 fn from(value: &str) -> Self {
712 use std::string::ToString;
713 match value {
714 "STATE_UNSPECIFIED" => Self::Unspecified,
715 "PENDING" => Self::Pending,
716 "ORCHESTRATING" => Self::Orchestrating,
717 "RUNNING" => Self::Running,
718 "PAUSED" => Self::Paused,
719 "SUCCEEDED" => Self::Succeeded,
720 "FAILED" => Self::Failed,
721 _ => Self::UnknownValue(state::UnknownValue(
722 wkt::internal::UnknownEnumValue::String(value.to_string()),
723 )),
724 }
725 }
726 }
727
728 impl serde::ser::Serialize for State {
729 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
730 where
731 S: serde::Serializer,
732 {
733 match self {
734 Self::Unspecified => serializer.serialize_i32(0),
735 Self::Pending => serializer.serialize_i32(1),
736 Self::Orchestrating => serializer.serialize_i32(2),
737 Self::Running => serializer.serialize_i32(3),
738 Self::Paused => serializer.serialize_i32(4),
739 Self::Succeeded => serializer.serialize_i32(5),
740 Self::Failed => serializer.serialize_i32(6),
741 Self::UnknownValue(u) => u.0.serialize(serializer),
742 }
743 }
744 }
745
746 impl<'de> serde::de::Deserialize<'de> for State {
747 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
748 where
749 D: serde::Deserializer<'de>,
750 {
751 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
752 ".google.cloud.bigquery.migration.v2.MigrationTask.State",
753 ))
754 }
755 }
756
757 #[derive(Clone, Debug, PartialEq)]
759 #[non_exhaustive]
760 pub enum TaskDetails {
761 TranslationConfigDetails(std::boxed::Box<crate::model::TranslationConfigDetails>),
763 TranslationDetails(std::boxed::Box<crate::model::TranslationDetails>),
765 }
766}
767
768#[derive(Clone, Default, PartialEq)]
772#[non_exhaustive]
773pub struct MigrationSubtask {
774 pub name: std::string::String,
779
780 pub task_id: std::string::String,
782
783 pub r#type: std::string::String,
788
789 pub state: crate::model::migration_subtask::State,
791
792 pub processing_error: std::option::Option<rpc::model::ErrorInfo>,
795
796 pub resource_error_details: std::vec::Vec<crate::model::ResourceErrorDetail>,
800
801 pub resource_error_count: i32,
806
807 pub create_time: std::option::Option<wkt::Timestamp>,
809
810 pub last_update_time: std::option::Option<wkt::Timestamp>,
812
813 pub metrics: std::vec::Vec<crate::model::TimeSeries>,
815
816 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
817}
818
819impl MigrationSubtask {
820 pub fn new() -> Self {
821 std::default::Default::default()
822 }
823
824 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
826 self.name = v.into();
827 self
828 }
829
830 pub fn set_task_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
832 self.task_id = v.into();
833 self
834 }
835
836 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
838 self.r#type = v.into();
839 self
840 }
841
842 pub fn set_state<T: std::convert::Into<crate::model::migration_subtask::State>>(
844 mut self,
845 v: T,
846 ) -> Self {
847 self.state = v.into();
848 self
849 }
850
851 pub fn set_processing_error<T>(mut self, v: T) -> Self
853 where
854 T: std::convert::Into<rpc::model::ErrorInfo>,
855 {
856 self.processing_error = std::option::Option::Some(v.into());
857 self
858 }
859
860 pub fn set_or_clear_processing_error<T>(mut self, v: std::option::Option<T>) -> Self
862 where
863 T: std::convert::Into<rpc::model::ErrorInfo>,
864 {
865 self.processing_error = v.map(|x| x.into());
866 self
867 }
868
869 pub fn set_resource_error_details<T, V>(mut self, v: T) -> Self
871 where
872 T: std::iter::IntoIterator<Item = V>,
873 V: std::convert::Into<crate::model::ResourceErrorDetail>,
874 {
875 use std::iter::Iterator;
876 self.resource_error_details = v.into_iter().map(|i| i.into()).collect();
877 self
878 }
879
880 pub fn set_resource_error_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
882 self.resource_error_count = v.into();
883 self
884 }
885
886 pub fn set_create_time<T>(mut self, v: T) -> Self
888 where
889 T: std::convert::Into<wkt::Timestamp>,
890 {
891 self.create_time = std::option::Option::Some(v.into());
892 self
893 }
894
895 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
897 where
898 T: std::convert::Into<wkt::Timestamp>,
899 {
900 self.create_time = v.map(|x| x.into());
901 self
902 }
903
904 pub fn set_last_update_time<T>(mut self, v: T) -> Self
906 where
907 T: std::convert::Into<wkt::Timestamp>,
908 {
909 self.last_update_time = std::option::Option::Some(v.into());
910 self
911 }
912
913 pub fn set_or_clear_last_update_time<T>(mut self, v: std::option::Option<T>) -> Self
915 where
916 T: std::convert::Into<wkt::Timestamp>,
917 {
918 self.last_update_time = v.map(|x| x.into());
919 self
920 }
921
922 pub fn set_metrics<T, V>(mut self, v: T) -> Self
924 where
925 T: std::iter::IntoIterator<Item = V>,
926 V: std::convert::Into<crate::model::TimeSeries>,
927 {
928 use std::iter::Iterator;
929 self.metrics = v.into_iter().map(|i| i.into()).collect();
930 self
931 }
932}
933
934impl wkt::message::Message for MigrationSubtask {
935 fn typename() -> &'static str {
936 "type.googleapis.com/google.cloud.bigquery.migration.v2.MigrationSubtask"
937 }
938}
939
940pub mod migration_subtask {
942 #[allow(unused_imports)]
943 use super::*;
944
945 #[derive(Clone, Debug, PartialEq)]
961 #[non_exhaustive]
962 pub enum State {
963 Unspecified,
965 Active,
967 Running,
969 Succeeded,
971 Failed,
973 Paused,
976 PendingDependency,
979 UnknownValue(state::UnknownValue),
984 }
985
986 #[doc(hidden)]
987 pub mod state {
988 #[allow(unused_imports)]
989 use super::*;
990 #[derive(Clone, Debug, PartialEq)]
991 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
992 }
993
994 impl State {
995 pub fn value(&self) -> std::option::Option<i32> {
1000 match self {
1001 Self::Unspecified => std::option::Option::Some(0),
1002 Self::Active => std::option::Option::Some(1),
1003 Self::Running => std::option::Option::Some(2),
1004 Self::Succeeded => std::option::Option::Some(3),
1005 Self::Failed => std::option::Option::Some(4),
1006 Self::Paused => std::option::Option::Some(5),
1007 Self::PendingDependency => std::option::Option::Some(6),
1008 Self::UnknownValue(u) => u.0.value(),
1009 }
1010 }
1011
1012 pub fn name(&self) -> std::option::Option<&str> {
1017 match self {
1018 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1019 Self::Active => std::option::Option::Some("ACTIVE"),
1020 Self::Running => std::option::Option::Some("RUNNING"),
1021 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
1022 Self::Failed => std::option::Option::Some("FAILED"),
1023 Self::Paused => std::option::Option::Some("PAUSED"),
1024 Self::PendingDependency => std::option::Option::Some("PENDING_DEPENDENCY"),
1025 Self::UnknownValue(u) => u.0.name(),
1026 }
1027 }
1028 }
1029
1030 impl std::default::Default for State {
1031 fn default() -> Self {
1032 use std::convert::From;
1033 Self::from(0)
1034 }
1035 }
1036
1037 impl std::fmt::Display for State {
1038 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1039 wkt::internal::display_enum(f, self.name(), self.value())
1040 }
1041 }
1042
1043 impl std::convert::From<i32> for State {
1044 fn from(value: i32) -> Self {
1045 match value {
1046 0 => Self::Unspecified,
1047 1 => Self::Active,
1048 2 => Self::Running,
1049 3 => Self::Succeeded,
1050 4 => Self::Failed,
1051 5 => Self::Paused,
1052 6 => Self::PendingDependency,
1053 _ => Self::UnknownValue(state::UnknownValue(
1054 wkt::internal::UnknownEnumValue::Integer(value),
1055 )),
1056 }
1057 }
1058 }
1059
1060 impl std::convert::From<&str> for State {
1061 fn from(value: &str) -> Self {
1062 use std::string::ToString;
1063 match value {
1064 "STATE_UNSPECIFIED" => Self::Unspecified,
1065 "ACTIVE" => Self::Active,
1066 "RUNNING" => Self::Running,
1067 "SUCCEEDED" => Self::Succeeded,
1068 "FAILED" => Self::Failed,
1069 "PAUSED" => Self::Paused,
1070 "PENDING_DEPENDENCY" => Self::PendingDependency,
1071 _ => Self::UnknownValue(state::UnknownValue(
1072 wkt::internal::UnknownEnumValue::String(value.to_string()),
1073 )),
1074 }
1075 }
1076 }
1077
1078 impl serde::ser::Serialize for State {
1079 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1080 where
1081 S: serde::Serializer,
1082 {
1083 match self {
1084 Self::Unspecified => serializer.serialize_i32(0),
1085 Self::Active => serializer.serialize_i32(1),
1086 Self::Running => serializer.serialize_i32(2),
1087 Self::Succeeded => serializer.serialize_i32(3),
1088 Self::Failed => serializer.serialize_i32(4),
1089 Self::Paused => serializer.serialize_i32(5),
1090 Self::PendingDependency => serializer.serialize_i32(6),
1091 Self::UnknownValue(u) => u.0.serialize(serializer),
1092 }
1093 }
1094 }
1095
1096 impl<'de> serde::de::Deserialize<'de> for State {
1097 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1098 where
1099 D: serde::Deserializer<'de>,
1100 {
1101 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1102 ".google.cloud.bigquery.migration.v2.MigrationSubtask.State",
1103 ))
1104 }
1105 }
1106}
1107
1108#[derive(Clone, Default, PartialEq)]
1110#[non_exhaustive]
1111pub struct MigrationTaskResult {
1112 pub details: std::option::Option<crate::model::migration_task_result::Details>,
1114
1115 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1116}
1117
1118impl MigrationTaskResult {
1119 pub fn new() -> Self {
1120 std::default::Default::default()
1121 }
1122
1123 pub fn set_details<
1128 T: std::convert::Into<std::option::Option<crate::model::migration_task_result::Details>>,
1129 >(
1130 mut self,
1131 v: T,
1132 ) -> Self {
1133 self.details = v.into();
1134 self
1135 }
1136
1137 pub fn translation_task_result(
1141 &self,
1142 ) -> std::option::Option<&std::boxed::Box<crate::model::TranslationTaskResult>> {
1143 #[allow(unreachable_patterns)]
1144 self.details.as_ref().and_then(|v| match v {
1145 crate::model::migration_task_result::Details::TranslationTaskResult(v) => {
1146 std::option::Option::Some(v)
1147 }
1148 _ => std::option::Option::None,
1149 })
1150 }
1151
1152 pub fn set_translation_task_result<
1158 T: std::convert::Into<std::boxed::Box<crate::model::TranslationTaskResult>>,
1159 >(
1160 mut self,
1161 v: T,
1162 ) -> Self {
1163 self.details = std::option::Option::Some(
1164 crate::model::migration_task_result::Details::TranslationTaskResult(v.into()),
1165 );
1166 self
1167 }
1168}
1169
1170impl wkt::message::Message for MigrationTaskResult {
1171 fn typename() -> &'static str {
1172 "type.googleapis.com/google.cloud.bigquery.migration.v2.MigrationTaskResult"
1173 }
1174}
1175
1176pub mod migration_task_result {
1178 #[allow(unused_imports)]
1179 use super::*;
1180
1181 #[derive(Clone, Debug, PartialEq)]
1183 #[non_exhaustive]
1184 pub enum Details {
1185 TranslationTaskResult(std::boxed::Box<crate::model::TranslationTaskResult>),
1187 }
1188}
1189
1190#[derive(Clone, Default, PartialEq)]
1192#[non_exhaustive]
1193pub struct TranslationTaskResult {
1194 pub translated_literals: std::vec::Vec<crate::model::Literal>,
1196
1197 pub report_log_messages: std::vec::Vec<crate::model::GcsReportLogMessage>,
1199
1200 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1201}
1202
1203impl TranslationTaskResult {
1204 pub fn new() -> Self {
1205 std::default::Default::default()
1206 }
1207
1208 pub fn set_translated_literals<T, V>(mut self, v: T) -> Self
1210 where
1211 T: std::iter::IntoIterator<Item = V>,
1212 V: std::convert::Into<crate::model::Literal>,
1213 {
1214 use std::iter::Iterator;
1215 self.translated_literals = v.into_iter().map(|i| i.into()).collect();
1216 self
1217 }
1218
1219 pub fn set_report_log_messages<T, V>(mut self, v: T) -> Self
1221 where
1222 T: std::iter::IntoIterator<Item = V>,
1223 V: std::convert::Into<crate::model::GcsReportLogMessage>,
1224 {
1225 use std::iter::Iterator;
1226 self.report_log_messages = v.into_iter().map(|i| i.into()).collect();
1227 self
1228 }
1229}
1230
1231impl wkt::message::Message for TranslationTaskResult {
1232 fn typename() -> &'static str {
1233 "type.googleapis.com/google.cloud.bigquery.migration.v2.TranslationTaskResult"
1234 }
1235}
1236
1237#[derive(Clone, Default, PartialEq)]
1239#[non_exhaustive]
1240pub struct ResourceErrorDetail {
1241 pub resource_info: std::option::Option<rpc::model::ResourceInfo>,
1243
1244 pub error_details: std::vec::Vec<crate::model::ErrorDetail>,
1246
1247 pub error_count: i32,
1251
1252 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1253}
1254
1255impl ResourceErrorDetail {
1256 pub fn new() -> Self {
1257 std::default::Default::default()
1258 }
1259
1260 pub fn set_resource_info<T>(mut self, v: T) -> Self
1262 where
1263 T: std::convert::Into<rpc::model::ResourceInfo>,
1264 {
1265 self.resource_info = std::option::Option::Some(v.into());
1266 self
1267 }
1268
1269 pub fn set_or_clear_resource_info<T>(mut self, v: std::option::Option<T>) -> Self
1271 where
1272 T: std::convert::Into<rpc::model::ResourceInfo>,
1273 {
1274 self.resource_info = v.map(|x| x.into());
1275 self
1276 }
1277
1278 pub fn set_error_details<T, V>(mut self, v: T) -> Self
1280 where
1281 T: std::iter::IntoIterator<Item = V>,
1282 V: std::convert::Into<crate::model::ErrorDetail>,
1283 {
1284 use std::iter::Iterator;
1285 self.error_details = v.into_iter().map(|i| i.into()).collect();
1286 self
1287 }
1288
1289 pub fn set_error_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1291 self.error_count = v.into();
1292 self
1293 }
1294}
1295
1296impl wkt::message::Message for ResourceErrorDetail {
1297 fn typename() -> &'static str {
1298 "type.googleapis.com/google.cloud.bigquery.migration.v2.ResourceErrorDetail"
1299 }
1300}
1301
1302#[derive(Clone, Default, PartialEq)]
1305#[non_exhaustive]
1306pub struct ErrorDetail {
1307 pub location: std::option::Option<crate::model::ErrorLocation>,
1309
1310 pub error_info: std::option::Option<rpc::model::ErrorInfo>,
1312
1313 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1314}
1315
1316impl ErrorDetail {
1317 pub fn new() -> Self {
1318 std::default::Default::default()
1319 }
1320
1321 pub fn set_location<T>(mut self, v: T) -> Self
1323 where
1324 T: std::convert::Into<crate::model::ErrorLocation>,
1325 {
1326 self.location = std::option::Option::Some(v.into());
1327 self
1328 }
1329
1330 pub fn set_or_clear_location<T>(mut self, v: std::option::Option<T>) -> Self
1332 where
1333 T: std::convert::Into<crate::model::ErrorLocation>,
1334 {
1335 self.location = v.map(|x| x.into());
1336 self
1337 }
1338
1339 pub fn set_error_info<T>(mut self, v: T) -> Self
1341 where
1342 T: std::convert::Into<rpc::model::ErrorInfo>,
1343 {
1344 self.error_info = std::option::Option::Some(v.into());
1345 self
1346 }
1347
1348 pub fn set_or_clear_error_info<T>(mut self, v: std::option::Option<T>) -> Self
1350 where
1351 T: std::convert::Into<rpc::model::ErrorInfo>,
1352 {
1353 self.error_info = v.map(|x| x.into());
1354 self
1355 }
1356}
1357
1358impl wkt::message::Message for ErrorDetail {
1359 fn typename() -> &'static str {
1360 "type.googleapis.com/google.cloud.bigquery.migration.v2.ErrorDetail"
1361 }
1362}
1363
1364#[derive(Clone, Default, PartialEq)]
1366#[non_exhaustive]
1367pub struct ErrorLocation {
1368 pub line: i32,
1371
1372 pub column: i32,
1375
1376 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1377}
1378
1379impl ErrorLocation {
1380 pub fn new() -> Self {
1381 std::default::Default::default()
1382 }
1383
1384 pub fn set_line<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1386 self.line = v.into();
1387 self
1388 }
1389
1390 pub fn set_column<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1392 self.column = v.into();
1393 self
1394 }
1395}
1396
1397impl wkt::message::Message for ErrorLocation {
1398 fn typename() -> &'static str {
1399 "type.googleapis.com/google.cloud.bigquery.migration.v2.ErrorLocation"
1400 }
1401}
1402
1403#[derive(Clone, Default, PartialEq)]
1405#[non_exhaustive]
1406pub struct TimeSeries {
1407 pub metric: std::string::String,
1411
1412 pub value_type: api::model::metric_descriptor::ValueType,
1414
1415 pub metric_kind: api::model::metric_descriptor::MetricKind,
1422
1423 pub points: std::vec::Vec<crate::model::Point>,
1432
1433 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1434}
1435
1436impl TimeSeries {
1437 pub fn new() -> Self {
1438 std::default::Default::default()
1439 }
1440
1441 pub fn set_metric<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1443 self.metric = v.into();
1444 self
1445 }
1446
1447 pub fn set_value_type<T: std::convert::Into<api::model::metric_descriptor::ValueType>>(
1449 mut self,
1450 v: T,
1451 ) -> Self {
1452 self.value_type = v.into();
1453 self
1454 }
1455
1456 pub fn set_metric_kind<T: std::convert::Into<api::model::metric_descriptor::MetricKind>>(
1458 mut self,
1459 v: T,
1460 ) -> Self {
1461 self.metric_kind = v.into();
1462 self
1463 }
1464
1465 pub fn set_points<T, V>(mut self, v: T) -> Self
1467 where
1468 T: std::iter::IntoIterator<Item = V>,
1469 V: std::convert::Into<crate::model::Point>,
1470 {
1471 use std::iter::Iterator;
1472 self.points = v.into_iter().map(|i| i.into()).collect();
1473 self
1474 }
1475}
1476
1477impl wkt::message::Message for TimeSeries {
1478 fn typename() -> &'static str {
1479 "type.googleapis.com/google.cloud.bigquery.migration.v2.TimeSeries"
1480 }
1481}
1482
1483#[derive(Clone, Default, PartialEq)]
1485#[non_exhaustive]
1486pub struct Point {
1487 pub interval: std::option::Option<crate::model::TimeInterval>,
1497
1498 pub value: std::option::Option<crate::model::TypedValue>,
1500
1501 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1502}
1503
1504impl Point {
1505 pub fn new() -> Self {
1506 std::default::Default::default()
1507 }
1508
1509 pub fn set_interval<T>(mut self, v: T) -> Self
1511 where
1512 T: std::convert::Into<crate::model::TimeInterval>,
1513 {
1514 self.interval = std::option::Option::Some(v.into());
1515 self
1516 }
1517
1518 pub fn set_or_clear_interval<T>(mut self, v: std::option::Option<T>) -> Self
1520 where
1521 T: std::convert::Into<crate::model::TimeInterval>,
1522 {
1523 self.interval = v.map(|x| x.into());
1524 self
1525 }
1526
1527 pub fn set_value<T>(mut self, v: T) -> Self
1529 where
1530 T: std::convert::Into<crate::model::TypedValue>,
1531 {
1532 self.value = std::option::Option::Some(v.into());
1533 self
1534 }
1535
1536 pub fn set_or_clear_value<T>(mut self, v: std::option::Option<T>) -> Self
1538 where
1539 T: std::convert::Into<crate::model::TypedValue>,
1540 {
1541 self.value = v.map(|x| x.into());
1542 self
1543 }
1544}
1545
1546impl wkt::message::Message for Point {
1547 fn typename() -> &'static str {
1548 "type.googleapis.com/google.cloud.bigquery.migration.v2.Point"
1549 }
1550}
1551
1552#[derive(Clone, Default, PartialEq)]
1556#[non_exhaustive]
1557pub struct TimeInterval {
1558 pub start_time: std::option::Option<wkt::Timestamp>,
1562
1563 pub end_time: std::option::Option<wkt::Timestamp>,
1565
1566 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1567}
1568
1569impl TimeInterval {
1570 pub fn new() -> Self {
1571 std::default::Default::default()
1572 }
1573
1574 pub fn set_start_time<T>(mut self, v: T) -> Self
1576 where
1577 T: std::convert::Into<wkt::Timestamp>,
1578 {
1579 self.start_time = std::option::Option::Some(v.into());
1580 self
1581 }
1582
1583 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
1585 where
1586 T: std::convert::Into<wkt::Timestamp>,
1587 {
1588 self.start_time = v.map(|x| x.into());
1589 self
1590 }
1591
1592 pub fn set_end_time<T>(mut self, v: T) -> Self
1594 where
1595 T: std::convert::Into<wkt::Timestamp>,
1596 {
1597 self.end_time = std::option::Option::Some(v.into());
1598 self
1599 }
1600
1601 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
1603 where
1604 T: std::convert::Into<wkt::Timestamp>,
1605 {
1606 self.end_time = v.map(|x| x.into());
1607 self
1608 }
1609}
1610
1611impl wkt::message::Message for TimeInterval {
1612 fn typename() -> &'static str {
1613 "type.googleapis.com/google.cloud.bigquery.migration.v2.TimeInterval"
1614 }
1615}
1616
1617#[derive(Clone, Default, PartialEq)]
1619#[non_exhaustive]
1620pub struct TypedValue {
1621 pub value: std::option::Option<crate::model::typed_value::Value>,
1623
1624 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1625}
1626
1627impl TypedValue {
1628 pub fn new() -> Self {
1629 std::default::Default::default()
1630 }
1631
1632 pub fn set_value<
1637 T: std::convert::Into<std::option::Option<crate::model::typed_value::Value>>,
1638 >(
1639 mut self,
1640 v: T,
1641 ) -> Self {
1642 self.value = v.into();
1643 self
1644 }
1645
1646 pub fn bool_value(&self) -> std::option::Option<&bool> {
1650 #[allow(unreachable_patterns)]
1651 self.value.as_ref().and_then(|v| match v {
1652 crate::model::typed_value::Value::BoolValue(v) => std::option::Option::Some(v),
1653 _ => std::option::Option::None,
1654 })
1655 }
1656
1657 pub fn set_bool_value<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1663 self.value =
1664 std::option::Option::Some(crate::model::typed_value::Value::BoolValue(v.into()));
1665 self
1666 }
1667
1668 pub fn int64_value(&self) -> std::option::Option<&i64> {
1672 #[allow(unreachable_patterns)]
1673 self.value.as_ref().and_then(|v| match v {
1674 crate::model::typed_value::Value::Int64Value(v) => std::option::Option::Some(v),
1675 _ => std::option::Option::None,
1676 })
1677 }
1678
1679 pub fn set_int64_value<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1685 self.value =
1686 std::option::Option::Some(crate::model::typed_value::Value::Int64Value(v.into()));
1687 self
1688 }
1689
1690 pub fn double_value(&self) -> std::option::Option<&f64> {
1694 #[allow(unreachable_patterns)]
1695 self.value.as_ref().and_then(|v| match v {
1696 crate::model::typed_value::Value::DoubleValue(v) => std::option::Option::Some(v),
1697 _ => std::option::Option::None,
1698 })
1699 }
1700
1701 pub fn set_double_value<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
1707 self.value =
1708 std::option::Option::Some(crate::model::typed_value::Value::DoubleValue(v.into()));
1709 self
1710 }
1711
1712 pub fn string_value(&self) -> std::option::Option<&std::string::String> {
1716 #[allow(unreachable_patterns)]
1717 self.value.as_ref().and_then(|v| match v {
1718 crate::model::typed_value::Value::StringValue(v) => std::option::Option::Some(v),
1719 _ => std::option::Option::None,
1720 })
1721 }
1722
1723 pub fn set_string_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1729 self.value =
1730 std::option::Option::Some(crate::model::typed_value::Value::StringValue(v.into()));
1731 self
1732 }
1733
1734 pub fn distribution_value(
1738 &self,
1739 ) -> std::option::Option<&std::boxed::Box<api::model::Distribution>> {
1740 #[allow(unreachable_patterns)]
1741 self.value.as_ref().and_then(|v| match v {
1742 crate::model::typed_value::Value::DistributionValue(v) => std::option::Option::Some(v),
1743 _ => std::option::Option::None,
1744 })
1745 }
1746
1747 pub fn set_distribution_value<
1753 T: std::convert::Into<std::boxed::Box<api::model::Distribution>>,
1754 >(
1755 mut self,
1756 v: T,
1757 ) -> Self {
1758 self.value = std::option::Option::Some(
1759 crate::model::typed_value::Value::DistributionValue(v.into()),
1760 );
1761 self
1762 }
1763}
1764
1765impl wkt::message::Message for TypedValue {
1766 fn typename() -> &'static str {
1767 "type.googleapis.com/google.cloud.bigquery.migration.v2.TypedValue"
1768 }
1769}
1770
1771pub mod typed_value {
1773 #[allow(unused_imports)]
1774 use super::*;
1775
1776 #[derive(Clone, Debug, PartialEq)]
1778 #[non_exhaustive]
1779 pub enum Value {
1780 BoolValue(bool),
1782 Int64Value(i64),
1784 DoubleValue(f64),
1788 StringValue(std::string::String),
1790 DistributionValue(std::boxed::Box<api::model::Distribution>),
1792 }
1793}
1794
1795#[derive(Clone, Default, PartialEq)]
1797#[non_exhaustive]
1798pub struct CreateMigrationWorkflowRequest {
1799 pub parent: std::string::String,
1802
1803 pub migration_workflow: std::option::Option<crate::model::MigrationWorkflow>,
1805
1806 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1807}
1808
1809impl CreateMigrationWorkflowRequest {
1810 pub fn new() -> Self {
1811 std::default::Default::default()
1812 }
1813
1814 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1816 self.parent = v.into();
1817 self
1818 }
1819
1820 pub fn set_migration_workflow<T>(mut self, v: T) -> Self
1822 where
1823 T: std::convert::Into<crate::model::MigrationWorkflow>,
1824 {
1825 self.migration_workflow = std::option::Option::Some(v.into());
1826 self
1827 }
1828
1829 pub fn set_or_clear_migration_workflow<T>(mut self, v: std::option::Option<T>) -> Self
1831 where
1832 T: std::convert::Into<crate::model::MigrationWorkflow>,
1833 {
1834 self.migration_workflow = v.map(|x| x.into());
1835 self
1836 }
1837}
1838
1839impl wkt::message::Message for CreateMigrationWorkflowRequest {
1840 fn typename() -> &'static str {
1841 "type.googleapis.com/google.cloud.bigquery.migration.v2.CreateMigrationWorkflowRequest"
1842 }
1843}
1844
1845#[derive(Clone, Default, PartialEq)]
1847#[non_exhaustive]
1848pub struct GetMigrationWorkflowRequest {
1849 pub name: std::string::String,
1852
1853 pub read_mask: std::option::Option<wkt::FieldMask>,
1855
1856 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1857}
1858
1859impl GetMigrationWorkflowRequest {
1860 pub fn new() -> Self {
1861 std::default::Default::default()
1862 }
1863
1864 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1866 self.name = v.into();
1867 self
1868 }
1869
1870 pub fn set_read_mask<T>(mut self, v: T) -> Self
1872 where
1873 T: std::convert::Into<wkt::FieldMask>,
1874 {
1875 self.read_mask = std::option::Option::Some(v.into());
1876 self
1877 }
1878
1879 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
1881 where
1882 T: std::convert::Into<wkt::FieldMask>,
1883 {
1884 self.read_mask = v.map(|x| x.into());
1885 self
1886 }
1887}
1888
1889impl wkt::message::Message for GetMigrationWorkflowRequest {
1890 fn typename() -> &'static str {
1891 "type.googleapis.com/google.cloud.bigquery.migration.v2.GetMigrationWorkflowRequest"
1892 }
1893}
1894
1895#[derive(Clone, Default, PartialEq)]
1897#[non_exhaustive]
1898pub struct ListMigrationWorkflowsRequest {
1899 pub parent: std::string::String,
1902
1903 pub read_mask: std::option::Option<wkt::FieldMask>,
1905
1906 pub page_size: i32,
1909
1910 pub page_token: std::string::String,
1916
1917 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1918}
1919
1920impl ListMigrationWorkflowsRequest {
1921 pub fn new() -> Self {
1922 std::default::Default::default()
1923 }
1924
1925 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1927 self.parent = v.into();
1928 self
1929 }
1930
1931 pub fn set_read_mask<T>(mut self, v: T) -> Self
1933 where
1934 T: std::convert::Into<wkt::FieldMask>,
1935 {
1936 self.read_mask = std::option::Option::Some(v.into());
1937 self
1938 }
1939
1940 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
1942 where
1943 T: std::convert::Into<wkt::FieldMask>,
1944 {
1945 self.read_mask = v.map(|x| x.into());
1946 self
1947 }
1948
1949 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1951 self.page_size = v.into();
1952 self
1953 }
1954
1955 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1957 self.page_token = v.into();
1958 self
1959 }
1960}
1961
1962impl wkt::message::Message for ListMigrationWorkflowsRequest {
1963 fn typename() -> &'static str {
1964 "type.googleapis.com/google.cloud.bigquery.migration.v2.ListMigrationWorkflowsRequest"
1965 }
1966}
1967
1968#[derive(Clone, Default, PartialEq)]
1970#[non_exhaustive]
1971pub struct ListMigrationWorkflowsResponse {
1972 pub migration_workflows: std::vec::Vec<crate::model::MigrationWorkflow>,
1974
1975 pub next_page_token: std::string::String,
1978
1979 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1980}
1981
1982impl ListMigrationWorkflowsResponse {
1983 pub fn new() -> Self {
1984 std::default::Default::default()
1985 }
1986
1987 pub fn set_migration_workflows<T, V>(mut self, v: T) -> Self
1989 where
1990 T: std::iter::IntoIterator<Item = V>,
1991 V: std::convert::Into<crate::model::MigrationWorkflow>,
1992 {
1993 use std::iter::Iterator;
1994 self.migration_workflows = v.into_iter().map(|i| i.into()).collect();
1995 self
1996 }
1997
1998 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2000 self.next_page_token = v.into();
2001 self
2002 }
2003}
2004
2005impl wkt::message::Message for ListMigrationWorkflowsResponse {
2006 fn typename() -> &'static str {
2007 "type.googleapis.com/google.cloud.bigquery.migration.v2.ListMigrationWorkflowsResponse"
2008 }
2009}
2010
2011#[doc(hidden)]
2012impl gax::paginator::internal::PageableResponse for ListMigrationWorkflowsResponse {
2013 type PageItem = crate::model::MigrationWorkflow;
2014
2015 fn items(self) -> std::vec::Vec<Self::PageItem> {
2016 self.migration_workflows
2017 }
2018
2019 fn next_page_token(&self) -> std::string::String {
2020 use std::clone::Clone;
2021 self.next_page_token.clone()
2022 }
2023}
2024
2025#[derive(Clone, Default, PartialEq)]
2027#[non_exhaustive]
2028pub struct DeleteMigrationWorkflowRequest {
2029 pub name: std::string::String,
2032
2033 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2034}
2035
2036impl DeleteMigrationWorkflowRequest {
2037 pub fn new() -> Self {
2038 std::default::Default::default()
2039 }
2040
2041 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2043 self.name = v.into();
2044 self
2045 }
2046}
2047
2048impl wkt::message::Message for DeleteMigrationWorkflowRequest {
2049 fn typename() -> &'static str {
2050 "type.googleapis.com/google.cloud.bigquery.migration.v2.DeleteMigrationWorkflowRequest"
2051 }
2052}
2053
2054#[derive(Clone, Default, PartialEq)]
2056#[non_exhaustive]
2057pub struct StartMigrationWorkflowRequest {
2058 pub name: std::string::String,
2061
2062 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2063}
2064
2065impl StartMigrationWorkflowRequest {
2066 pub fn new() -> Self {
2067 std::default::Default::default()
2068 }
2069
2070 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2072 self.name = v.into();
2073 self
2074 }
2075}
2076
2077impl wkt::message::Message for StartMigrationWorkflowRequest {
2078 fn typename() -> &'static str {
2079 "type.googleapis.com/google.cloud.bigquery.migration.v2.StartMigrationWorkflowRequest"
2080 }
2081}
2082
2083#[derive(Clone, Default, PartialEq)]
2085#[non_exhaustive]
2086pub struct GetMigrationSubtaskRequest {
2087 pub name: std::string::String,
2090
2091 pub read_mask: std::option::Option<wkt::FieldMask>,
2093
2094 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2095}
2096
2097impl GetMigrationSubtaskRequest {
2098 pub fn new() -> Self {
2099 std::default::Default::default()
2100 }
2101
2102 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2104 self.name = v.into();
2105 self
2106 }
2107
2108 pub fn set_read_mask<T>(mut self, v: T) -> Self
2110 where
2111 T: std::convert::Into<wkt::FieldMask>,
2112 {
2113 self.read_mask = std::option::Option::Some(v.into());
2114 self
2115 }
2116
2117 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
2119 where
2120 T: std::convert::Into<wkt::FieldMask>,
2121 {
2122 self.read_mask = v.map(|x| x.into());
2123 self
2124 }
2125}
2126
2127impl wkt::message::Message for GetMigrationSubtaskRequest {
2128 fn typename() -> &'static str {
2129 "type.googleapis.com/google.cloud.bigquery.migration.v2.GetMigrationSubtaskRequest"
2130 }
2131}
2132
2133#[derive(Clone, Default, PartialEq)]
2135#[non_exhaustive]
2136pub struct ListMigrationSubtasksRequest {
2137 pub parent: std::string::String,
2140
2141 pub read_mask: std::option::Option<wkt::FieldMask>,
2143
2144 pub page_size: i32,
2147
2148 pub page_token: std::string::String,
2154
2155 pub filter: std::string::String,
2159
2160 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2161}
2162
2163impl ListMigrationSubtasksRequest {
2164 pub fn new() -> Self {
2165 std::default::Default::default()
2166 }
2167
2168 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2170 self.parent = v.into();
2171 self
2172 }
2173
2174 pub fn set_read_mask<T>(mut self, v: T) -> Self
2176 where
2177 T: std::convert::Into<wkt::FieldMask>,
2178 {
2179 self.read_mask = std::option::Option::Some(v.into());
2180 self
2181 }
2182
2183 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
2185 where
2186 T: std::convert::Into<wkt::FieldMask>,
2187 {
2188 self.read_mask = v.map(|x| x.into());
2189 self
2190 }
2191
2192 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2194 self.page_size = v.into();
2195 self
2196 }
2197
2198 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2200 self.page_token = v.into();
2201 self
2202 }
2203
2204 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2206 self.filter = v.into();
2207 self
2208 }
2209}
2210
2211impl wkt::message::Message for ListMigrationSubtasksRequest {
2212 fn typename() -> &'static str {
2213 "type.googleapis.com/google.cloud.bigquery.migration.v2.ListMigrationSubtasksRequest"
2214 }
2215}
2216
2217#[derive(Clone, Default, PartialEq)]
2219#[non_exhaustive]
2220pub struct ListMigrationSubtasksResponse {
2221 pub migration_subtasks: std::vec::Vec<crate::model::MigrationSubtask>,
2223
2224 pub next_page_token: std::string::String,
2227
2228 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2229}
2230
2231impl ListMigrationSubtasksResponse {
2232 pub fn new() -> Self {
2233 std::default::Default::default()
2234 }
2235
2236 pub fn set_migration_subtasks<T, V>(mut self, v: T) -> Self
2238 where
2239 T: std::iter::IntoIterator<Item = V>,
2240 V: std::convert::Into<crate::model::MigrationSubtask>,
2241 {
2242 use std::iter::Iterator;
2243 self.migration_subtasks = v.into_iter().map(|i| i.into()).collect();
2244 self
2245 }
2246
2247 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2249 self.next_page_token = v.into();
2250 self
2251 }
2252}
2253
2254impl wkt::message::Message for ListMigrationSubtasksResponse {
2255 fn typename() -> &'static str {
2256 "type.googleapis.com/google.cloud.bigquery.migration.v2.ListMigrationSubtasksResponse"
2257 }
2258}
2259
2260#[doc(hidden)]
2261impl gax::paginator::internal::PageableResponse for ListMigrationSubtasksResponse {
2262 type PageItem = crate::model::MigrationSubtask;
2263
2264 fn items(self) -> std::vec::Vec<Self::PageItem> {
2265 self.migration_subtasks
2266 }
2267
2268 fn next_page_token(&self) -> std::string::String {
2269 use std::clone::Clone;
2270 self.next_page_token.clone()
2271 }
2272}
2273
2274#[derive(Clone, Default, PartialEq)]
2277#[non_exhaustive]
2278pub struct TranslationConfigDetails {
2279 pub source_dialect: std::option::Option<crate::model::Dialect>,
2281
2282 pub target_dialect: std::option::Option<crate::model::Dialect>,
2284
2285 pub source_env: std::option::Option<crate::model::SourceEnv>,
2287
2288 pub request_source: std::string::String,
2290
2291 pub target_types: std::vec::Vec<std::string::String>,
2296
2297 pub source_location:
2299 std::option::Option<crate::model::translation_config_details::SourceLocation>,
2300
2301 pub target_location:
2303 std::option::Option<crate::model::translation_config_details::TargetLocation>,
2304
2305 pub output_name_mapping:
2308 std::option::Option<crate::model::translation_config_details::OutputNameMapping>,
2309
2310 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2311}
2312
2313impl TranslationConfigDetails {
2314 pub fn new() -> Self {
2315 std::default::Default::default()
2316 }
2317
2318 pub fn set_source_dialect<T>(mut self, v: T) -> Self
2320 where
2321 T: std::convert::Into<crate::model::Dialect>,
2322 {
2323 self.source_dialect = std::option::Option::Some(v.into());
2324 self
2325 }
2326
2327 pub fn set_or_clear_source_dialect<T>(mut self, v: std::option::Option<T>) -> Self
2329 where
2330 T: std::convert::Into<crate::model::Dialect>,
2331 {
2332 self.source_dialect = v.map(|x| x.into());
2333 self
2334 }
2335
2336 pub fn set_target_dialect<T>(mut self, v: T) -> Self
2338 where
2339 T: std::convert::Into<crate::model::Dialect>,
2340 {
2341 self.target_dialect = std::option::Option::Some(v.into());
2342 self
2343 }
2344
2345 pub fn set_or_clear_target_dialect<T>(mut self, v: std::option::Option<T>) -> Self
2347 where
2348 T: std::convert::Into<crate::model::Dialect>,
2349 {
2350 self.target_dialect = v.map(|x| x.into());
2351 self
2352 }
2353
2354 pub fn set_source_env<T>(mut self, v: T) -> Self
2356 where
2357 T: std::convert::Into<crate::model::SourceEnv>,
2358 {
2359 self.source_env = std::option::Option::Some(v.into());
2360 self
2361 }
2362
2363 pub fn set_or_clear_source_env<T>(mut self, v: std::option::Option<T>) -> Self
2365 where
2366 T: std::convert::Into<crate::model::SourceEnv>,
2367 {
2368 self.source_env = v.map(|x| x.into());
2369 self
2370 }
2371
2372 pub fn set_request_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2374 self.request_source = v.into();
2375 self
2376 }
2377
2378 pub fn set_target_types<T, V>(mut self, v: T) -> Self
2380 where
2381 T: std::iter::IntoIterator<Item = V>,
2382 V: std::convert::Into<std::string::String>,
2383 {
2384 use std::iter::Iterator;
2385 self.target_types = v.into_iter().map(|i| i.into()).collect();
2386 self
2387 }
2388
2389 pub fn set_source_location<
2394 T: std::convert::Into<
2395 std::option::Option<crate::model::translation_config_details::SourceLocation>,
2396 >,
2397 >(
2398 mut self,
2399 v: T,
2400 ) -> Self {
2401 self.source_location = v.into();
2402 self
2403 }
2404
2405 pub fn gcs_source_path(&self) -> std::option::Option<&std::string::String> {
2409 #[allow(unreachable_patterns)]
2410 self.source_location.as_ref().and_then(|v| match v {
2411 crate::model::translation_config_details::SourceLocation::GcsSourcePath(v) => {
2412 std::option::Option::Some(v)
2413 }
2414 _ => std::option::Option::None,
2415 })
2416 }
2417
2418 pub fn set_gcs_source_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2424 self.source_location = std::option::Option::Some(
2425 crate::model::translation_config_details::SourceLocation::GcsSourcePath(v.into()),
2426 );
2427 self
2428 }
2429
2430 pub fn set_target_location<
2435 T: std::convert::Into<
2436 std::option::Option<crate::model::translation_config_details::TargetLocation>,
2437 >,
2438 >(
2439 mut self,
2440 v: T,
2441 ) -> Self {
2442 self.target_location = v.into();
2443 self
2444 }
2445
2446 pub fn gcs_target_path(&self) -> std::option::Option<&std::string::String> {
2450 #[allow(unreachable_patterns)]
2451 self.target_location.as_ref().and_then(|v| match v {
2452 crate::model::translation_config_details::TargetLocation::GcsTargetPath(v) => {
2453 std::option::Option::Some(v)
2454 }
2455 _ => std::option::Option::None,
2456 })
2457 }
2458
2459 pub fn set_gcs_target_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2465 self.target_location = std::option::Option::Some(
2466 crate::model::translation_config_details::TargetLocation::GcsTargetPath(v.into()),
2467 );
2468 self
2469 }
2470
2471 pub fn set_output_name_mapping<
2476 T: std::convert::Into<
2477 std::option::Option<crate::model::translation_config_details::OutputNameMapping>,
2478 >,
2479 >(
2480 mut self,
2481 v: T,
2482 ) -> Self {
2483 self.output_name_mapping = v.into();
2484 self
2485 }
2486
2487 pub fn name_mapping_list(
2491 &self,
2492 ) -> std::option::Option<&std::boxed::Box<crate::model::ObjectNameMappingList>> {
2493 #[allow(unreachable_patterns)]
2494 self.output_name_mapping.as_ref().and_then(|v| match v {
2495 crate::model::translation_config_details::OutputNameMapping::NameMappingList(v) => {
2496 std::option::Option::Some(v)
2497 }
2498 _ => std::option::Option::None,
2499 })
2500 }
2501
2502 pub fn set_name_mapping_list<
2508 T: std::convert::Into<std::boxed::Box<crate::model::ObjectNameMappingList>>,
2509 >(
2510 mut self,
2511 v: T,
2512 ) -> Self {
2513 self.output_name_mapping = std::option::Option::Some(
2514 crate::model::translation_config_details::OutputNameMapping::NameMappingList(v.into()),
2515 );
2516 self
2517 }
2518}
2519
2520impl wkt::message::Message for TranslationConfigDetails {
2521 fn typename() -> &'static str {
2522 "type.googleapis.com/google.cloud.bigquery.migration.v2.TranslationConfigDetails"
2523 }
2524}
2525
2526pub mod translation_config_details {
2528 #[allow(unused_imports)]
2529 use super::*;
2530
2531 #[derive(Clone, Debug, PartialEq)]
2533 #[non_exhaustive]
2534 pub enum SourceLocation {
2535 GcsSourcePath(std::string::String),
2537 }
2538
2539 #[derive(Clone, Debug, PartialEq)]
2541 #[non_exhaustive]
2542 pub enum TargetLocation {
2543 GcsTargetPath(std::string::String),
2545 }
2546
2547 #[derive(Clone, Debug, PartialEq)]
2550 #[non_exhaustive]
2551 pub enum OutputNameMapping {
2552 NameMappingList(std::boxed::Box<crate::model::ObjectNameMappingList>),
2554 }
2555}
2556
2557#[derive(Clone, Default, PartialEq)]
2559#[non_exhaustive]
2560pub struct Dialect {
2561 pub dialect_value: std::option::Option<crate::model::dialect::DialectValue>,
2563
2564 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2565}
2566
2567impl Dialect {
2568 pub fn new() -> Self {
2569 std::default::Default::default()
2570 }
2571
2572 pub fn set_dialect_value<
2577 T: std::convert::Into<std::option::Option<crate::model::dialect::DialectValue>>,
2578 >(
2579 mut self,
2580 v: T,
2581 ) -> Self {
2582 self.dialect_value = v.into();
2583 self
2584 }
2585
2586 pub fn bigquery_dialect(
2590 &self,
2591 ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryDialect>> {
2592 #[allow(unreachable_patterns)]
2593 self.dialect_value.as_ref().and_then(|v| match v {
2594 crate::model::dialect::DialectValue::BigqueryDialect(v) => std::option::Option::Some(v),
2595 _ => std::option::Option::None,
2596 })
2597 }
2598
2599 pub fn set_bigquery_dialect<
2605 T: std::convert::Into<std::boxed::Box<crate::model::BigQueryDialect>>,
2606 >(
2607 mut self,
2608 v: T,
2609 ) -> Self {
2610 self.dialect_value = std::option::Option::Some(
2611 crate::model::dialect::DialectValue::BigqueryDialect(v.into()),
2612 );
2613 self
2614 }
2615
2616 pub fn hiveql_dialect(
2620 &self,
2621 ) -> std::option::Option<&std::boxed::Box<crate::model::HiveQLDialect>> {
2622 #[allow(unreachable_patterns)]
2623 self.dialect_value.as_ref().and_then(|v| match v {
2624 crate::model::dialect::DialectValue::HiveqlDialect(v) => std::option::Option::Some(v),
2625 _ => std::option::Option::None,
2626 })
2627 }
2628
2629 pub fn set_hiveql_dialect<
2635 T: std::convert::Into<std::boxed::Box<crate::model::HiveQLDialect>>,
2636 >(
2637 mut self,
2638 v: T,
2639 ) -> Self {
2640 self.dialect_value =
2641 std::option::Option::Some(crate::model::dialect::DialectValue::HiveqlDialect(v.into()));
2642 self
2643 }
2644
2645 pub fn redshift_dialect(
2649 &self,
2650 ) -> std::option::Option<&std::boxed::Box<crate::model::RedshiftDialect>> {
2651 #[allow(unreachable_patterns)]
2652 self.dialect_value.as_ref().and_then(|v| match v {
2653 crate::model::dialect::DialectValue::RedshiftDialect(v) => std::option::Option::Some(v),
2654 _ => std::option::Option::None,
2655 })
2656 }
2657
2658 pub fn set_redshift_dialect<
2664 T: std::convert::Into<std::boxed::Box<crate::model::RedshiftDialect>>,
2665 >(
2666 mut self,
2667 v: T,
2668 ) -> Self {
2669 self.dialect_value = std::option::Option::Some(
2670 crate::model::dialect::DialectValue::RedshiftDialect(v.into()),
2671 );
2672 self
2673 }
2674
2675 pub fn teradata_dialect(
2679 &self,
2680 ) -> std::option::Option<&std::boxed::Box<crate::model::TeradataDialect>> {
2681 #[allow(unreachable_patterns)]
2682 self.dialect_value.as_ref().and_then(|v| match v {
2683 crate::model::dialect::DialectValue::TeradataDialect(v) => std::option::Option::Some(v),
2684 _ => std::option::Option::None,
2685 })
2686 }
2687
2688 pub fn set_teradata_dialect<
2694 T: std::convert::Into<std::boxed::Box<crate::model::TeradataDialect>>,
2695 >(
2696 mut self,
2697 v: T,
2698 ) -> Self {
2699 self.dialect_value = std::option::Option::Some(
2700 crate::model::dialect::DialectValue::TeradataDialect(v.into()),
2701 );
2702 self
2703 }
2704
2705 pub fn oracle_dialect(
2709 &self,
2710 ) -> std::option::Option<&std::boxed::Box<crate::model::OracleDialect>> {
2711 #[allow(unreachable_patterns)]
2712 self.dialect_value.as_ref().and_then(|v| match v {
2713 crate::model::dialect::DialectValue::OracleDialect(v) => std::option::Option::Some(v),
2714 _ => std::option::Option::None,
2715 })
2716 }
2717
2718 pub fn set_oracle_dialect<
2724 T: std::convert::Into<std::boxed::Box<crate::model::OracleDialect>>,
2725 >(
2726 mut self,
2727 v: T,
2728 ) -> Self {
2729 self.dialect_value =
2730 std::option::Option::Some(crate::model::dialect::DialectValue::OracleDialect(v.into()));
2731 self
2732 }
2733
2734 pub fn sparksql_dialect(
2738 &self,
2739 ) -> std::option::Option<&std::boxed::Box<crate::model::SparkSQLDialect>> {
2740 #[allow(unreachable_patterns)]
2741 self.dialect_value.as_ref().and_then(|v| match v {
2742 crate::model::dialect::DialectValue::SparksqlDialect(v) => std::option::Option::Some(v),
2743 _ => std::option::Option::None,
2744 })
2745 }
2746
2747 pub fn set_sparksql_dialect<
2753 T: std::convert::Into<std::boxed::Box<crate::model::SparkSQLDialect>>,
2754 >(
2755 mut self,
2756 v: T,
2757 ) -> Self {
2758 self.dialect_value = std::option::Option::Some(
2759 crate::model::dialect::DialectValue::SparksqlDialect(v.into()),
2760 );
2761 self
2762 }
2763
2764 pub fn snowflake_dialect(
2768 &self,
2769 ) -> std::option::Option<&std::boxed::Box<crate::model::SnowflakeDialect>> {
2770 #[allow(unreachable_patterns)]
2771 self.dialect_value.as_ref().and_then(|v| match v {
2772 crate::model::dialect::DialectValue::SnowflakeDialect(v) => {
2773 std::option::Option::Some(v)
2774 }
2775 _ => std::option::Option::None,
2776 })
2777 }
2778
2779 pub fn set_snowflake_dialect<
2785 T: std::convert::Into<std::boxed::Box<crate::model::SnowflakeDialect>>,
2786 >(
2787 mut self,
2788 v: T,
2789 ) -> Self {
2790 self.dialect_value = std::option::Option::Some(
2791 crate::model::dialect::DialectValue::SnowflakeDialect(v.into()),
2792 );
2793 self
2794 }
2795
2796 pub fn netezza_dialect(
2800 &self,
2801 ) -> std::option::Option<&std::boxed::Box<crate::model::NetezzaDialect>> {
2802 #[allow(unreachable_patterns)]
2803 self.dialect_value.as_ref().and_then(|v| match v {
2804 crate::model::dialect::DialectValue::NetezzaDialect(v) => std::option::Option::Some(v),
2805 _ => std::option::Option::None,
2806 })
2807 }
2808
2809 pub fn set_netezza_dialect<
2815 T: std::convert::Into<std::boxed::Box<crate::model::NetezzaDialect>>,
2816 >(
2817 mut self,
2818 v: T,
2819 ) -> Self {
2820 self.dialect_value = std::option::Option::Some(
2821 crate::model::dialect::DialectValue::NetezzaDialect(v.into()),
2822 );
2823 self
2824 }
2825
2826 pub fn azure_synapse_dialect(
2830 &self,
2831 ) -> std::option::Option<&std::boxed::Box<crate::model::AzureSynapseDialect>> {
2832 #[allow(unreachable_patterns)]
2833 self.dialect_value.as_ref().and_then(|v| match v {
2834 crate::model::dialect::DialectValue::AzureSynapseDialect(v) => {
2835 std::option::Option::Some(v)
2836 }
2837 _ => std::option::Option::None,
2838 })
2839 }
2840
2841 pub fn set_azure_synapse_dialect<
2847 T: std::convert::Into<std::boxed::Box<crate::model::AzureSynapseDialect>>,
2848 >(
2849 mut self,
2850 v: T,
2851 ) -> Self {
2852 self.dialect_value = std::option::Option::Some(
2853 crate::model::dialect::DialectValue::AzureSynapseDialect(v.into()),
2854 );
2855 self
2856 }
2857
2858 pub fn vertica_dialect(
2862 &self,
2863 ) -> std::option::Option<&std::boxed::Box<crate::model::VerticaDialect>> {
2864 #[allow(unreachable_patterns)]
2865 self.dialect_value.as_ref().and_then(|v| match v {
2866 crate::model::dialect::DialectValue::VerticaDialect(v) => std::option::Option::Some(v),
2867 _ => std::option::Option::None,
2868 })
2869 }
2870
2871 pub fn set_vertica_dialect<
2877 T: std::convert::Into<std::boxed::Box<crate::model::VerticaDialect>>,
2878 >(
2879 mut self,
2880 v: T,
2881 ) -> Self {
2882 self.dialect_value = std::option::Option::Some(
2883 crate::model::dialect::DialectValue::VerticaDialect(v.into()),
2884 );
2885 self
2886 }
2887
2888 pub fn sql_server_dialect(
2892 &self,
2893 ) -> std::option::Option<&std::boxed::Box<crate::model::SQLServerDialect>> {
2894 #[allow(unreachable_patterns)]
2895 self.dialect_value.as_ref().and_then(|v| match v {
2896 crate::model::dialect::DialectValue::SqlServerDialect(v) => {
2897 std::option::Option::Some(v)
2898 }
2899 _ => std::option::Option::None,
2900 })
2901 }
2902
2903 pub fn set_sql_server_dialect<
2909 T: std::convert::Into<std::boxed::Box<crate::model::SQLServerDialect>>,
2910 >(
2911 mut self,
2912 v: T,
2913 ) -> Self {
2914 self.dialect_value = std::option::Option::Some(
2915 crate::model::dialect::DialectValue::SqlServerDialect(v.into()),
2916 );
2917 self
2918 }
2919
2920 pub fn postgresql_dialect(
2924 &self,
2925 ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlDialect>> {
2926 #[allow(unreachable_patterns)]
2927 self.dialect_value.as_ref().and_then(|v| match v {
2928 crate::model::dialect::DialectValue::PostgresqlDialect(v) => {
2929 std::option::Option::Some(v)
2930 }
2931 _ => std::option::Option::None,
2932 })
2933 }
2934
2935 pub fn set_postgresql_dialect<
2941 T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlDialect>>,
2942 >(
2943 mut self,
2944 v: T,
2945 ) -> Self {
2946 self.dialect_value = std::option::Option::Some(
2947 crate::model::dialect::DialectValue::PostgresqlDialect(v.into()),
2948 );
2949 self
2950 }
2951
2952 pub fn presto_dialect(
2956 &self,
2957 ) -> std::option::Option<&std::boxed::Box<crate::model::PrestoDialect>> {
2958 #[allow(unreachable_patterns)]
2959 self.dialect_value.as_ref().and_then(|v| match v {
2960 crate::model::dialect::DialectValue::PrestoDialect(v) => std::option::Option::Some(v),
2961 _ => std::option::Option::None,
2962 })
2963 }
2964
2965 pub fn set_presto_dialect<
2971 T: std::convert::Into<std::boxed::Box<crate::model::PrestoDialect>>,
2972 >(
2973 mut self,
2974 v: T,
2975 ) -> Self {
2976 self.dialect_value =
2977 std::option::Option::Some(crate::model::dialect::DialectValue::PrestoDialect(v.into()));
2978 self
2979 }
2980
2981 pub fn mysql_dialect(
2985 &self,
2986 ) -> std::option::Option<&std::boxed::Box<crate::model::MySQLDialect>> {
2987 #[allow(unreachable_patterns)]
2988 self.dialect_value.as_ref().and_then(|v| match v {
2989 crate::model::dialect::DialectValue::MysqlDialect(v) => std::option::Option::Some(v),
2990 _ => std::option::Option::None,
2991 })
2992 }
2993
2994 pub fn set_mysql_dialect<T: std::convert::Into<std::boxed::Box<crate::model::MySQLDialect>>>(
3000 mut self,
3001 v: T,
3002 ) -> Self {
3003 self.dialect_value =
3004 std::option::Option::Some(crate::model::dialect::DialectValue::MysqlDialect(v.into()));
3005 self
3006 }
3007
3008 pub fn db2_dialect(&self) -> std::option::Option<&std::boxed::Box<crate::model::DB2Dialect>> {
3012 #[allow(unreachable_patterns)]
3013 self.dialect_value.as_ref().and_then(|v| match v {
3014 crate::model::dialect::DialectValue::Db2Dialect(v) => std::option::Option::Some(v),
3015 _ => std::option::Option::None,
3016 })
3017 }
3018
3019 pub fn set_db2_dialect<T: std::convert::Into<std::boxed::Box<crate::model::DB2Dialect>>>(
3025 mut self,
3026 v: T,
3027 ) -> Self {
3028 self.dialect_value =
3029 std::option::Option::Some(crate::model::dialect::DialectValue::Db2Dialect(v.into()));
3030 self
3031 }
3032
3033 pub fn sqlite_dialect(
3037 &self,
3038 ) -> std::option::Option<&std::boxed::Box<crate::model::SQLiteDialect>> {
3039 #[allow(unreachable_patterns)]
3040 self.dialect_value.as_ref().and_then(|v| match v {
3041 crate::model::dialect::DialectValue::SqliteDialect(v) => std::option::Option::Some(v),
3042 _ => std::option::Option::None,
3043 })
3044 }
3045
3046 pub fn set_sqlite_dialect<
3052 T: std::convert::Into<std::boxed::Box<crate::model::SQLiteDialect>>,
3053 >(
3054 mut self,
3055 v: T,
3056 ) -> Self {
3057 self.dialect_value =
3058 std::option::Option::Some(crate::model::dialect::DialectValue::SqliteDialect(v.into()));
3059 self
3060 }
3061
3062 pub fn greenplum_dialect(
3066 &self,
3067 ) -> std::option::Option<&std::boxed::Box<crate::model::GreenplumDialect>> {
3068 #[allow(unreachable_patterns)]
3069 self.dialect_value.as_ref().and_then(|v| match v {
3070 crate::model::dialect::DialectValue::GreenplumDialect(v) => {
3071 std::option::Option::Some(v)
3072 }
3073 _ => std::option::Option::None,
3074 })
3075 }
3076
3077 pub fn set_greenplum_dialect<
3083 T: std::convert::Into<std::boxed::Box<crate::model::GreenplumDialect>>,
3084 >(
3085 mut self,
3086 v: T,
3087 ) -> Self {
3088 self.dialect_value = std::option::Option::Some(
3089 crate::model::dialect::DialectValue::GreenplumDialect(v.into()),
3090 );
3091 self
3092 }
3093}
3094
3095impl wkt::message::Message for Dialect {
3096 fn typename() -> &'static str {
3097 "type.googleapis.com/google.cloud.bigquery.migration.v2.Dialect"
3098 }
3099}
3100
3101pub mod dialect {
3103 #[allow(unused_imports)]
3104 use super::*;
3105
3106 #[derive(Clone, Debug, PartialEq)]
3108 #[non_exhaustive]
3109 pub enum DialectValue {
3110 BigqueryDialect(std::boxed::Box<crate::model::BigQueryDialect>),
3112 HiveqlDialect(std::boxed::Box<crate::model::HiveQLDialect>),
3114 RedshiftDialect(std::boxed::Box<crate::model::RedshiftDialect>),
3116 TeradataDialect(std::boxed::Box<crate::model::TeradataDialect>),
3118 OracleDialect(std::boxed::Box<crate::model::OracleDialect>),
3120 SparksqlDialect(std::boxed::Box<crate::model::SparkSQLDialect>),
3122 SnowflakeDialect(std::boxed::Box<crate::model::SnowflakeDialect>),
3124 NetezzaDialect(std::boxed::Box<crate::model::NetezzaDialect>),
3126 AzureSynapseDialect(std::boxed::Box<crate::model::AzureSynapseDialect>),
3128 VerticaDialect(std::boxed::Box<crate::model::VerticaDialect>),
3130 SqlServerDialect(std::boxed::Box<crate::model::SQLServerDialect>),
3132 PostgresqlDialect(std::boxed::Box<crate::model::PostgresqlDialect>),
3134 PrestoDialect(std::boxed::Box<crate::model::PrestoDialect>),
3136 MysqlDialect(std::boxed::Box<crate::model::MySQLDialect>),
3138 Db2Dialect(std::boxed::Box<crate::model::DB2Dialect>),
3140 SqliteDialect(std::boxed::Box<crate::model::SQLiteDialect>),
3142 GreenplumDialect(std::boxed::Box<crate::model::GreenplumDialect>),
3144 }
3145}
3146
3147#[derive(Clone, Default, PartialEq)]
3149#[non_exhaustive]
3150pub struct BigQueryDialect {
3151 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3152}
3153
3154impl BigQueryDialect {
3155 pub fn new() -> Self {
3156 std::default::Default::default()
3157 }
3158}
3159
3160impl wkt::message::Message for BigQueryDialect {
3161 fn typename() -> &'static str {
3162 "type.googleapis.com/google.cloud.bigquery.migration.v2.BigQueryDialect"
3163 }
3164}
3165
3166#[derive(Clone, Default, PartialEq)]
3168#[non_exhaustive]
3169pub struct HiveQLDialect {
3170 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3171}
3172
3173impl HiveQLDialect {
3174 pub fn new() -> Self {
3175 std::default::Default::default()
3176 }
3177}
3178
3179impl wkt::message::Message for HiveQLDialect {
3180 fn typename() -> &'static str {
3181 "type.googleapis.com/google.cloud.bigquery.migration.v2.HiveQLDialect"
3182 }
3183}
3184
3185#[derive(Clone, Default, PartialEq)]
3187#[non_exhaustive]
3188pub struct RedshiftDialect {
3189 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3190}
3191
3192impl RedshiftDialect {
3193 pub fn new() -> Self {
3194 std::default::Default::default()
3195 }
3196}
3197
3198impl wkt::message::Message for RedshiftDialect {
3199 fn typename() -> &'static str {
3200 "type.googleapis.com/google.cloud.bigquery.migration.v2.RedshiftDialect"
3201 }
3202}
3203
3204#[derive(Clone, Default, PartialEq)]
3206#[non_exhaustive]
3207pub struct TeradataDialect {
3208 pub mode: crate::model::teradata_dialect::Mode,
3210
3211 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3212}
3213
3214impl TeradataDialect {
3215 pub fn new() -> Self {
3216 std::default::Default::default()
3217 }
3218
3219 pub fn set_mode<T: std::convert::Into<crate::model::teradata_dialect::Mode>>(
3221 mut self,
3222 v: T,
3223 ) -> Self {
3224 self.mode = v.into();
3225 self
3226 }
3227}
3228
3229impl wkt::message::Message for TeradataDialect {
3230 fn typename() -> &'static str {
3231 "type.googleapis.com/google.cloud.bigquery.migration.v2.TeradataDialect"
3232 }
3233}
3234
3235pub mod teradata_dialect {
3237 #[allow(unused_imports)]
3238 use super::*;
3239
3240 #[derive(Clone, Debug, PartialEq)]
3256 #[non_exhaustive]
3257 pub enum Mode {
3258 Unspecified,
3260 Sql,
3262 Bteq,
3264 UnknownValue(mode::UnknownValue),
3269 }
3270
3271 #[doc(hidden)]
3272 pub mod mode {
3273 #[allow(unused_imports)]
3274 use super::*;
3275 #[derive(Clone, Debug, PartialEq)]
3276 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3277 }
3278
3279 impl Mode {
3280 pub fn value(&self) -> std::option::Option<i32> {
3285 match self {
3286 Self::Unspecified => std::option::Option::Some(0),
3287 Self::Sql => std::option::Option::Some(1),
3288 Self::Bteq => std::option::Option::Some(2),
3289 Self::UnknownValue(u) => u.0.value(),
3290 }
3291 }
3292
3293 pub fn name(&self) -> std::option::Option<&str> {
3298 match self {
3299 Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
3300 Self::Sql => std::option::Option::Some("SQL"),
3301 Self::Bteq => std::option::Option::Some("BTEQ"),
3302 Self::UnknownValue(u) => u.0.name(),
3303 }
3304 }
3305 }
3306
3307 impl std::default::Default for Mode {
3308 fn default() -> Self {
3309 use std::convert::From;
3310 Self::from(0)
3311 }
3312 }
3313
3314 impl std::fmt::Display for Mode {
3315 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3316 wkt::internal::display_enum(f, self.name(), self.value())
3317 }
3318 }
3319
3320 impl std::convert::From<i32> for Mode {
3321 fn from(value: i32) -> Self {
3322 match value {
3323 0 => Self::Unspecified,
3324 1 => Self::Sql,
3325 2 => Self::Bteq,
3326 _ => Self::UnknownValue(mode::UnknownValue(
3327 wkt::internal::UnknownEnumValue::Integer(value),
3328 )),
3329 }
3330 }
3331 }
3332
3333 impl std::convert::From<&str> for Mode {
3334 fn from(value: &str) -> Self {
3335 use std::string::ToString;
3336 match value {
3337 "MODE_UNSPECIFIED" => Self::Unspecified,
3338 "SQL" => Self::Sql,
3339 "BTEQ" => Self::Bteq,
3340 _ => Self::UnknownValue(mode::UnknownValue(
3341 wkt::internal::UnknownEnumValue::String(value.to_string()),
3342 )),
3343 }
3344 }
3345 }
3346
3347 impl serde::ser::Serialize for Mode {
3348 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3349 where
3350 S: serde::Serializer,
3351 {
3352 match self {
3353 Self::Unspecified => serializer.serialize_i32(0),
3354 Self::Sql => serializer.serialize_i32(1),
3355 Self::Bteq => serializer.serialize_i32(2),
3356 Self::UnknownValue(u) => u.0.serialize(serializer),
3357 }
3358 }
3359 }
3360
3361 impl<'de> serde::de::Deserialize<'de> for Mode {
3362 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3363 where
3364 D: serde::Deserializer<'de>,
3365 {
3366 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
3367 ".google.cloud.bigquery.migration.v2.TeradataDialect.Mode",
3368 ))
3369 }
3370 }
3371}
3372
3373#[derive(Clone, Default, PartialEq)]
3375#[non_exhaustive]
3376pub struct OracleDialect {
3377 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3378}
3379
3380impl OracleDialect {
3381 pub fn new() -> Self {
3382 std::default::Default::default()
3383 }
3384}
3385
3386impl wkt::message::Message for OracleDialect {
3387 fn typename() -> &'static str {
3388 "type.googleapis.com/google.cloud.bigquery.migration.v2.OracleDialect"
3389 }
3390}
3391
3392#[derive(Clone, Default, PartialEq)]
3394#[non_exhaustive]
3395pub struct SparkSQLDialect {
3396 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3397}
3398
3399impl SparkSQLDialect {
3400 pub fn new() -> Self {
3401 std::default::Default::default()
3402 }
3403}
3404
3405impl wkt::message::Message for SparkSQLDialect {
3406 fn typename() -> &'static str {
3407 "type.googleapis.com/google.cloud.bigquery.migration.v2.SparkSQLDialect"
3408 }
3409}
3410
3411#[derive(Clone, Default, PartialEq)]
3413#[non_exhaustive]
3414pub struct SnowflakeDialect {
3415 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3416}
3417
3418impl SnowflakeDialect {
3419 pub fn new() -> Self {
3420 std::default::Default::default()
3421 }
3422}
3423
3424impl wkt::message::Message for SnowflakeDialect {
3425 fn typename() -> &'static str {
3426 "type.googleapis.com/google.cloud.bigquery.migration.v2.SnowflakeDialect"
3427 }
3428}
3429
3430#[derive(Clone, Default, PartialEq)]
3432#[non_exhaustive]
3433pub struct NetezzaDialect {
3434 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3435}
3436
3437impl NetezzaDialect {
3438 pub fn new() -> Self {
3439 std::default::Default::default()
3440 }
3441}
3442
3443impl wkt::message::Message for NetezzaDialect {
3444 fn typename() -> &'static str {
3445 "type.googleapis.com/google.cloud.bigquery.migration.v2.NetezzaDialect"
3446 }
3447}
3448
3449#[derive(Clone, Default, PartialEq)]
3451#[non_exhaustive]
3452pub struct AzureSynapseDialect {
3453 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3454}
3455
3456impl AzureSynapseDialect {
3457 pub fn new() -> Self {
3458 std::default::Default::default()
3459 }
3460}
3461
3462impl wkt::message::Message for AzureSynapseDialect {
3463 fn typename() -> &'static str {
3464 "type.googleapis.com/google.cloud.bigquery.migration.v2.AzureSynapseDialect"
3465 }
3466}
3467
3468#[derive(Clone, Default, PartialEq)]
3470#[non_exhaustive]
3471pub struct VerticaDialect {
3472 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3473}
3474
3475impl VerticaDialect {
3476 pub fn new() -> Self {
3477 std::default::Default::default()
3478 }
3479}
3480
3481impl wkt::message::Message for VerticaDialect {
3482 fn typename() -> &'static str {
3483 "type.googleapis.com/google.cloud.bigquery.migration.v2.VerticaDialect"
3484 }
3485}
3486
3487#[derive(Clone, Default, PartialEq)]
3489#[non_exhaustive]
3490pub struct SQLServerDialect {
3491 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3492}
3493
3494impl SQLServerDialect {
3495 pub fn new() -> Self {
3496 std::default::Default::default()
3497 }
3498}
3499
3500impl wkt::message::Message for SQLServerDialect {
3501 fn typename() -> &'static str {
3502 "type.googleapis.com/google.cloud.bigquery.migration.v2.SQLServerDialect"
3503 }
3504}
3505
3506#[derive(Clone, Default, PartialEq)]
3508#[non_exhaustive]
3509pub struct PostgresqlDialect {
3510 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3511}
3512
3513impl PostgresqlDialect {
3514 pub fn new() -> Self {
3515 std::default::Default::default()
3516 }
3517}
3518
3519impl wkt::message::Message for PostgresqlDialect {
3520 fn typename() -> &'static str {
3521 "type.googleapis.com/google.cloud.bigquery.migration.v2.PostgresqlDialect"
3522 }
3523}
3524
3525#[derive(Clone, Default, PartialEq)]
3527#[non_exhaustive]
3528pub struct PrestoDialect {
3529 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3530}
3531
3532impl PrestoDialect {
3533 pub fn new() -> Self {
3534 std::default::Default::default()
3535 }
3536}
3537
3538impl wkt::message::Message for PrestoDialect {
3539 fn typename() -> &'static str {
3540 "type.googleapis.com/google.cloud.bigquery.migration.v2.PrestoDialect"
3541 }
3542}
3543
3544#[derive(Clone, Default, PartialEq)]
3546#[non_exhaustive]
3547pub struct MySQLDialect {
3548 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3549}
3550
3551impl MySQLDialect {
3552 pub fn new() -> Self {
3553 std::default::Default::default()
3554 }
3555}
3556
3557impl wkt::message::Message for MySQLDialect {
3558 fn typename() -> &'static str {
3559 "type.googleapis.com/google.cloud.bigquery.migration.v2.MySQLDialect"
3560 }
3561}
3562
3563#[derive(Clone, Default, PartialEq)]
3565#[non_exhaustive]
3566pub struct DB2Dialect {
3567 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3568}
3569
3570impl DB2Dialect {
3571 pub fn new() -> Self {
3572 std::default::Default::default()
3573 }
3574}
3575
3576impl wkt::message::Message for DB2Dialect {
3577 fn typename() -> &'static str {
3578 "type.googleapis.com/google.cloud.bigquery.migration.v2.DB2Dialect"
3579 }
3580}
3581
3582#[derive(Clone, Default, PartialEq)]
3584#[non_exhaustive]
3585pub struct SQLiteDialect {
3586 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3587}
3588
3589impl SQLiteDialect {
3590 pub fn new() -> Self {
3591 std::default::Default::default()
3592 }
3593}
3594
3595impl wkt::message::Message for SQLiteDialect {
3596 fn typename() -> &'static str {
3597 "type.googleapis.com/google.cloud.bigquery.migration.v2.SQLiteDialect"
3598 }
3599}
3600
3601#[derive(Clone, Default, PartialEq)]
3603#[non_exhaustive]
3604pub struct GreenplumDialect {
3605 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3606}
3607
3608impl GreenplumDialect {
3609 pub fn new() -> Self {
3610 std::default::Default::default()
3611 }
3612}
3613
3614impl wkt::message::Message for GreenplumDialect {
3615 fn typename() -> &'static str {
3616 "type.googleapis.com/google.cloud.bigquery.migration.v2.GreenplumDialect"
3617 }
3618}
3619
3620#[derive(Clone, Default, PartialEq)]
3623#[non_exhaustive]
3624pub struct ObjectNameMappingList {
3625 pub name_map: std::vec::Vec<crate::model::ObjectNameMapping>,
3627
3628 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3629}
3630
3631impl ObjectNameMappingList {
3632 pub fn new() -> Self {
3633 std::default::Default::default()
3634 }
3635
3636 pub fn set_name_map<T, V>(mut self, v: T) -> Self
3638 where
3639 T: std::iter::IntoIterator<Item = V>,
3640 V: std::convert::Into<crate::model::ObjectNameMapping>,
3641 {
3642 use std::iter::Iterator;
3643 self.name_map = v.into_iter().map(|i| i.into()).collect();
3644 self
3645 }
3646}
3647
3648impl wkt::message::Message for ObjectNameMappingList {
3649 fn typename() -> &'static str {
3650 "type.googleapis.com/google.cloud.bigquery.migration.v2.ObjectNameMappingList"
3651 }
3652}
3653
3654#[derive(Clone, Default, PartialEq)]
3657#[non_exhaustive]
3658pub struct ObjectNameMapping {
3659 pub source: std::option::Option<crate::model::NameMappingKey>,
3661
3662 pub target: std::option::Option<crate::model::NameMappingValue>,
3664
3665 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3666}
3667
3668impl ObjectNameMapping {
3669 pub fn new() -> Self {
3670 std::default::Default::default()
3671 }
3672
3673 pub fn set_source<T>(mut self, v: T) -> Self
3675 where
3676 T: std::convert::Into<crate::model::NameMappingKey>,
3677 {
3678 self.source = std::option::Option::Some(v.into());
3679 self
3680 }
3681
3682 pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
3684 where
3685 T: std::convert::Into<crate::model::NameMappingKey>,
3686 {
3687 self.source = v.map(|x| x.into());
3688 self
3689 }
3690
3691 pub fn set_target<T>(mut self, v: T) -> Self
3693 where
3694 T: std::convert::Into<crate::model::NameMappingValue>,
3695 {
3696 self.target = std::option::Option::Some(v.into());
3697 self
3698 }
3699
3700 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
3702 where
3703 T: std::convert::Into<crate::model::NameMappingValue>,
3704 {
3705 self.target = v.map(|x| x.into());
3706 self
3707 }
3708}
3709
3710impl wkt::message::Message for ObjectNameMapping {
3711 fn typename() -> &'static str {
3712 "type.googleapis.com/google.cloud.bigquery.migration.v2.ObjectNameMapping"
3713 }
3714}
3715
3716#[derive(Clone, Default, PartialEq)]
3719#[non_exhaustive]
3720pub struct NameMappingKey {
3721 pub r#type: crate::model::name_mapping_key::Type,
3723
3724 pub database: std::string::String,
3727
3728 pub schema: std::string::String,
3730
3731 pub relation: std::string::String,
3734
3735 pub attribute: std::string::String,
3738
3739 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3740}
3741
3742impl NameMappingKey {
3743 pub fn new() -> Self {
3744 std::default::Default::default()
3745 }
3746
3747 pub fn set_type<T: std::convert::Into<crate::model::name_mapping_key::Type>>(
3749 mut self,
3750 v: T,
3751 ) -> Self {
3752 self.r#type = v.into();
3753 self
3754 }
3755
3756 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3758 self.database = v.into();
3759 self
3760 }
3761
3762 pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3764 self.schema = v.into();
3765 self
3766 }
3767
3768 pub fn set_relation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3770 self.relation = v.into();
3771 self
3772 }
3773
3774 pub fn set_attribute<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3776 self.attribute = v.into();
3777 self
3778 }
3779}
3780
3781impl wkt::message::Message for NameMappingKey {
3782 fn typename() -> &'static str {
3783 "type.googleapis.com/google.cloud.bigquery.migration.v2.NameMappingKey"
3784 }
3785}
3786
3787pub mod name_mapping_key {
3789 #[allow(unused_imports)]
3790 use super::*;
3791
3792 #[derive(Clone, Debug, PartialEq)]
3808 #[non_exhaustive]
3809 pub enum Type {
3810 Unspecified,
3812 Database,
3814 Schema,
3816 Relation,
3818 Attribute,
3820 RelationAlias,
3822 AttributeAlias,
3824 Function,
3826 UnknownValue(r#type::UnknownValue),
3831 }
3832
3833 #[doc(hidden)]
3834 pub mod r#type {
3835 #[allow(unused_imports)]
3836 use super::*;
3837 #[derive(Clone, Debug, PartialEq)]
3838 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3839 }
3840
3841 impl Type {
3842 pub fn value(&self) -> std::option::Option<i32> {
3847 match self {
3848 Self::Unspecified => std::option::Option::Some(0),
3849 Self::Database => std::option::Option::Some(1),
3850 Self::Schema => std::option::Option::Some(2),
3851 Self::Relation => std::option::Option::Some(3),
3852 Self::Attribute => std::option::Option::Some(4),
3853 Self::RelationAlias => std::option::Option::Some(5),
3854 Self::AttributeAlias => std::option::Option::Some(6),
3855 Self::Function => std::option::Option::Some(7),
3856 Self::UnknownValue(u) => u.0.value(),
3857 }
3858 }
3859
3860 pub fn name(&self) -> std::option::Option<&str> {
3865 match self {
3866 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
3867 Self::Database => std::option::Option::Some("DATABASE"),
3868 Self::Schema => std::option::Option::Some("SCHEMA"),
3869 Self::Relation => std::option::Option::Some("RELATION"),
3870 Self::Attribute => std::option::Option::Some("ATTRIBUTE"),
3871 Self::RelationAlias => std::option::Option::Some("RELATION_ALIAS"),
3872 Self::AttributeAlias => std::option::Option::Some("ATTRIBUTE_ALIAS"),
3873 Self::Function => std::option::Option::Some("FUNCTION"),
3874 Self::UnknownValue(u) => u.0.name(),
3875 }
3876 }
3877 }
3878
3879 impl std::default::Default for Type {
3880 fn default() -> Self {
3881 use std::convert::From;
3882 Self::from(0)
3883 }
3884 }
3885
3886 impl std::fmt::Display for Type {
3887 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3888 wkt::internal::display_enum(f, self.name(), self.value())
3889 }
3890 }
3891
3892 impl std::convert::From<i32> for Type {
3893 fn from(value: i32) -> Self {
3894 match value {
3895 0 => Self::Unspecified,
3896 1 => Self::Database,
3897 2 => Self::Schema,
3898 3 => Self::Relation,
3899 4 => Self::Attribute,
3900 5 => Self::RelationAlias,
3901 6 => Self::AttributeAlias,
3902 7 => Self::Function,
3903 _ => Self::UnknownValue(r#type::UnknownValue(
3904 wkt::internal::UnknownEnumValue::Integer(value),
3905 )),
3906 }
3907 }
3908 }
3909
3910 impl std::convert::From<&str> for Type {
3911 fn from(value: &str) -> Self {
3912 use std::string::ToString;
3913 match value {
3914 "TYPE_UNSPECIFIED" => Self::Unspecified,
3915 "DATABASE" => Self::Database,
3916 "SCHEMA" => Self::Schema,
3917 "RELATION" => Self::Relation,
3918 "ATTRIBUTE" => Self::Attribute,
3919 "RELATION_ALIAS" => Self::RelationAlias,
3920 "ATTRIBUTE_ALIAS" => Self::AttributeAlias,
3921 "FUNCTION" => Self::Function,
3922 _ => Self::UnknownValue(r#type::UnknownValue(
3923 wkt::internal::UnknownEnumValue::String(value.to_string()),
3924 )),
3925 }
3926 }
3927 }
3928
3929 impl serde::ser::Serialize for Type {
3930 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3931 where
3932 S: serde::Serializer,
3933 {
3934 match self {
3935 Self::Unspecified => serializer.serialize_i32(0),
3936 Self::Database => serializer.serialize_i32(1),
3937 Self::Schema => serializer.serialize_i32(2),
3938 Self::Relation => serializer.serialize_i32(3),
3939 Self::Attribute => serializer.serialize_i32(4),
3940 Self::RelationAlias => serializer.serialize_i32(5),
3941 Self::AttributeAlias => serializer.serialize_i32(6),
3942 Self::Function => serializer.serialize_i32(7),
3943 Self::UnknownValue(u) => u.0.serialize(serializer),
3944 }
3945 }
3946 }
3947
3948 impl<'de> serde::de::Deserialize<'de> for Type {
3949 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3950 where
3951 D: serde::Deserializer<'de>,
3952 {
3953 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
3954 ".google.cloud.bigquery.migration.v2.NameMappingKey.Type",
3955 ))
3956 }
3957 }
3958}
3959
3960#[derive(Clone, Default, PartialEq)]
3963#[non_exhaustive]
3964pub struct NameMappingValue {
3965 pub database: std::string::String,
3968
3969 pub schema: std::string::String,
3971
3972 pub relation: std::string::String,
3975
3976 pub attribute: std::string::String,
3979
3980 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3981}
3982
3983impl NameMappingValue {
3984 pub fn new() -> Self {
3985 std::default::Default::default()
3986 }
3987
3988 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3990 self.database = v.into();
3991 self
3992 }
3993
3994 pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3996 self.schema = v.into();
3997 self
3998 }
3999
4000 pub fn set_relation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4002 self.relation = v.into();
4003 self
4004 }
4005
4006 pub fn set_attribute<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4008 self.attribute = v.into();
4009 self
4010 }
4011}
4012
4013impl wkt::message::Message for NameMappingValue {
4014 fn typename() -> &'static str {
4015 "type.googleapis.com/google.cloud.bigquery.migration.v2.NameMappingValue"
4016 }
4017}
4018
4019#[derive(Clone, Default, PartialEq)]
4021#[non_exhaustive]
4022pub struct SourceEnv {
4023 pub default_database: std::string::String,
4026
4027 pub schema_search_path: std::vec::Vec<std::string::String>,
4030
4031 pub metadata_store_dataset: std::string::String,
4038
4039 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4040}
4041
4042impl SourceEnv {
4043 pub fn new() -> Self {
4044 std::default::Default::default()
4045 }
4046
4047 pub fn set_default_database<T: std::convert::Into<std::string::String>>(
4049 mut self,
4050 v: T,
4051 ) -> Self {
4052 self.default_database = v.into();
4053 self
4054 }
4055
4056 pub fn set_schema_search_path<T, V>(mut self, v: T) -> Self
4058 where
4059 T: std::iter::IntoIterator<Item = V>,
4060 V: std::convert::Into<std::string::String>,
4061 {
4062 use std::iter::Iterator;
4063 self.schema_search_path = v.into_iter().map(|i| i.into()).collect();
4064 self
4065 }
4066
4067 pub fn set_metadata_store_dataset<T: std::convert::Into<std::string::String>>(
4069 mut self,
4070 v: T,
4071 ) -> Self {
4072 self.metadata_store_dataset = v.into();
4073 self
4074 }
4075}
4076
4077impl wkt::message::Message for SourceEnv {
4078 fn typename() -> &'static str {
4079 "type.googleapis.com/google.cloud.bigquery.migration.v2.SourceEnv"
4080 }
4081}
4082
4083#[derive(Clone, Default, PartialEq)]
4086#[non_exhaustive]
4087pub struct TranslationDetails {
4088 pub source_target_mapping: std::vec::Vec<crate::model::SourceTargetMapping>,
4090
4091 pub target_base_uri: std::string::String,
4093
4094 pub source_environment: std::option::Option<crate::model::SourceEnvironment>,
4096
4097 pub target_return_literals: std::vec::Vec<std::string::String>,
4101
4102 pub target_types: std::vec::Vec<std::string::String>,
4107
4108 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4109}
4110
4111impl TranslationDetails {
4112 pub fn new() -> Self {
4113 std::default::Default::default()
4114 }
4115
4116 pub fn set_source_target_mapping<T, V>(mut self, v: T) -> Self
4118 where
4119 T: std::iter::IntoIterator<Item = V>,
4120 V: std::convert::Into<crate::model::SourceTargetMapping>,
4121 {
4122 use std::iter::Iterator;
4123 self.source_target_mapping = v.into_iter().map(|i| i.into()).collect();
4124 self
4125 }
4126
4127 pub fn set_target_base_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4129 self.target_base_uri = v.into();
4130 self
4131 }
4132
4133 pub fn set_source_environment<T>(mut self, v: T) -> Self
4135 where
4136 T: std::convert::Into<crate::model::SourceEnvironment>,
4137 {
4138 self.source_environment = std::option::Option::Some(v.into());
4139 self
4140 }
4141
4142 pub fn set_or_clear_source_environment<T>(mut self, v: std::option::Option<T>) -> Self
4144 where
4145 T: std::convert::Into<crate::model::SourceEnvironment>,
4146 {
4147 self.source_environment = v.map(|x| x.into());
4148 self
4149 }
4150
4151 pub fn set_target_return_literals<T, V>(mut self, v: T) -> Self
4153 where
4154 T: std::iter::IntoIterator<Item = V>,
4155 V: std::convert::Into<std::string::String>,
4156 {
4157 use std::iter::Iterator;
4158 self.target_return_literals = v.into_iter().map(|i| i.into()).collect();
4159 self
4160 }
4161
4162 pub fn set_target_types<T, V>(mut self, v: T) -> Self
4164 where
4165 T: std::iter::IntoIterator<Item = V>,
4166 V: std::convert::Into<std::string::String>,
4167 {
4168 use std::iter::Iterator;
4169 self.target_types = v.into_iter().map(|i| i.into()).collect();
4170 self
4171 }
4172}
4173
4174impl wkt::message::Message for TranslationDetails {
4175 fn typename() -> &'static str {
4176 "type.googleapis.com/google.cloud.bigquery.migration.v2.TranslationDetails"
4177 }
4178}
4179
4180#[derive(Clone, Default, PartialEq)]
4182#[non_exhaustive]
4183pub struct SourceTargetMapping {
4184 pub source_spec: std::option::Option<crate::model::SourceSpec>,
4186
4187 pub target_spec: std::option::Option<crate::model::TargetSpec>,
4189
4190 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4191}
4192
4193impl SourceTargetMapping {
4194 pub fn new() -> Self {
4195 std::default::Default::default()
4196 }
4197
4198 pub fn set_source_spec<T>(mut self, v: T) -> Self
4200 where
4201 T: std::convert::Into<crate::model::SourceSpec>,
4202 {
4203 self.source_spec = std::option::Option::Some(v.into());
4204 self
4205 }
4206
4207 pub fn set_or_clear_source_spec<T>(mut self, v: std::option::Option<T>) -> Self
4209 where
4210 T: std::convert::Into<crate::model::SourceSpec>,
4211 {
4212 self.source_spec = v.map(|x| x.into());
4213 self
4214 }
4215
4216 pub fn set_target_spec<T>(mut self, v: T) -> Self
4218 where
4219 T: std::convert::Into<crate::model::TargetSpec>,
4220 {
4221 self.target_spec = std::option::Option::Some(v.into());
4222 self
4223 }
4224
4225 pub fn set_or_clear_target_spec<T>(mut self, v: std::option::Option<T>) -> Self
4227 where
4228 T: std::convert::Into<crate::model::TargetSpec>,
4229 {
4230 self.target_spec = v.map(|x| x.into());
4231 self
4232 }
4233}
4234
4235impl wkt::message::Message for SourceTargetMapping {
4236 fn typename() -> &'static str {
4237 "type.googleapis.com/google.cloud.bigquery.migration.v2.SourceTargetMapping"
4238 }
4239}
4240
4241#[derive(Clone, Default, PartialEq)]
4243#[non_exhaustive]
4244pub struct SourceSpec {
4245 pub encoding: std::string::String,
4247
4248 pub source: std::option::Option<crate::model::source_spec::Source>,
4250
4251 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4252}
4253
4254impl SourceSpec {
4255 pub fn new() -> Self {
4256 std::default::Default::default()
4257 }
4258
4259 pub fn set_encoding<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4261 self.encoding = v.into();
4262 self
4263 }
4264
4265 pub fn set_source<
4270 T: std::convert::Into<std::option::Option<crate::model::source_spec::Source>>,
4271 >(
4272 mut self,
4273 v: T,
4274 ) -> Self {
4275 self.source = v.into();
4276 self
4277 }
4278
4279 pub fn base_uri(&self) -> std::option::Option<&std::string::String> {
4283 #[allow(unreachable_patterns)]
4284 self.source.as_ref().and_then(|v| match v {
4285 crate::model::source_spec::Source::BaseUri(v) => std::option::Option::Some(v),
4286 _ => std::option::Option::None,
4287 })
4288 }
4289
4290 pub fn set_base_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4296 self.source =
4297 std::option::Option::Some(crate::model::source_spec::Source::BaseUri(v.into()));
4298 self
4299 }
4300
4301 pub fn literal(&self) -> std::option::Option<&std::boxed::Box<crate::model::Literal>> {
4305 #[allow(unreachable_patterns)]
4306 self.source.as_ref().and_then(|v| match v {
4307 crate::model::source_spec::Source::Literal(v) => std::option::Option::Some(v),
4308 _ => std::option::Option::None,
4309 })
4310 }
4311
4312 pub fn set_literal<T: std::convert::Into<std::boxed::Box<crate::model::Literal>>>(
4318 mut self,
4319 v: T,
4320 ) -> Self {
4321 self.source =
4322 std::option::Option::Some(crate::model::source_spec::Source::Literal(v.into()));
4323 self
4324 }
4325}
4326
4327impl wkt::message::Message for SourceSpec {
4328 fn typename() -> &'static str {
4329 "type.googleapis.com/google.cloud.bigquery.migration.v2.SourceSpec"
4330 }
4331}
4332
4333pub mod source_spec {
4335 #[allow(unused_imports)]
4336 use super::*;
4337
4338 #[derive(Clone, Debug, PartialEq)]
4340 #[non_exhaustive]
4341 pub enum Source {
4342 BaseUri(std::string::String),
4344 Literal(std::boxed::Box<crate::model::Literal>),
4346 }
4347}
4348
4349#[derive(Clone, Default, PartialEq)]
4351#[non_exhaustive]
4352pub struct TargetSpec {
4353 pub relative_path: std::string::String,
4357
4358 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4359}
4360
4361impl TargetSpec {
4362 pub fn new() -> Self {
4363 std::default::Default::default()
4364 }
4365
4366 pub fn set_relative_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4368 self.relative_path = v.into();
4369 self
4370 }
4371}
4372
4373impl wkt::message::Message for TargetSpec {
4374 fn typename() -> &'static str {
4375 "type.googleapis.com/google.cloud.bigquery.migration.v2.TargetSpec"
4376 }
4377}
4378
4379#[derive(Clone, Default, PartialEq)]
4381#[non_exhaustive]
4382pub struct Literal {
4383 pub relative_path: std::string::String,
4385
4386 pub literal_data: std::option::Option<crate::model::literal::LiteralData>,
4388
4389 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4390}
4391
4392impl Literal {
4393 pub fn new() -> Self {
4394 std::default::Default::default()
4395 }
4396
4397 pub fn set_relative_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4399 self.relative_path = v.into();
4400 self
4401 }
4402
4403 pub fn set_literal_data<
4408 T: std::convert::Into<std::option::Option<crate::model::literal::LiteralData>>,
4409 >(
4410 mut self,
4411 v: T,
4412 ) -> Self {
4413 self.literal_data = v.into();
4414 self
4415 }
4416
4417 pub fn literal_string(&self) -> std::option::Option<&std::string::String> {
4421 #[allow(unreachable_patterns)]
4422 self.literal_data.as_ref().and_then(|v| match v {
4423 crate::model::literal::LiteralData::LiteralString(v) => std::option::Option::Some(v),
4424 _ => std::option::Option::None,
4425 })
4426 }
4427
4428 pub fn set_literal_string<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4434 self.literal_data =
4435 std::option::Option::Some(crate::model::literal::LiteralData::LiteralString(v.into()));
4436 self
4437 }
4438
4439 pub fn literal_bytes(&self) -> std::option::Option<&::bytes::Bytes> {
4443 #[allow(unreachable_patterns)]
4444 self.literal_data.as_ref().and_then(|v| match v {
4445 crate::model::literal::LiteralData::LiteralBytes(v) => std::option::Option::Some(v),
4446 _ => std::option::Option::None,
4447 })
4448 }
4449
4450 pub fn set_literal_bytes<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
4456 self.literal_data =
4457 std::option::Option::Some(crate::model::literal::LiteralData::LiteralBytes(v.into()));
4458 self
4459 }
4460}
4461
4462impl wkt::message::Message for Literal {
4463 fn typename() -> &'static str {
4464 "type.googleapis.com/google.cloud.bigquery.migration.v2.Literal"
4465 }
4466}
4467
4468pub mod literal {
4470 #[allow(unused_imports)]
4471 use super::*;
4472
4473 #[derive(Clone, Debug, PartialEq)]
4475 #[non_exhaustive]
4476 pub enum LiteralData {
4477 LiteralString(std::string::String),
4479 LiteralBytes(::bytes::Bytes),
4481 }
4482}
4483
4484#[derive(Clone, Default, PartialEq)]
4486#[non_exhaustive]
4487pub struct SourceEnvironment {
4488 pub default_database: std::string::String,
4491
4492 pub schema_search_path: std::vec::Vec<std::string::String>,
4495
4496 pub metadata_store_dataset: std::string::String,
4503
4504 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4505}
4506
4507impl SourceEnvironment {
4508 pub fn new() -> Self {
4509 std::default::Default::default()
4510 }
4511
4512 pub fn set_default_database<T: std::convert::Into<std::string::String>>(
4514 mut self,
4515 v: T,
4516 ) -> Self {
4517 self.default_database = v.into();
4518 self
4519 }
4520
4521 pub fn set_schema_search_path<T, V>(mut self, v: T) -> Self
4523 where
4524 T: std::iter::IntoIterator<Item = V>,
4525 V: std::convert::Into<std::string::String>,
4526 {
4527 use std::iter::Iterator;
4528 self.schema_search_path = v.into_iter().map(|i| i.into()).collect();
4529 self
4530 }
4531
4532 pub fn set_metadata_store_dataset<T: std::convert::Into<std::string::String>>(
4534 mut self,
4535 v: T,
4536 ) -> Self {
4537 self.metadata_store_dataset = v.into();
4538 self
4539 }
4540}
4541
4542impl wkt::message::Message for SourceEnvironment {
4543 fn typename() -> &'static str {
4544 "type.googleapis.com/google.cloud.bigquery.migration.v2.SourceEnvironment"
4545 }
4546}
4547
4548#[derive(Clone, Default, PartialEq)]
4550#[non_exhaustive]
4551pub struct TranslationReportRecord {
4552 pub severity: crate::model::translation_report_record::Severity,
4554
4555 pub script_line: i32,
4558
4559 pub script_column: i32,
4562
4563 pub category: std::string::String,
4565
4566 pub message: std::string::String,
4568
4569 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4570}
4571
4572impl TranslationReportRecord {
4573 pub fn new() -> Self {
4574 std::default::Default::default()
4575 }
4576
4577 pub fn set_severity<
4579 T: std::convert::Into<crate::model::translation_report_record::Severity>,
4580 >(
4581 mut self,
4582 v: T,
4583 ) -> Self {
4584 self.severity = v.into();
4585 self
4586 }
4587
4588 pub fn set_script_line<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4590 self.script_line = v.into();
4591 self
4592 }
4593
4594 pub fn set_script_column<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4596 self.script_column = v.into();
4597 self
4598 }
4599
4600 pub fn set_category<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4602 self.category = v.into();
4603 self
4604 }
4605
4606 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4608 self.message = v.into();
4609 self
4610 }
4611}
4612
4613impl wkt::message::Message for TranslationReportRecord {
4614 fn typename() -> &'static str {
4615 "type.googleapis.com/google.cloud.bigquery.migration.v2.TranslationReportRecord"
4616 }
4617}
4618
4619pub mod translation_report_record {
4621 #[allow(unused_imports)]
4622 use super::*;
4623
4624 #[derive(Clone, Debug, PartialEq)]
4640 #[non_exhaustive]
4641 pub enum Severity {
4642 Unspecified,
4644 Info,
4646 Warning,
4649 Error,
4651 UnknownValue(severity::UnknownValue),
4656 }
4657
4658 #[doc(hidden)]
4659 pub mod severity {
4660 #[allow(unused_imports)]
4661 use super::*;
4662 #[derive(Clone, Debug, PartialEq)]
4663 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4664 }
4665
4666 impl Severity {
4667 pub fn value(&self) -> std::option::Option<i32> {
4672 match self {
4673 Self::Unspecified => std::option::Option::Some(0),
4674 Self::Info => std::option::Option::Some(1),
4675 Self::Warning => std::option::Option::Some(2),
4676 Self::Error => std::option::Option::Some(3),
4677 Self::UnknownValue(u) => u.0.value(),
4678 }
4679 }
4680
4681 pub fn name(&self) -> std::option::Option<&str> {
4686 match self {
4687 Self::Unspecified => std::option::Option::Some("SEVERITY_UNSPECIFIED"),
4688 Self::Info => std::option::Option::Some("INFO"),
4689 Self::Warning => std::option::Option::Some("WARNING"),
4690 Self::Error => std::option::Option::Some("ERROR"),
4691 Self::UnknownValue(u) => u.0.name(),
4692 }
4693 }
4694 }
4695
4696 impl std::default::Default for Severity {
4697 fn default() -> Self {
4698 use std::convert::From;
4699 Self::from(0)
4700 }
4701 }
4702
4703 impl std::fmt::Display for Severity {
4704 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4705 wkt::internal::display_enum(f, self.name(), self.value())
4706 }
4707 }
4708
4709 impl std::convert::From<i32> for Severity {
4710 fn from(value: i32) -> Self {
4711 match value {
4712 0 => Self::Unspecified,
4713 1 => Self::Info,
4714 2 => Self::Warning,
4715 3 => Self::Error,
4716 _ => Self::UnknownValue(severity::UnknownValue(
4717 wkt::internal::UnknownEnumValue::Integer(value),
4718 )),
4719 }
4720 }
4721 }
4722
4723 impl std::convert::From<&str> for Severity {
4724 fn from(value: &str) -> Self {
4725 use std::string::ToString;
4726 match value {
4727 "SEVERITY_UNSPECIFIED" => Self::Unspecified,
4728 "INFO" => Self::Info,
4729 "WARNING" => Self::Warning,
4730 "ERROR" => Self::Error,
4731 _ => Self::UnknownValue(severity::UnknownValue(
4732 wkt::internal::UnknownEnumValue::String(value.to_string()),
4733 )),
4734 }
4735 }
4736 }
4737
4738 impl serde::ser::Serialize for Severity {
4739 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4740 where
4741 S: serde::Serializer,
4742 {
4743 match self {
4744 Self::Unspecified => serializer.serialize_i32(0),
4745 Self::Info => serializer.serialize_i32(1),
4746 Self::Warning => serializer.serialize_i32(2),
4747 Self::Error => serializer.serialize_i32(3),
4748 Self::UnknownValue(u) => u.0.serialize(serializer),
4749 }
4750 }
4751 }
4752
4753 impl<'de> serde::de::Deserialize<'de> for Severity {
4754 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4755 where
4756 D: serde::Deserializer<'de>,
4757 {
4758 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
4759 ".google.cloud.bigquery.migration.v2.TranslationReportRecord.Severity",
4760 ))
4761 }
4762 }
4763}
4764
4765#[derive(Clone, Default, PartialEq)]
4767#[non_exhaustive]
4768pub struct GcsReportLogMessage {
4769 pub severity: std::string::String,
4771
4772 pub category: std::string::String,
4774
4775 pub file_path: std::string::String,
4777
4778 pub filename: std::string::String,
4780
4781 pub source_script_line: i32,
4784
4785 pub source_script_column: i32,
4788
4789 pub message: std::string::String,
4791
4792 pub script_context: std::string::String,
4794
4795 pub action: std::string::String,
4797
4798 pub effect: std::string::String,
4800
4801 pub object_name: std::string::String,
4803
4804 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4805}
4806
4807impl GcsReportLogMessage {
4808 pub fn new() -> Self {
4809 std::default::Default::default()
4810 }
4811
4812 pub fn set_severity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4814 self.severity = v.into();
4815 self
4816 }
4817
4818 pub fn set_category<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4820 self.category = v.into();
4821 self
4822 }
4823
4824 pub fn set_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4826 self.file_path = v.into();
4827 self
4828 }
4829
4830 pub fn set_filename<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4832 self.filename = v.into();
4833 self
4834 }
4835
4836 pub fn set_source_script_line<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4838 self.source_script_line = v.into();
4839 self
4840 }
4841
4842 pub fn set_source_script_column<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4844 self.source_script_column = v.into();
4845 self
4846 }
4847
4848 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4850 self.message = v.into();
4851 self
4852 }
4853
4854 pub fn set_script_context<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4856 self.script_context = v.into();
4857 self
4858 }
4859
4860 pub fn set_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4862 self.action = v.into();
4863 self
4864 }
4865
4866 pub fn set_effect<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4868 self.effect = v.into();
4869 self
4870 }
4871
4872 pub fn set_object_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4874 self.object_name = v.into();
4875 self
4876 }
4877}
4878
4879impl wkt::message::Message for GcsReportLogMessage {
4880 fn typename() -> &'static str {
4881 "type.googleapis.com/google.cloud.bigquery.migration.v2.GcsReportLogMessage"
4882 }
4883}