google_cloud_bigquery_migration_v2/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![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/// A migration workflow which specifies what needs to be done for an EDW
40/// migration.
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct MigrationWorkflow {
44    /// Output only. Immutable. Identifier. The unique identifier for the migration
45    /// workflow. The ID is server-generated.
46    ///
47    /// Example: `projects/123/locations/us/workflows/345`
48    pub name: std::string::String,
49
50    /// The display name of the workflow. This can be set to give a workflow
51    /// a descriptive name. There is no guarantee or enforcement of uniqueness.
52    pub display_name: std::string::String,
53
54    /// The tasks in a workflow in a named map. The name (i.e. key) has no
55    /// meaning and is merely a convenient way to address a specific task
56    /// in a workflow.
57    pub tasks: std::collections::HashMap<std::string::String, crate::model::MigrationTask>,
58
59    /// Output only. That status of the workflow.
60    pub state: crate::model::migration_workflow::State,
61
62    /// Time when the workflow was created.
63    pub create_time: std::option::Option<wkt::Timestamp>,
64
65    /// Time when the workflow was last updated.
66    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    /// Sets the value of [name][crate::model::MigrationWorkflow::name].
77    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    /// Sets the value of [display_name][crate::model::MigrationWorkflow::display_name].
83    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    /// Sets the value of [tasks][crate::model::MigrationWorkflow::tasks].
89    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    /// Sets the value of [state][crate::model::MigrationWorkflow::state].
101    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    /// Sets the value of [create_time][crate::model::MigrationWorkflow::create_time].
110    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    /// Sets or clears the value of [create_time][crate::model::MigrationWorkflow::create_time].
119    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    /// Sets the value of [last_update_time][crate::model::MigrationWorkflow::last_update_time].
128    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    /// Sets or clears the value of [last_update_time][crate::model::MigrationWorkflow::last_update_time].
137    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
152/// Defines additional types related to [MigrationWorkflow].
153pub mod migration_workflow {
154    #[allow(unused_imports)]
155    use super::*;
156
157    /// Possible migration workflow states.
158    ///
159    /// # Working with unknown values
160    ///
161    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
162    /// additional enum variants at any time. Adding new variants is not considered
163    /// a breaking change. Applications should write their code in anticipation of:
164    ///
165    /// - New values appearing in future releases of the client library, **and**
166    /// - New values received dynamically, without application changes.
167    ///
168    /// Please consult the [Working with enums] section in the user guide for some
169    /// guidelines.
170    ///
171    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
172    #[derive(Clone, Debug, PartialEq)]
173    #[non_exhaustive]
174    pub enum State {
175        /// Workflow state is unspecified.
176        Unspecified,
177        /// Workflow is in draft status, i.e. tasks are not yet eligible for
178        /// execution.
179        Draft,
180        /// Workflow is running (i.e. tasks are eligible for execution).
181        Running,
182        /// Workflow is paused. Tasks currently in progress may continue, but no
183        /// further tasks will be scheduled.
184        Paused,
185        /// Workflow is complete. There should not be any task in a non-terminal
186        /// state, but if they are (e.g. forced termination), they will not be
187        /// scheduled.
188        Completed,
189        /// If set, the enum was initialized with an unknown value.
190        ///
191        /// Applications can examine the value using [State::value] or
192        /// [State::name].
193        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        /// Gets the enum value.
206        ///
207        /// Returns `None` if the enum contains an unknown value deserialized from
208        /// the string representation of enums.
209        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        /// Gets the enum value as a string.
221        ///
222        /// Returns `None` if the enum contains an unknown value deserialized from
223        /// the integer representation of enums.
224        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/// A single task for a migration which has details about the configuration of
309/// the task.
310#[derive(Clone, Default, PartialEq)]
311#[non_exhaustive]
312pub struct MigrationTask {
313    /// Output only. Immutable. The unique identifier for the migration task. The
314    /// ID is server-generated.
315    pub id: std::string::String,
316
317    /// The type of the task. This must be one of the supported task types:
318    /// Translation_Teradata2BQ, Translation_Redshift2BQ, Translation_Bteq2BQ,
319    /// Translation_Oracle2BQ, Translation_HiveQL2BQ, Translation_SparkSQL2BQ,
320    /// Translation_Snowflake2BQ, Translation_Netezza2BQ,
321    /// Translation_AzureSynapse2BQ, Translation_Vertica2BQ,
322    /// Translation_SQLServer2BQ, Translation_Presto2BQ, Translation_MySQL2BQ,
323    /// Translation_Postgresql2BQ, Translation_SQLite2BQ, Translation_Greenplum2BQ.
324    pub r#type: std::string::String,
325
326    /// Output only. The current state of the task.
327    pub state: crate::model::migration_task::State,
328
329    /// Output only. An explanation that may be populated when the task is in
330    /// FAILED state.
331    pub processing_error: std::option::Option<rpc::model::ErrorInfo>,
332
333    /// Time when the task was created.
334    pub create_time: std::option::Option<wkt::Timestamp>,
335
336    /// Time when the task was last updated.
337    pub last_update_time: std::option::Option<wkt::Timestamp>,
338
339    /// Output only. Provides details to errors and issues encountered while
340    /// processing the task. Presence of error details does not mean that the task
341    /// failed.
342    pub resource_error_details: std::vec::Vec<crate::model::ResourceErrorDetail>,
343
344    /// The number or resources with errors. Note: This is not the total
345    /// number of errors as each resource can have more than one error.
346    /// This is used to indicate truncation by having a `resource_error_count`
347    /// that is higher than the size of `resource_error_details`.
348    pub resource_error_count: i32,
349
350    /// The metrics for the task.
351    pub metrics: std::vec::Vec<crate::model::TimeSeries>,
352
353    /// Output only. The result of the task.
354    pub task_result: std::option::Option<crate::model::MigrationTaskResult>,
355
356    /// Count of all the processing errors in this task and its subtasks.
357    pub total_processing_error_count: i32,
358
359    /// Count of all the resource errors in this task and its subtasks.
360    pub total_resource_error_count: i32,
361
362    /// The details of the task.
363    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    /// Sets the value of [id][crate::model::MigrationTask::id].
374    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    /// Sets the value of [r#type][crate::model::MigrationTask::type].
380    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    /// Sets the value of [state][crate::model::MigrationTask::state].
386    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    /// Sets the value of [processing_error][crate::model::MigrationTask::processing_error].
395    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    /// Sets or clears the value of [processing_error][crate::model::MigrationTask::processing_error].
404    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    /// Sets the value of [create_time][crate::model::MigrationTask::create_time].
413    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    /// Sets or clears the value of [create_time][crate::model::MigrationTask::create_time].
422    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    /// Sets the value of [last_update_time][crate::model::MigrationTask::last_update_time].
431    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    /// Sets or clears the value of [last_update_time][crate::model::MigrationTask::last_update_time].
440    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    /// Sets the value of [resource_error_details][crate::model::MigrationTask::resource_error_details].
449    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    /// Sets the value of [resource_error_count][crate::model::MigrationTask::resource_error_count].
460    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    /// Sets the value of [metrics][crate::model::MigrationTask::metrics].
466    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    /// Sets the value of [task_result][crate::model::MigrationTask::task_result].
477    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    /// Sets or clears the value of [task_result][crate::model::MigrationTask::task_result].
486    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    /// Sets the value of [total_processing_error_count][crate::model::MigrationTask::total_processing_error_count].
495    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    /// Sets the value of [total_resource_error_count][crate::model::MigrationTask::total_resource_error_count].
501    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    /// Sets the value of [task_details][crate::model::MigrationTask::task_details].
507    ///
508    /// Note that all the setters affecting `task_details` are mutually
509    /// exclusive.
510    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    /// The value of [task_details][crate::model::MigrationTask::task_details]
521    /// if it holds a `TranslationConfigDetails`, `None` if the field is not set or
522    /// holds a different branch.
523    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    /// Sets the value of [task_details][crate::model::MigrationTask::task_details]
536    /// to hold a `TranslationConfigDetails`.
537    ///
538    /// Note that all the setters affecting `task_details` are
539    /// mutually exclusive.
540    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    /// The value of [task_details][crate::model::MigrationTask::task_details]
553    /// if it holds a `TranslationDetails`, `None` if the field is not set or
554    /// holds a different branch.
555    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    /// Sets the value of [task_details][crate::model::MigrationTask::task_details]
568    /// to hold a `TranslationDetails`.
569    ///
570    /// Note that all the setters affecting `task_details` are
571    /// mutually exclusive.
572    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
591/// Defines additional types related to [MigrationTask].
592pub mod migration_task {
593    #[allow(unused_imports)]
594    use super::*;
595
596    /// Possible states of a migration task.
597    ///
598    /// # Working with unknown values
599    ///
600    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
601    /// additional enum variants at any time. Adding new variants is not considered
602    /// a breaking change. Applications should write their code in anticipation of:
603    ///
604    /// - New values appearing in future releases of the client library, **and**
605    /// - New values received dynamically, without application changes.
606    ///
607    /// Please consult the [Working with enums] section in the user guide for some
608    /// guidelines.
609    ///
610    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
611    #[derive(Clone, Debug, PartialEq)]
612    #[non_exhaustive]
613    pub enum State {
614        /// The state is unspecified.
615        Unspecified,
616        /// The task is waiting for orchestration.
617        Pending,
618        /// The task is assigned to an orchestrator.
619        Orchestrating,
620        /// The task is running, i.e. its subtasks are ready for execution.
621        Running,
622        /// Tha task is paused. Assigned subtasks can continue, but no new subtasks
623        /// will be scheduled.
624        Paused,
625        /// The task finished successfully.
626        Succeeded,
627        /// The task finished unsuccessfully.
628        Failed,
629        /// If set, the enum was initialized with an unknown value.
630        ///
631        /// Applications can examine the value using [State::value] or
632        /// [State::name].
633        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        /// Gets the enum value.
646        ///
647        /// Returns `None` if the enum contains an unknown value deserialized from
648        /// the string representation of enums.
649        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        /// Gets the enum value as a string.
663        ///
664        /// Returns `None` if the enum contains an unknown value deserialized from
665        /// the integer representation of enums.
666        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    /// The details of the task.
758    #[derive(Clone, Debug, PartialEq)]
759    #[non_exhaustive]
760    pub enum TaskDetails {
761        /// Task configuration for CW Batch/Offline SQL Translation.
762        TranslationConfigDetails(std::boxed::Box<crate::model::TranslationConfigDetails>),
763        /// Task details for unified SQL Translation.
764        TranslationDetails(std::boxed::Box<crate::model::TranslationDetails>),
765    }
766}
767
768/// A subtask for a migration which carries details about the configuration of
769/// the subtask. The content of the details should not matter to the end user,
770/// but is a contract between the subtask creator and subtask worker.
771#[derive(Clone, Default, PartialEq)]
772#[non_exhaustive]
773pub struct MigrationSubtask {
774    /// Output only. Immutable. The resource name for the migration subtask. The ID
775    /// is server-generated.
776    ///
777    /// Example: `projects/123/locations/us/workflows/345/subtasks/678`
778    pub name: std::string::String,
779
780    /// The unique ID of the task to which this subtask belongs.
781    pub task_id: std::string::String,
782
783    /// The type of the Subtask. The migration service does not check whether this
784    /// is a known type. It is up to the task creator (i.e. orchestrator or worker)
785    /// to ensure it only creates subtasks for which there are compatible workers
786    /// polling for Subtasks.
787    pub r#type: std::string::String,
788
789    /// Output only. The current state of the subtask.
790    pub state: crate::model::migration_subtask::State,
791
792    /// Output only. An explanation that may be populated when the task is in
793    /// FAILED state.
794    pub processing_error: std::option::Option<rpc::model::ErrorInfo>,
795
796    /// Output only. Provides details to errors and issues encountered while
797    /// processing the subtask. Presence of error details does not mean that the
798    /// subtask failed.
799    pub resource_error_details: std::vec::Vec<crate::model::ResourceErrorDetail>,
800
801    /// The number or resources with errors. Note: This is not the total
802    /// number of errors as each resource can have more than one error.
803    /// This is used to indicate truncation by having a `resource_error_count`
804    /// that is higher than the size of `resource_error_details`.
805    pub resource_error_count: i32,
806
807    /// Time when the subtask was created.
808    pub create_time: std::option::Option<wkt::Timestamp>,
809
810    /// Time when the subtask was last updated.
811    pub last_update_time: std::option::Option<wkt::Timestamp>,
812
813    /// The metrics for the subtask.
814    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    /// Sets the value of [name][crate::model::MigrationSubtask::name].
825    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    /// Sets the value of [task_id][crate::model::MigrationSubtask::task_id].
831    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    /// Sets the value of [r#type][crate::model::MigrationSubtask::type].
837    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    /// Sets the value of [state][crate::model::MigrationSubtask::state].
843    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    /// Sets the value of [processing_error][crate::model::MigrationSubtask::processing_error].
852    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    /// Sets or clears the value of [processing_error][crate::model::MigrationSubtask::processing_error].
861    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    /// Sets the value of [resource_error_details][crate::model::MigrationSubtask::resource_error_details].
870    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    /// Sets the value of [resource_error_count][crate::model::MigrationSubtask::resource_error_count].
881    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    /// Sets the value of [create_time][crate::model::MigrationSubtask::create_time].
887    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    /// Sets or clears the value of [create_time][crate::model::MigrationSubtask::create_time].
896    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    /// Sets the value of [last_update_time][crate::model::MigrationSubtask::last_update_time].
905    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    /// Sets or clears the value of [last_update_time][crate::model::MigrationSubtask::last_update_time].
914    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    /// Sets the value of [metrics][crate::model::MigrationSubtask::metrics].
923    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
940/// Defines additional types related to [MigrationSubtask].
941pub mod migration_subtask {
942    #[allow(unused_imports)]
943    use super::*;
944
945    /// Possible states of a migration subtask.
946    ///
947    /// # Working with unknown values
948    ///
949    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
950    /// additional enum variants at any time. Adding new variants is not considered
951    /// a breaking change. Applications should write their code in anticipation of:
952    ///
953    /// - New values appearing in future releases of the client library, **and**
954    /// - New values received dynamically, without application changes.
955    ///
956    /// Please consult the [Working with enums] section in the user guide for some
957    /// guidelines.
958    ///
959    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
960    #[derive(Clone, Debug, PartialEq)]
961    #[non_exhaustive]
962    pub enum State {
963        /// The state is unspecified.
964        Unspecified,
965        /// The subtask is ready, i.e. it is ready for execution.
966        Active,
967        /// The subtask is running, i.e. it is assigned to a worker for execution.
968        Running,
969        /// The subtask finished successfully.
970        Succeeded,
971        /// The subtask finished unsuccessfully.
972        Failed,
973        /// The subtask is paused, i.e., it will not be scheduled. If it was already
974        /// assigned,it might still finish but no new lease renewals will be granted.
975        Paused,
976        /// The subtask is pending a dependency. It will be scheduled once its
977        /// dependencies are done.
978        PendingDependency,
979        /// If set, the enum was initialized with an unknown value.
980        ///
981        /// Applications can examine the value using [State::value] or
982        /// [State::name].
983        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        /// Gets the enum value.
996        ///
997        /// Returns `None` if the enum contains an unknown value deserialized from
998        /// the string representation of enums.
999        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        /// Gets the enum value as a string.
1013        ///
1014        /// Returns `None` if the enum contains an unknown value deserialized from
1015        /// the integer representation of enums.
1016        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/// The migration task result.
1109#[derive(Clone, Default, PartialEq)]
1110#[non_exhaustive]
1111pub struct MigrationTaskResult {
1112    /// Details specific to the task type.
1113    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    /// Sets the value of [details][crate::model::MigrationTaskResult::details].
1124    ///
1125    /// Note that all the setters affecting `details` are mutually
1126    /// exclusive.
1127    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    /// The value of [details][crate::model::MigrationTaskResult::details]
1138    /// if it holds a `TranslationTaskResult`, `None` if the field is not set or
1139    /// holds a different branch.
1140    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    /// Sets the value of [details][crate::model::MigrationTaskResult::details]
1153    /// to hold a `TranslationTaskResult`.
1154    ///
1155    /// Note that all the setters affecting `details` are
1156    /// mutually exclusive.
1157    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
1176/// Defines additional types related to [MigrationTaskResult].
1177pub mod migration_task_result {
1178    #[allow(unused_imports)]
1179    use super::*;
1180
1181    /// Details specific to the task type.
1182    #[derive(Clone, Debug, PartialEq)]
1183    #[non_exhaustive]
1184    pub enum Details {
1185        /// Details specific to translation task types.
1186        TranslationTaskResult(std::boxed::Box<crate::model::TranslationTaskResult>),
1187    }
1188}
1189
1190/// Translation specific result details from the migration task.
1191#[derive(Clone, Default, PartialEq)]
1192#[non_exhaustive]
1193pub struct TranslationTaskResult {
1194    /// The list of the translated literals.
1195    pub translated_literals: std::vec::Vec<crate::model::Literal>,
1196
1197    /// The records from the aggregate CSV report for a migration workflow.
1198    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    /// Sets the value of [translated_literals][crate::model::TranslationTaskResult::translated_literals].
1209    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    /// Sets the value of [report_log_messages][crate::model::TranslationTaskResult::report_log_messages].
1220    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/// Provides details for errors and the corresponding resources.
1238#[derive(Clone, Default, PartialEq)]
1239#[non_exhaustive]
1240pub struct ResourceErrorDetail {
1241    /// Required. Information about the resource where the error is located.
1242    pub resource_info: std::option::Option<rpc::model::ResourceInfo>,
1243
1244    /// Required. The error details for the resource.
1245    pub error_details: std::vec::Vec<crate::model::ErrorDetail>,
1246
1247    /// Required. How many errors there are in total for the resource. Truncation
1248    /// can be indicated by having an `error_count` that is higher than the size of
1249    /// `error_details`.
1250    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    /// Sets the value of [resource_info][crate::model::ResourceErrorDetail::resource_info].
1261    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    /// Sets or clears the value of [resource_info][crate::model::ResourceErrorDetail::resource_info].
1270    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    /// Sets the value of [error_details][crate::model::ResourceErrorDetail::error_details].
1279    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    /// Sets the value of [error_count][crate::model::ResourceErrorDetail::error_count].
1290    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/// Provides details for errors, e.g. issues that where encountered when
1303/// processing a subtask.
1304#[derive(Clone, Default, PartialEq)]
1305#[non_exhaustive]
1306pub struct ErrorDetail {
1307    /// Optional. The exact location within the resource (if applicable).
1308    pub location: std::option::Option<crate::model::ErrorLocation>,
1309
1310    /// Required. Describes the cause of the error with structured detail.
1311    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    /// Sets the value of [location][crate::model::ErrorDetail::location].
1322    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    /// Sets or clears the value of [location][crate::model::ErrorDetail::location].
1331    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    /// Sets the value of [error_info][crate::model::ErrorDetail::error_info].
1340    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    /// Sets or clears the value of [error_info][crate::model::ErrorDetail::error_info].
1349    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/// Holds information about where the error is located.
1365#[derive(Clone, Default, PartialEq)]
1366#[non_exhaustive]
1367pub struct ErrorLocation {
1368    /// Optional. If applicable, denotes the line where the error occurred. A zero
1369    /// value means that there is no line information.
1370    pub line: i32,
1371
1372    /// Optional. If applicable, denotes the column where the error occurred. A
1373    /// zero value means that there is no columns information.
1374    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    /// Sets the value of [line][crate::model::ErrorLocation::line].
1385    pub fn set_line<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1386        self.line = v.into();
1387        self
1388    }
1389
1390    /// Sets the value of [column][crate::model::ErrorLocation::column].
1391    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/// The metrics object for a SubTask.
1404#[derive(Clone, Default, PartialEq)]
1405#[non_exhaustive]
1406pub struct TimeSeries {
1407    /// Required. The name of the metric.
1408    ///
1409    /// If the metric is not known by the service yet, it will be auto-created.
1410    pub metric: std::string::String,
1411
1412    /// Required. The value type of the time series.
1413    pub value_type: api::model::metric_descriptor::ValueType,
1414
1415    /// Optional. The metric kind of the time series.
1416    ///
1417    /// If present, it must be the same as the metric kind of the associated
1418    /// metric. If the associated metric's descriptor must be auto-created, then
1419    /// this field specifies the metric kind of the new descriptor and must be
1420    /// either `GAUGE` (the default) or `CUMULATIVE`.
1421    pub metric_kind: api::model::metric_descriptor::MetricKind,
1422
1423    /// Required. The data points of this time series. When listing time series,
1424    /// points are returned in reverse time order.
1425    ///
1426    /// When creating a time series, this field must contain exactly one point and
1427    /// the point's type must be the same as the value type of the associated
1428    /// metric. If the associated metric's descriptor must be auto-created, then
1429    /// the value type of the descriptor is determined by the point's type, which
1430    /// must be `BOOL`, `INT64`, `DOUBLE`, or `DISTRIBUTION`.
1431    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    /// Sets the value of [metric][crate::model::TimeSeries::metric].
1442    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    /// Sets the value of [value_type][crate::model::TimeSeries::value_type].
1448    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    /// Sets the value of [metric_kind][crate::model::TimeSeries::metric_kind].
1457    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    /// Sets the value of [points][crate::model::TimeSeries::points].
1466    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/// A single data point in a time series.
1484#[derive(Clone, Default, PartialEq)]
1485#[non_exhaustive]
1486pub struct Point {
1487    /// The time interval to which the data point applies.  For `GAUGE` metrics,
1488    /// the start time does not need to be supplied, but if it is supplied, it must
1489    /// equal the end time.  For `DELTA` metrics, the start and end time should
1490    /// specify a non-zero interval, with subsequent points specifying contiguous
1491    /// and non-overlapping intervals.  For `CUMULATIVE` metrics, the start and end
1492    /// time should specify a non-zero interval, with subsequent points specifying
1493    /// the same start time and increasing end times, until an event resets the
1494    /// cumulative value to zero and sets a new start time for the following
1495    /// points.
1496    pub interval: std::option::Option<crate::model::TimeInterval>,
1497
1498    /// The value of the data point.
1499    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    /// Sets the value of [interval][crate::model::Point::interval].
1510    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    /// Sets or clears the value of [interval][crate::model::Point::interval].
1519    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    /// Sets the value of [value][crate::model::Point::value].
1528    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    /// Sets or clears the value of [value][crate::model::Point::value].
1537    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/// A time interval extending just after a start time through an end time.
1553/// If the start time is the same as the end time, then the interval
1554/// represents a single point in time.
1555#[derive(Clone, Default, PartialEq)]
1556#[non_exhaustive]
1557pub struct TimeInterval {
1558    /// Optional. The beginning of the time interval.  The default value
1559    /// for the start time is the end time. The start time must not be
1560    /// later than the end time.
1561    pub start_time: std::option::Option<wkt::Timestamp>,
1562
1563    /// Required. The end of the time interval.
1564    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    /// Sets the value of [start_time][crate::model::TimeInterval::start_time].
1575    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    /// Sets or clears the value of [start_time][crate::model::TimeInterval::start_time].
1584    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    /// Sets the value of [end_time][crate::model::TimeInterval::end_time].
1593    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    /// Sets or clears the value of [end_time][crate::model::TimeInterval::end_time].
1602    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/// A single strongly-typed value.
1618#[derive(Clone, Default, PartialEq)]
1619#[non_exhaustive]
1620pub struct TypedValue {
1621    /// The typed value field.
1622    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    /// Sets the value of [value][crate::model::TypedValue::value].
1633    ///
1634    /// Note that all the setters affecting `value` are mutually
1635    /// exclusive.
1636    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    /// The value of [value][crate::model::TypedValue::value]
1647    /// if it holds a `BoolValue`, `None` if the field is not set or
1648    /// holds a different branch.
1649    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    /// Sets the value of [value][crate::model::TypedValue::value]
1658    /// to hold a `BoolValue`.
1659    ///
1660    /// Note that all the setters affecting `value` are
1661    /// mutually exclusive.
1662    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    /// The value of [value][crate::model::TypedValue::value]
1669    /// if it holds a `Int64Value`, `None` if the field is not set or
1670    /// holds a different branch.
1671    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    /// Sets the value of [value][crate::model::TypedValue::value]
1680    /// to hold a `Int64Value`.
1681    ///
1682    /// Note that all the setters affecting `value` are
1683    /// mutually exclusive.
1684    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    /// The value of [value][crate::model::TypedValue::value]
1691    /// if it holds a `DoubleValue`, `None` if the field is not set or
1692    /// holds a different branch.
1693    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    /// Sets the value of [value][crate::model::TypedValue::value]
1702    /// to hold a `DoubleValue`.
1703    ///
1704    /// Note that all the setters affecting `value` are
1705    /// mutually exclusive.
1706    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    /// The value of [value][crate::model::TypedValue::value]
1713    /// if it holds a `StringValue`, `None` if the field is not set or
1714    /// holds a different branch.
1715    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    /// Sets the value of [value][crate::model::TypedValue::value]
1724    /// to hold a `StringValue`.
1725    ///
1726    /// Note that all the setters affecting `value` are
1727    /// mutually exclusive.
1728    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    /// The value of [value][crate::model::TypedValue::value]
1735    /// if it holds a `DistributionValue`, `None` if the field is not set or
1736    /// holds a different branch.
1737    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    /// Sets the value of [value][crate::model::TypedValue::value]
1748    /// to hold a `DistributionValue`.
1749    ///
1750    /// Note that all the setters affecting `value` are
1751    /// mutually exclusive.
1752    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
1771/// Defines additional types related to [TypedValue].
1772pub mod typed_value {
1773    #[allow(unused_imports)]
1774    use super::*;
1775
1776    /// The typed value field.
1777    #[derive(Clone, Debug, PartialEq)]
1778    #[non_exhaustive]
1779    pub enum Value {
1780        /// A Boolean value: `true` or `false`.
1781        BoolValue(bool),
1782        /// A 64-bit integer. Its range is approximately `+/-9.2x10^18`.
1783        Int64Value(i64),
1784        /// A 64-bit double-precision floating-point number. Its magnitude
1785        /// is approximately `+/-10^(+/-300)` and it has 16 significant digits of
1786        /// precision.
1787        DoubleValue(f64),
1788        /// A variable-length string value.
1789        StringValue(std::string::String),
1790        /// A distribution value.
1791        DistributionValue(std::boxed::Box<api::model::Distribution>),
1792    }
1793}
1794
1795/// Request to create a migration workflow resource.
1796#[derive(Clone, Default, PartialEq)]
1797#[non_exhaustive]
1798pub struct CreateMigrationWorkflowRequest {
1799    /// Required. The name of the project to which this migration workflow belongs.
1800    /// Example: `projects/foo/locations/bar`
1801    pub parent: std::string::String,
1802
1803    /// Required. The migration workflow to create.
1804    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    /// Sets the value of [parent][crate::model::CreateMigrationWorkflowRequest::parent].
1815    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    /// Sets the value of [migration_workflow][crate::model::CreateMigrationWorkflowRequest::migration_workflow].
1821    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    /// Sets or clears the value of [migration_workflow][crate::model::CreateMigrationWorkflowRequest::migration_workflow].
1830    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/// A request to get a previously created migration workflow.
1846#[derive(Clone, Default, PartialEq)]
1847#[non_exhaustive]
1848pub struct GetMigrationWorkflowRequest {
1849    /// Required. The unique identifier for the migration workflow.
1850    /// Example: `projects/123/locations/us/workflows/1234`
1851    pub name: std::string::String,
1852
1853    /// The list of fields to be retrieved.
1854    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    /// Sets the value of [name][crate::model::GetMigrationWorkflowRequest::name].
1865    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    /// Sets the value of [read_mask][crate::model::GetMigrationWorkflowRequest::read_mask].
1871    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    /// Sets or clears the value of [read_mask][crate::model::GetMigrationWorkflowRequest::read_mask].
1880    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/// A request to list previously created migration workflows.
1896#[derive(Clone, Default, PartialEq)]
1897#[non_exhaustive]
1898pub struct ListMigrationWorkflowsRequest {
1899    /// Required. The project and location of the migration workflows to list.
1900    /// Example: `projects/123/locations/us`
1901    pub parent: std::string::String,
1902
1903    /// The list of fields to be retrieved.
1904    pub read_mask: std::option::Option<wkt::FieldMask>,
1905
1906    /// The maximum number of migration workflows to return. The service may return
1907    /// fewer than this number.
1908    pub page_size: i32,
1909
1910    /// A page token, received from previous `ListMigrationWorkflows` call.
1911    /// Provide this to retrieve the subsequent page.
1912    ///
1913    /// When paginating, all other parameters provided to `ListMigrationWorkflows`
1914    /// must match the call that provided the page token.
1915    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    /// Sets the value of [parent][crate::model::ListMigrationWorkflowsRequest::parent].
1926    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    /// Sets the value of [read_mask][crate::model::ListMigrationWorkflowsRequest::read_mask].
1932    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    /// Sets or clears the value of [read_mask][crate::model::ListMigrationWorkflowsRequest::read_mask].
1941    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    /// Sets the value of [page_size][crate::model::ListMigrationWorkflowsRequest::page_size].
1950    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    /// Sets the value of [page_token][crate::model::ListMigrationWorkflowsRequest::page_token].
1956    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/// Response object for a `ListMigrationWorkflows` call.
1969#[derive(Clone, Default, PartialEq)]
1970#[non_exhaustive]
1971pub struct ListMigrationWorkflowsResponse {
1972    /// The migration workflows for the specified project / location.
1973    pub migration_workflows: std::vec::Vec<crate::model::MigrationWorkflow>,
1974
1975    /// A token, which can be sent as `page_token` to retrieve the next page.
1976    /// If this field is omitted, there are no subsequent pages.
1977    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    /// Sets the value of [migration_workflows][crate::model::ListMigrationWorkflowsResponse::migration_workflows].
1988    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    /// Sets the value of [next_page_token][crate::model::ListMigrationWorkflowsResponse::next_page_token].
1999    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/// A request to delete a previously created migration workflow.
2026#[derive(Clone, Default, PartialEq)]
2027#[non_exhaustive]
2028pub struct DeleteMigrationWorkflowRequest {
2029    /// Required. The unique identifier for the migration workflow.
2030    /// Example: `projects/123/locations/us/workflows/1234`
2031    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    /// Sets the value of [name][crate::model::DeleteMigrationWorkflowRequest::name].
2042    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/// A request to start a previously created migration workflow.
2055#[derive(Clone, Default, PartialEq)]
2056#[non_exhaustive]
2057pub struct StartMigrationWorkflowRequest {
2058    /// Required. The unique identifier for the migration workflow.
2059    /// Example: `projects/123/locations/us/workflows/1234`
2060    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    /// Sets the value of [name][crate::model::StartMigrationWorkflowRequest::name].
2071    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/// A request to get a previously created migration subtasks.
2084#[derive(Clone, Default, PartialEq)]
2085#[non_exhaustive]
2086pub struct GetMigrationSubtaskRequest {
2087    /// Required. The unique identifier for the migration subtask.
2088    /// Example: `projects/123/locations/us/workflows/1234/subtasks/543`
2089    pub name: std::string::String,
2090
2091    /// Optional. The list of fields to be retrieved.
2092    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    /// Sets the value of [name][crate::model::GetMigrationSubtaskRequest::name].
2103    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    /// Sets the value of [read_mask][crate::model::GetMigrationSubtaskRequest::read_mask].
2109    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    /// Sets or clears the value of [read_mask][crate::model::GetMigrationSubtaskRequest::read_mask].
2118    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/// A request to list previously created migration subtasks.
2134#[derive(Clone, Default, PartialEq)]
2135#[non_exhaustive]
2136pub struct ListMigrationSubtasksRequest {
2137    /// Required. The migration task of the subtasks to list.
2138    /// Example: `projects/123/locations/us/workflows/1234`
2139    pub parent: std::string::String,
2140
2141    /// Optional. The list of fields to be retrieved.
2142    pub read_mask: std::option::Option<wkt::FieldMask>,
2143
2144    /// Optional. The maximum number of migration tasks to return. The service may
2145    /// return fewer than this number.
2146    pub page_size: i32,
2147
2148    /// Optional. A page token, received from previous `ListMigrationSubtasks`
2149    /// call. Provide this to retrieve the subsequent page.
2150    ///
2151    /// When paginating, all other parameters provided to `ListMigrationSubtasks`
2152    /// must match the call that provided the page token.
2153    pub page_token: std::string::String,
2154
2155    /// Optional. The filter to apply. This can be used to get the subtasks of a
2156    /// specific tasks in a workflow, e.g. `migration_task = "ab012"` where
2157    /// `"ab012"` is the task ID (not the name in the named map).
2158    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    /// Sets the value of [parent][crate::model::ListMigrationSubtasksRequest::parent].
2169    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    /// Sets the value of [read_mask][crate::model::ListMigrationSubtasksRequest::read_mask].
2175    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    /// Sets or clears the value of [read_mask][crate::model::ListMigrationSubtasksRequest::read_mask].
2184    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    /// Sets the value of [page_size][crate::model::ListMigrationSubtasksRequest::page_size].
2193    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    /// Sets the value of [page_token][crate::model::ListMigrationSubtasksRequest::page_token].
2199    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    /// Sets the value of [filter][crate::model::ListMigrationSubtasksRequest::filter].
2205    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/// Response object for a `ListMigrationSubtasks` call.
2218#[derive(Clone, Default, PartialEq)]
2219#[non_exhaustive]
2220pub struct ListMigrationSubtasksResponse {
2221    /// The migration subtasks for the specified task.
2222    pub migration_subtasks: std::vec::Vec<crate::model::MigrationSubtask>,
2223
2224    /// A token, which can be sent as `page_token` to retrieve the next page.
2225    /// If this field is omitted, there are no subsequent pages.
2226    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    /// Sets the value of [migration_subtasks][crate::model::ListMigrationSubtasksResponse::migration_subtasks].
2237    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    /// Sets the value of [next_page_token][crate::model::ListMigrationSubtasksResponse::next_page_token].
2248    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/// The translation config to capture necessary settings for a translation task
2275/// and subtask.
2276#[derive(Clone, Default, PartialEq)]
2277#[non_exhaustive]
2278pub struct TranslationConfigDetails {
2279    /// The dialect of the input files.
2280    pub source_dialect: std::option::Option<crate::model::Dialect>,
2281
2282    /// The target dialect for the engine to translate the input to.
2283    pub target_dialect: std::option::Option<crate::model::Dialect>,
2284
2285    /// The default source environment values for the translation.
2286    pub source_env: std::option::Option<crate::model::SourceEnv>,
2287
2288    /// The indicator to show translation request initiator.
2289    pub request_source: std::string::String,
2290
2291    /// The types of output to generate, e.g. sql, metadata etc. If not specified,
2292    /// a default set of targets will be generated. Some additional target types
2293    /// may be slower to generate. See the documentation for the set of available
2294    /// target types.
2295    pub target_types: std::vec::Vec<std::string::String>,
2296
2297    /// The chosen path where the source for input files will be found.
2298    pub source_location:
2299        std::option::Option<crate::model::translation_config_details::SourceLocation>,
2300
2301    /// The chosen path where the destination for output files will be found.
2302    pub target_location:
2303        std::option::Option<crate::model::translation_config_details::TargetLocation>,
2304
2305    /// The mapping of full SQL object names from their current state to the
2306    /// desired output.
2307    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    /// Sets the value of [source_dialect][crate::model::TranslationConfigDetails::source_dialect].
2319    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    /// Sets or clears the value of [source_dialect][crate::model::TranslationConfigDetails::source_dialect].
2328    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    /// Sets the value of [target_dialect][crate::model::TranslationConfigDetails::target_dialect].
2337    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    /// Sets or clears the value of [target_dialect][crate::model::TranslationConfigDetails::target_dialect].
2346    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    /// Sets the value of [source_env][crate::model::TranslationConfigDetails::source_env].
2355    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    /// Sets or clears the value of [source_env][crate::model::TranslationConfigDetails::source_env].
2364    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    /// Sets the value of [request_source][crate::model::TranslationConfigDetails::request_source].
2373    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    /// Sets the value of [target_types][crate::model::TranslationConfigDetails::target_types].
2379    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    /// Sets the value of [source_location][crate::model::TranslationConfigDetails::source_location].
2390    ///
2391    /// Note that all the setters affecting `source_location` are mutually
2392    /// exclusive.
2393    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    /// The value of [source_location][crate::model::TranslationConfigDetails::source_location]
2406    /// if it holds a `GcsSourcePath`, `None` if the field is not set or
2407    /// holds a different branch.
2408    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    /// Sets the value of [source_location][crate::model::TranslationConfigDetails::source_location]
2419    /// to hold a `GcsSourcePath`.
2420    ///
2421    /// Note that all the setters affecting `source_location` are
2422    /// mutually exclusive.
2423    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    /// Sets the value of [target_location][crate::model::TranslationConfigDetails::target_location].
2431    ///
2432    /// Note that all the setters affecting `target_location` are mutually
2433    /// exclusive.
2434    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    /// The value of [target_location][crate::model::TranslationConfigDetails::target_location]
2447    /// if it holds a `GcsTargetPath`, `None` if the field is not set or
2448    /// holds a different branch.
2449    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    /// Sets the value of [target_location][crate::model::TranslationConfigDetails::target_location]
2460    /// to hold a `GcsTargetPath`.
2461    ///
2462    /// Note that all the setters affecting `target_location` are
2463    /// mutually exclusive.
2464    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    /// Sets the value of [output_name_mapping][crate::model::TranslationConfigDetails::output_name_mapping].
2472    ///
2473    /// Note that all the setters affecting `output_name_mapping` are mutually
2474    /// exclusive.
2475    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    /// The value of [output_name_mapping][crate::model::TranslationConfigDetails::output_name_mapping]
2488    /// if it holds a `NameMappingList`, `None` if the field is not set or
2489    /// holds a different branch.
2490    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    /// Sets the value of [output_name_mapping][crate::model::TranslationConfigDetails::output_name_mapping]
2503    /// to hold a `NameMappingList`.
2504    ///
2505    /// Note that all the setters affecting `output_name_mapping` are
2506    /// mutually exclusive.
2507    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
2526/// Defines additional types related to [TranslationConfigDetails].
2527pub mod translation_config_details {
2528    #[allow(unused_imports)]
2529    use super::*;
2530
2531    /// The chosen path where the source for input files will be found.
2532    #[derive(Clone, Debug, PartialEq)]
2533    #[non_exhaustive]
2534    pub enum SourceLocation {
2535        /// The Cloud Storage path for a directory of files to translate in a task.
2536        GcsSourcePath(std::string::String),
2537    }
2538
2539    /// The chosen path where the destination for output files will be found.
2540    #[derive(Clone, Debug, PartialEq)]
2541    #[non_exhaustive]
2542    pub enum TargetLocation {
2543        /// The Cloud Storage path to write back the corresponding input files to.
2544        GcsTargetPath(std::string::String),
2545    }
2546
2547    /// The mapping of full SQL object names from their current state to the
2548    /// desired output.
2549    #[derive(Clone, Debug, PartialEq)]
2550    #[non_exhaustive]
2551    pub enum OutputNameMapping {
2552        /// The mapping of objects to their desired output names in list form.
2553        NameMappingList(std::boxed::Box<crate::model::ObjectNameMappingList>),
2554    }
2555}
2556
2557/// The possible dialect options for translation.
2558#[derive(Clone, Default, PartialEq)]
2559#[non_exhaustive]
2560pub struct Dialect {
2561    /// The possible dialect options that this message represents.
2562    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    /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value].
2573    ///
2574    /// Note that all the setters affecting `dialect_value` are mutually
2575    /// exclusive.
2576    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    /// The value of [dialect_value][crate::model::Dialect::dialect_value]
2587    /// if it holds a `BigqueryDialect`, `None` if the field is not set or
2588    /// holds a different branch.
2589    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    /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
2600    /// to hold a `BigqueryDialect`.
2601    ///
2602    /// Note that all the setters affecting `dialect_value` are
2603    /// mutually exclusive.
2604    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    /// The value of [dialect_value][crate::model::Dialect::dialect_value]
2617    /// if it holds a `HiveqlDialect`, `None` if the field is not set or
2618    /// holds a different branch.
2619    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    /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
2630    /// to hold a `HiveqlDialect`.
2631    ///
2632    /// Note that all the setters affecting `dialect_value` are
2633    /// mutually exclusive.
2634    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    /// The value of [dialect_value][crate::model::Dialect::dialect_value]
2646    /// if it holds a `RedshiftDialect`, `None` if the field is not set or
2647    /// holds a different branch.
2648    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    /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
2659    /// to hold a `RedshiftDialect`.
2660    ///
2661    /// Note that all the setters affecting `dialect_value` are
2662    /// mutually exclusive.
2663    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    /// The value of [dialect_value][crate::model::Dialect::dialect_value]
2676    /// if it holds a `TeradataDialect`, `None` if the field is not set or
2677    /// holds a different branch.
2678    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    /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
2689    /// to hold a `TeradataDialect`.
2690    ///
2691    /// Note that all the setters affecting `dialect_value` are
2692    /// mutually exclusive.
2693    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    /// The value of [dialect_value][crate::model::Dialect::dialect_value]
2706    /// if it holds a `OracleDialect`, `None` if the field is not set or
2707    /// holds a different branch.
2708    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    /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
2719    /// to hold a `OracleDialect`.
2720    ///
2721    /// Note that all the setters affecting `dialect_value` are
2722    /// mutually exclusive.
2723    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    /// The value of [dialect_value][crate::model::Dialect::dialect_value]
2735    /// if it holds a `SparksqlDialect`, `None` if the field is not set or
2736    /// holds a different branch.
2737    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    /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
2748    /// to hold a `SparksqlDialect`.
2749    ///
2750    /// Note that all the setters affecting `dialect_value` are
2751    /// mutually exclusive.
2752    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    /// The value of [dialect_value][crate::model::Dialect::dialect_value]
2765    /// if it holds a `SnowflakeDialect`, `None` if the field is not set or
2766    /// holds a different branch.
2767    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    /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
2780    /// to hold a `SnowflakeDialect`.
2781    ///
2782    /// Note that all the setters affecting `dialect_value` are
2783    /// mutually exclusive.
2784    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    /// The value of [dialect_value][crate::model::Dialect::dialect_value]
2797    /// if it holds a `NetezzaDialect`, `None` if the field is not set or
2798    /// holds a different branch.
2799    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    /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
2810    /// to hold a `NetezzaDialect`.
2811    ///
2812    /// Note that all the setters affecting `dialect_value` are
2813    /// mutually exclusive.
2814    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    /// The value of [dialect_value][crate::model::Dialect::dialect_value]
2827    /// if it holds a `AzureSynapseDialect`, `None` if the field is not set or
2828    /// holds a different branch.
2829    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    /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
2842    /// to hold a `AzureSynapseDialect`.
2843    ///
2844    /// Note that all the setters affecting `dialect_value` are
2845    /// mutually exclusive.
2846    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    /// The value of [dialect_value][crate::model::Dialect::dialect_value]
2859    /// if it holds a `VerticaDialect`, `None` if the field is not set or
2860    /// holds a different branch.
2861    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    /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
2872    /// to hold a `VerticaDialect`.
2873    ///
2874    /// Note that all the setters affecting `dialect_value` are
2875    /// mutually exclusive.
2876    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    /// The value of [dialect_value][crate::model::Dialect::dialect_value]
2889    /// if it holds a `SqlServerDialect`, `None` if the field is not set or
2890    /// holds a different branch.
2891    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    /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
2904    /// to hold a `SqlServerDialect`.
2905    ///
2906    /// Note that all the setters affecting `dialect_value` are
2907    /// mutually exclusive.
2908    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    /// The value of [dialect_value][crate::model::Dialect::dialect_value]
2921    /// if it holds a `PostgresqlDialect`, `None` if the field is not set or
2922    /// holds a different branch.
2923    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    /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
2936    /// to hold a `PostgresqlDialect`.
2937    ///
2938    /// Note that all the setters affecting `dialect_value` are
2939    /// mutually exclusive.
2940    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    /// The value of [dialect_value][crate::model::Dialect::dialect_value]
2953    /// if it holds a `PrestoDialect`, `None` if the field is not set or
2954    /// holds a different branch.
2955    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    /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
2966    /// to hold a `PrestoDialect`.
2967    ///
2968    /// Note that all the setters affecting `dialect_value` are
2969    /// mutually exclusive.
2970    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    /// The value of [dialect_value][crate::model::Dialect::dialect_value]
2982    /// if it holds a `MysqlDialect`, `None` if the field is not set or
2983    /// holds a different branch.
2984    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    /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
2995    /// to hold a `MysqlDialect`.
2996    ///
2997    /// Note that all the setters affecting `dialect_value` are
2998    /// mutually exclusive.
2999    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    /// The value of [dialect_value][crate::model::Dialect::dialect_value]
3009    /// if it holds a `Db2Dialect`, `None` if the field is not set or
3010    /// holds a different branch.
3011    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    /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
3020    /// to hold a `Db2Dialect`.
3021    ///
3022    /// Note that all the setters affecting `dialect_value` are
3023    /// mutually exclusive.
3024    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    /// The value of [dialect_value][crate::model::Dialect::dialect_value]
3034    /// if it holds a `SqliteDialect`, `None` if the field is not set or
3035    /// holds a different branch.
3036    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    /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
3047    /// to hold a `SqliteDialect`.
3048    ///
3049    /// Note that all the setters affecting `dialect_value` are
3050    /// mutually exclusive.
3051    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    /// The value of [dialect_value][crate::model::Dialect::dialect_value]
3063    /// if it holds a `GreenplumDialect`, `None` if the field is not set or
3064    /// holds a different branch.
3065    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    /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
3078    /// to hold a `GreenplumDialect`.
3079    ///
3080    /// Note that all the setters affecting `dialect_value` are
3081    /// mutually exclusive.
3082    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
3101/// Defines additional types related to [Dialect].
3102pub mod dialect {
3103    #[allow(unused_imports)]
3104    use super::*;
3105
3106    /// The possible dialect options that this message represents.
3107    #[derive(Clone, Debug, PartialEq)]
3108    #[non_exhaustive]
3109    pub enum DialectValue {
3110        /// The BigQuery dialect
3111        BigqueryDialect(std::boxed::Box<crate::model::BigQueryDialect>),
3112        /// The HiveQL dialect
3113        HiveqlDialect(std::boxed::Box<crate::model::HiveQLDialect>),
3114        /// The Redshift dialect
3115        RedshiftDialect(std::boxed::Box<crate::model::RedshiftDialect>),
3116        /// The Teradata dialect
3117        TeradataDialect(std::boxed::Box<crate::model::TeradataDialect>),
3118        /// The Oracle dialect
3119        OracleDialect(std::boxed::Box<crate::model::OracleDialect>),
3120        /// The SparkSQL dialect
3121        SparksqlDialect(std::boxed::Box<crate::model::SparkSQLDialect>),
3122        /// The Snowflake dialect
3123        SnowflakeDialect(std::boxed::Box<crate::model::SnowflakeDialect>),
3124        /// The Netezza dialect
3125        NetezzaDialect(std::boxed::Box<crate::model::NetezzaDialect>),
3126        /// The Azure Synapse dialect
3127        AzureSynapseDialect(std::boxed::Box<crate::model::AzureSynapseDialect>),
3128        /// The Vertica dialect
3129        VerticaDialect(std::boxed::Box<crate::model::VerticaDialect>),
3130        /// The SQL Server dialect
3131        SqlServerDialect(std::boxed::Box<crate::model::SQLServerDialect>),
3132        /// The Postgresql dialect
3133        PostgresqlDialect(std::boxed::Box<crate::model::PostgresqlDialect>),
3134        /// The Presto dialect
3135        PrestoDialect(std::boxed::Box<crate::model::PrestoDialect>),
3136        /// The MySQL dialect
3137        MysqlDialect(std::boxed::Box<crate::model::MySQLDialect>),
3138        /// DB2 dialect
3139        Db2Dialect(std::boxed::Box<crate::model::DB2Dialect>),
3140        /// SQLite dialect
3141        SqliteDialect(std::boxed::Box<crate::model::SQLiteDialect>),
3142        /// Greenplum dialect
3143        GreenplumDialect(std::boxed::Box<crate::model::GreenplumDialect>),
3144    }
3145}
3146
3147/// The dialect definition for BigQuery.
3148#[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/// The dialect definition for HiveQL.
3167#[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/// The dialect definition for Redshift.
3186#[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/// The dialect definition for Teradata.
3205#[derive(Clone, Default, PartialEq)]
3206#[non_exhaustive]
3207pub struct TeradataDialect {
3208    /// Which Teradata sub-dialect mode the user specifies.
3209    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    /// Sets the value of [mode][crate::model::TeradataDialect::mode].
3220    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
3235/// Defines additional types related to [TeradataDialect].
3236pub mod teradata_dialect {
3237    #[allow(unused_imports)]
3238    use super::*;
3239
3240    /// The sub-dialect options for Teradata.
3241    ///
3242    /// # Working with unknown values
3243    ///
3244    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3245    /// additional enum variants at any time. Adding new variants is not considered
3246    /// a breaking change. Applications should write their code in anticipation of:
3247    ///
3248    /// - New values appearing in future releases of the client library, **and**
3249    /// - New values received dynamically, without application changes.
3250    ///
3251    /// Please consult the [Working with enums] section in the user guide for some
3252    /// guidelines.
3253    ///
3254    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3255    #[derive(Clone, Debug, PartialEq)]
3256    #[non_exhaustive]
3257    pub enum Mode {
3258        /// Unspecified mode.
3259        Unspecified,
3260        /// Teradata SQL mode.
3261        Sql,
3262        /// BTEQ mode (which includes SQL).
3263        Bteq,
3264        /// If set, the enum was initialized with an unknown value.
3265        ///
3266        /// Applications can examine the value using [Mode::value] or
3267        /// [Mode::name].
3268        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        /// Gets the enum value.
3281        ///
3282        /// Returns `None` if the enum contains an unknown value deserialized from
3283        /// the string representation of enums.
3284        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        /// Gets the enum value as a string.
3294        ///
3295        /// Returns `None` if the enum contains an unknown value deserialized from
3296        /// the integer representation of enums.
3297        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/// The dialect definition for Oracle.
3374#[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/// The dialect definition for SparkSQL.
3393#[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/// The dialect definition for Snowflake.
3412#[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/// The dialect definition for Netezza.
3431#[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/// The dialect definition for Azure Synapse.
3450#[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/// The dialect definition for Vertica.
3469#[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/// The dialect definition for SQL Server.
3488#[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/// The dialect definition for Postgresql.
3507#[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/// The dialect definition for Presto.
3526#[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/// The dialect definition for MySQL.
3545#[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/// The dialect definition for DB2.
3564#[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/// The dialect definition for SQLite.
3583#[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/// The dialect definition for Greenplum.
3602#[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/// Represents a map of name mappings using a list of key:value proto messages of
3621/// existing name to desired output name.
3622#[derive(Clone, Default, PartialEq)]
3623#[non_exhaustive]
3624pub struct ObjectNameMappingList {
3625    /// The elements of the object name map.
3626    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    /// Sets the value of [name_map][crate::model::ObjectNameMappingList::name_map].
3637    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/// Represents a key-value pair of NameMappingKey to NameMappingValue to
3655/// represent the mapping of SQL names from the input value to desired output.
3656#[derive(Clone, Default, PartialEq)]
3657#[non_exhaustive]
3658pub struct ObjectNameMapping {
3659    /// The name of the object in source that is being mapped.
3660    pub source: std::option::Option<crate::model::NameMappingKey>,
3661
3662    /// The desired target name of the object that is being mapped.
3663    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    /// Sets the value of [source][crate::model::ObjectNameMapping::source].
3674    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    /// Sets or clears the value of [source][crate::model::ObjectNameMapping::source].
3683    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    /// Sets the value of [target][crate::model::ObjectNameMapping::target].
3692    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    /// Sets or clears the value of [target][crate::model::ObjectNameMapping::target].
3701    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/// The potential components of a full name mapping that will be mapped
3717/// during translation in the source data warehouse.
3718#[derive(Clone, Default, PartialEq)]
3719#[non_exhaustive]
3720pub struct NameMappingKey {
3721    /// The type of object that is being mapped.
3722    pub r#type: crate::model::name_mapping_key::Type,
3723
3724    /// The database name (BigQuery project ID equivalent in the source data
3725    /// warehouse).
3726    pub database: std::string::String,
3727
3728    /// The schema name (BigQuery dataset equivalent in the source data warehouse).
3729    pub schema: std::string::String,
3730
3731    /// The relation name (BigQuery table or view equivalent in the source data
3732    /// warehouse).
3733    pub relation: std::string::String,
3734
3735    /// The attribute name (BigQuery column equivalent in the source data
3736    /// warehouse).
3737    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    /// Sets the value of [r#type][crate::model::NameMappingKey::type].
3748    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    /// Sets the value of [database][crate::model::NameMappingKey::database].
3757    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    /// Sets the value of [schema][crate::model::NameMappingKey::schema].
3763    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    /// Sets the value of [relation][crate::model::NameMappingKey::relation].
3769    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    /// Sets the value of [attribute][crate::model::NameMappingKey::attribute].
3775    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
3787/// Defines additional types related to [NameMappingKey].
3788pub mod name_mapping_key {
3789    #[allow(unused_imports)]
3790    use super::*;
3791
3792    /// The type of the object that is being mapped.
3793    ///
3794    /// # Working with unknown values
3795    ///
3796    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3797    /// additional enum variants at any time. Adding new variants is not considered
3798    /// a breaking change. Applications should write their code in anticipation of:
3799    ///
3800    /// - New values appearing in future releases of the client library, **and**
3801    /// - New values received dynamically, without application changes.
3802    ///
3803    /// Please consult the [Working with enums] section in the user guide for some
3804    /// guidelines.
3805    ///
3806    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3807    #[derive(Clone, Debug, PartialEq)]
3808    #[non_exhaustive]
3809    pub enum Type {
3810        /// Unspecified name mapping type.
3811        Unspecified,
3812        /// The object being mapped is a database.
3813        Database,
3814        /// The object being mapped is a schema.
3815        Schema,
3816        /// The object being mapped is a relation.
3817        Relation,
3818        /// The object being mapped is an attribute.
3819        Attribute,
3820        /// The object being mapped is a relation alias.
3821        RelationAlias,
3822        /// The object being mapped is a an attribute alias.
3823        AttributeAlias,
3824        /// The object being mapped is a function.
3825        Function,
3826        /// If set, the enum was initialized with an unknown value.
3827        ///
3828        /// Applications can examine the value using [Type::value] or
3829        /// [Type::name].
3830        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        /// Gets the enum value.
3843        ///
3844        /// Returns `None` if the enum contains an unknown value deserialized from
3845        /// the string representation of enums.
3846        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        /// Gets the enum value as a string.
3861        ///
3862        /// Returns `None` if the enum contains an unknown value deserialized from
3863        /// the integer representation of enums.
3864        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/// The potential components of a full name mapping that will be mapped
3961/// during translation in the target data warehouse.
3962#[derive(Clone, Default, PartialEq)]
3963#[non_exhaustive]
3964pub struct NameMappingValue {
3965    /// The database name (BigQuery project ID equivalent in the target data
3966    /// warehouse).
3967    pub database: std::string::String,
3968
3969    /// The schema name (BigQuery dataset equivalent in the target data warehouse).
3970    pub schema: std::string::String,
3971
3972    /// The relation name (BigQuery table or view equivalent in the target data
3973    /// warehouse).
3974    pub relation: std::string::String,
3975
3976    /// The attribute name (BigQuery column equivalent in the target data
3977    /// warehouse).
3978    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    /// Sets the value of [database][crate::model::NameMappingValue::database].
3989    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    /// Sets the value of [schema][crate::model::NameMappingValue::schema].
3995    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    /// Sets the value of [relation][crate::model::NameMappingValue::relation].
4001    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    /// Sets the value of [attribute][crate::model::NameMappingValue::attribute].
4007    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/// Represents the default source environment values for the translation.
4020#[derive(Clone, Default, PartialEq)]
4021#[non_exhaustive]
4022pub struct SourceEnv {
4023    /// The default database name to fully qualify SQL objects when their database
4024    /// name is missing.
4025    pub default_database: std::string::String,
4026
4027    /// The schema search path. When SQL objects are missing schema name,
4028    /// translation engine will search through this list to find the value.
4029    pub schema_search_path: std::vec::Vec<std::string::String>,
4030
4031    /// Optional. Expects a valid BigQuery dataset ID that exists, e.g.,
4032    /// project-123.metadata_store_123.  If specified, translation will search and
4033    /// read the required schema information from a metadata store in this dataset.
4034    /// If metadata store doesn't exist, translation will parse the metadata file
4035    /// and upload the schema info to a temp table in the dataset to speed up
4036    /// future translation jobs.
4037    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    /// Sets the value of [default_database][crate::model::SourceEnv::default_database].
4048    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    /// Sets the value of [schema_search_path][crate::model::SourceEnv::schema_search_path].
4057    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    /// Sets the value of [metadata_store_dataset][crate::model::SourceEnv::metadata_store_dataset].
4068    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/// The translation details to capture the necessary settings for a translation
4084/// job.
4085#[derive(Clone, Default, PartialEq)]
4086#[non_exhaustive]
4087pub struct TranslationDetails {
4088    /// The mapping from source to target SQL.
4089    pub source_target_mapping: std::vec::Vec<crate::model::SourceTargetMapping>,
4090
4091    /// The base URI for all writes to persistent storage.
4092    pub target_base_uri: std::string::String,
4093
4094    /// The default source environment values for the translation.
4095    pub source_environment: std::option::Option<crate::model::SourceEnvironment>,
4096
4097    /// The list of literal targets that will be directly returned to the response.
4098    /// Each entry consists of the constructed path, EXCLUDING the base path. Not
4099    /// providing a target_base_uri will prevent writing to persistent storage.
4100    pub target_return_literals: std::vec::Vec<std::string::String>,
4101
4102    /// The types of output to generate, e.g. sql, metadata,
4103    /// lineage_from_sql_scripts, etc. If not specified, a default set of
4104    /// targets will be generated. Some additional target types may be slower to
4105    /// generate. See the documentation for the set of available target types.
4106    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    /// Sets the value of [source_target_mapping][crate::model::TranslationDetails::source_target_mapping].
4117    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    /// Sets the value of [target_base_uri][crate::model::TranslationDetails::target_base_uri].
4128    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    /// Sets the value of [source_environment][crate::model::TranslationDetails::source_environment].
4134    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    /// Sets or clears the value of [source_environment][crate::model::TranslationDetails::source_environment].
4143    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    /// Sets the value of [target_return_literals][crate::model::TranslationDetails::target_return_literals].
4152    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    /// Sets the value of [target_types][crate::model::TranslationDetails::target_types].
4163    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/// Represents one mapping from a source SQL to a target SQL.
4181#[derive(Clone, Default, PartialEq)]
4182#[non_exhaustive]
4183pub struct SourceTargetMapping {
4184    /// The source SQL or the path to it.
4185    pub source_spec: std::option::Option<crate::model::SourceSpec>,
4186
4187    /// The target SQL or the path for it.
4188    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    /// Sets the value of [source_spec][crate::model::SourceTargetMapping::source_spec].
4199    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    /// Sets or clears the value of [source_spec][crate::model::SourceTargetMapping::source_spec].
4208    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    /// Sets the value of [target_spec][crate::model::SourceTargetMapping::target_spec].
4217    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    /// Sets or clears the value of [target_spec][crate::model::SourceTargetMapping::target_spec].
4226    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/// Represents one path to the location that holds source data.
4242#[derive(Clone, Default, PartialEq)]
4243#[non_exhaustive]
4244pub struct SourceSpec {
4245    /// Optional. The optional field to specify the encoding of the sql bytes.
4246    pub encoding: std::string::String,
4247
4248    /// The specific source SQL.
4249    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    /// Sets the value of [encoding][crate::model::SourceSpec::encoding].
4260    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    /// Sets the value of [source][crate::model::SourceSpec::source].
4266    ///
4267    /// Note that all the setters affecting `source` are mutually
4268    /// exclusive.
4269    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    /// The value of [source][crate::model::SourceSpec::source]
4280    /// if it holds a `BaseUri`, `None` if the field is not set or
4281    /// holds a different branch.
4282    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    /// Sets the value of [source][crate::model::SourceSpec::source]
4291    /// to hold a `BaseUri`.
4292    ///
4293    /// Note that all the setters affecting `source` are
4294    /// mutually exclusive.
4295    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    /// The value of [source][crate::model::SourceSpec::source]
4302    /// if it holds a `Literal`, `None` if the field is not set or
4303    /// holds a different branch.
4304    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    /// Sets the value of [source][crate::model::SourceSpec::source]
4313    /// to hold a `Literal`.
4314    ///
4315    /// Note that all the setters affecting `source` are
4316    /// mutually exclusive.
4317    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
4333/// Defines additional types related to [SourceSpec].
4334pub mod source_spec {
4335    #[allow(unused_imports)]
4336    use super::*;
4337
4338    /// The specific source SQL.
4339    #[derive(Clone, Debug, PartialEq)]
4340    #[non_exhaustive]
4341    pub enum Source {
4342        /// The base URI for all files to be read in as sources for translation.
4343        BaseUri(std::string::String),
4344        /// Source literal.
4345        Literal(std::boxed::Box<crate::model::Literal>),
4346    }
4347}
4348
4349/// Represents one path to the location that holds target data.
4350#[derive(Clone, Default, PartialEq)]
4351#[non_exhaustive]
4352pub struct TargetSpec {
4353    /// The relative path for the target data. Given source file
4354    /// `base_uri/input/sql`, the output would be
4355    /// `target_base_uri/sql/relative_path/input.sql`.
4356    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    /// Sets the value of [relative_path][crate::model::TargetSpec::relative_path].
4367    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/// Literal data.
4380#[derive(Clone, Default, PartialEq)]
4381#[non_exhaustive]
4382pub struct Literal {
4383    /// Required. The identifier of the literal entry.
4384    pub relative_path: std::string::String,
4385
4386    /// The literal SQL contents.
4387    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    /// Sets the value of [relative_path][crate::model::Literal::relative_path].
4398    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    /// Sets the value of [literal_data][crate::model::Literal::literal_data].
4404    ///
4405    /// Note that all the setters affecting `literal_data` are mutually
4406    /// exclusive.
4407    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    /// The value of [literal_data][crate::model::Literal::literal_data]
4418    /// if it holds a `LiteralString`, `None` if the field is not set or
4419    /// holds a different branch.
4420    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    /// Sets the value of [literal_data][crate::model::Literal::literal_data]
4429    /// to hold a `LiteralString`.
4430    ///
4431    /// Note that all the setters affecting `literal_data` are
4432    /// mutually exclusive.
4433    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    /// The value of [literal_data][crate::model::Literal::literal_data]
4440    /// if it holds a `LiteralBytes`, `None` if the field is not set or
4441    /// holds a different branch.
4442    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    /// Sets the value of [literal_data][crate::model::Literal::literal_data]
4451    /// to hold a `LiteralBytes`.
4452    ///
4453    /// Note that all the setters affecting `literal_data` are
4454    /// mutually exclusive.
4455    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
4468/// Defines additional types related to [Literal].
4469pub mod literal {
4470    #[allow(unused_imports)]
4471    use super::*;
4472
4473    /// The literal SQL contents.
4474    #[derive(Clone, Debug, PartialEq)]
4475    #[non_exhaustive]
4476    pub enum LiteralData {
4477        /// Literal string data.
4478        LiteralString(std::string::String),
4479        /// Literal byte data.
4480        LiteralBytes(::bytes::Bytes),
4481    }
4482}
4483
4484/// Represents the default source environment values for the translation.
4485#[derive(Clone, Default, PartialEq)]
4486#[non_exhaustive]
4487pub struct SourceEnvironment {
4488    /// The default database name to fully qualify SQL objects when their database
4489    /// name is missing.
4490    pub default_database: std::string::String,
4491
4492    /// The schema search path. When SQL objects are missing schema name,
4493    /// translation engine will search through this list to find the value.
4494    pub schema_search_path: std::vec::Vec<std::string::String>,
4495
4496    /// Optional. Expects a validQ BigQuery dataset ID that exists, e.g.,
4497    /// project-123.metadata_store_123.  If specified, translation will search and
4498    /// read the required schema information from a metadata store in this dataset.
4499    /// If metadata store doesn't exist, translation will parse the metadata file
4500    /// and upload the schema info to a temp table in the dataset to speed up
4501    /// future translation jobs.
4502    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    /// Sets the value of [default_database][crate::model::SourceEnvironment::default_database].
4513    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    /// Sets the value of [schema_search_path][crate::model::SourceEnvironment::schema_search_path].
4522    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    /// Sets the value of [metadata_store_dataset][crate::model::SourceEnvironment::metadata_store_dataset].
4533    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/// Details about a record.
4549#[derive(Clone, Default, PartialEq)]
4550#[non_exhaustive]
4551pub struct TranslationReportRecord {
4552    /// Severity of the translation record.
4553    pub severity: crate::model::translation_report_record::Severity,
4554
4555    /// Specifies the row from the source text where the error occurred (0 based).
4556    /// Example: 2
4557    pub script_line: i32,
4558
4559    /// Specifies the column from the source texts where the error occurred. (0
4560    /// based) example: 6
4561    pub script_column: i32,
4562
4563    /// Category of the error/warning. Example: SyntaxError
4564    pub category: std::string::String,
4565
4566    /// Detailed message of the record.
4567    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    /// Sets the value of [severity][crate::model::TranslationReportRecord::severity].
4578    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    /// Sets the value of [script_line][crate::model::TranslationReportRecord::script_line].
4589    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    /// Sets the value of [script_column][crate::model::TranslationReportRecord::script_column].
4595    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    /// Sets the value of [category][crate::model::TranslationReportRecord::category].
4601    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    /// Sets the value of [message][crate::model::TranslationReportRecord::message].
4607    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
4619/// Defines additional types related to [TranslationReportRecord].
4620pub mod translation_report_record {
4621    #[allow(unused_imports)]
4622    use super::*;
4623
4624    /// The severity type of the record.
4625    ///
4626    /// # Working with unknown values
4627    ///
4628    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4629    /// additional enum variants at any time. Adding new variants is not considered
4630    /// a breaking change. Applications should write their code in anticipation of:
4631    ///
4632    /// - New values appearing in future releases of the client library, **and**
4633    /// - New values received dynamically, without application changes.
4634    ///
4635    /// Please consult the [Working with enums] section in the user guide for some
4636    /// guidelines.
4637    ///
4638    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4639    #[derive(Clone, Debug, PartialEq)]
4640    #[non_exhaustive]
4641    pub enum Severity {
4642        /// SeverityType not specified.
4643        Unspecified,
4644        /// INFO type.
4645        Info,
4646        /// WARNING type. The translated query may still provide useful information
4647        /// if all the report records are WARNING.
4648        Warning,
4649        /// ERROR type. Translation failed.
4650        Error,
4651        /// If set, the enum was initialized with an unknown value.
4652        ///
4653        /// Applications can examine the value using [Severity::value] or
4654        /// [Severity::name].
4655        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        /// Gets the enum value.
4668        ///
4669        /// Returns `None` if the enum contains an unknown value deserialized from
4670        /// the string representation of enums.
4671        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        /// Gets the enum value as a string.
4682        ///
4683        /// Returns `None` if the enum contains an unknown value deserialized from
4684        /// the integer representation of enums.
4685        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/// A record in the aggregate CSV report for a migration workflow
4766#[derive(Clone, Default, PartialEq)]
4767#[non_exhaustive]
4768pub struct GcsReportLogMessage {
4769    /// Severity of the translation record.
4770    pub severity: std::string::String,
4771
4772    /// Category of the error/warning. Example: SyntaxError
4773    pub category: std::string::String,
4774
4775    /// The file path in which the error occurred
4776    pub file_path: std::string::String,
4777
4778    /// The file name in which the error occurred
4779    pub filename: std::string::String,
4780
4781    /// Specifies the row from the source text where the error occurred (0 based,
4782    /// -1 for messages without line location). Example: 2
4783    pub source_script_line: i32,
4784
4785    /// Specifies the column from the source texts where the error occurred. (0
4786    /// based, -1 for messages without column location) example: 6
4787    pub source_script_column: i32,
4788
4789    /// Detailed message of the record.
4790    pub message: std::string::String,
4791
4792    /// The script context (obfuscated) in which the error occurred
4793    pub script_context: std::string::String,
4794
4795    /// Category of the error/warning. Example: SyntaxError
4796    pub action: std::string::String,
4797
4798    /// Effect of the error/warning. Example: COMPATIBILITY
4799    pub effect: std::string::String,
4800
4801    /// Name of the affected object in the log message.
4802    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    /// Sets the value of [severity][crate::model::GcsReportLogMessage::severity].
4813    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    /// Sets the value of [category][crate::model::GcsReportLogMessage::category].
4819    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    /// Sets the value of [file_path][crate::model::GcsReportLogMessage::file_path].
4825    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    /// Sets the value of [filename][crate::model::GcsReportLogMessage::filename].
4831    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    /// Sets the value of [source_script_line][crate::model::GcsReportLogMessage::source_script_line].
4837    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    /// Sets the value of [source_script_column][crate::model::GcsReportLogMessage::source_script_column].
4843    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    /// Sets the value of [message][crate::model::GcsReportLogMessage::message].
4849    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    /// Sets the value of [script_context][crate::model::GcsReportLogMessage::script_context].
4855    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    /// Sets the value of [action][crate::model::GcsReportLogMessage::action].
4861    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    /// Sets the value of [effect][crate::model::GcsReportLogMessage::effect].
4867    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    /// Sets the value of [object_name][crate::model::GcsReportLogMessage::object_name].
4873    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}