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 async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_api;
24extern crate google_cloud_gax;
25extern crate google_cloud_rpc;
26extern crate serde;
27extern crate serde_json;
28extern crate serde_with;
29extern crate std;
30extern crate tracing;
31extern crate wkt;
32
33mod debug;
34mod deserialize;
35mod serialize;
36
37/// A migration workflow which specifies what needs to be done for an EDW
38/// migration.
39#[derive(Clone, Default, PartialEq)]
40#[non_exhaustive]
41pub struct MigrationWorkflow {
42 /// Output only. Immutable. Identifier. The unique identifier for the migration
43 /// workflow. The ID is server-generated.
44 ///
45 /// Example: `projects/123/locations/us/workflows/345`
46 pub name: std::string::String,
47
48 /// The display name of the workflow. This can be set to give a workflow
49 /// a descriptive name. There is no guarantee or enforcement of uniqueness.
50 pub display_name: std::string::String,
51
52 /// The tasks in a workflow in a named map. The name (i.e. key) has no
53 /// meaning and is merely a convenient way to address a specific task
54 /// in a workflow.
55 pub tasks: std::collections::HashMap<std::string::String, crate::model::MigrationTask>,
56
57 /// Output only. That status of the workflow.
58 pub state: crate::model::migration_workflow::State,
59
60 /// Time when the workflow was created.
61 pub create_time: std::option::Option<wkt::Timestamp>,
62
63 /// Time when the workflow was last updated.
64 pub last_update_time: std::option::Option<wkt::Timestamp>,
65
66 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
67}
68
69impl MigrationWorkflow {
70 /// Creates a new default instance.
71 pub fn new() -> Self {
72 std::default::Default::default()
73 }
74
75 /// Sets the value of [name][crate::model::MigrationWorkflow::name].
76 ///
77 /// # Example
78 /// ```ignore,no_run
79 /// # use google_cloud_bigquery_migration_v2::model::MigrationWorkflow;
80 /// let x = MigrationWorkflow::new().set_name("example");
81 /// ```
82 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
83 self.name = v.into();
84 self
85 }
86
87 /// Sets the value of [display_name][crate::model::MigrationWorkflow::display_name].
88 ///
89 /// # Example
90 /// ```ignore,no_run
91 /// # use google_cloud_bigquery_migration_v2::model::MigrationWorkflow;
92 /// let x = MigrationWorkflow::new().set_display_name("example");
93 /// ```
94 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
95 self.display_name = v.into();
96 self
97 }
98
99 /// Sets the value of [tasks][crate::model::MigrationWorkflow::tasks].
100 ///
101 /// # Example
102 /// ```ignore,no_run
103 /// # use google_cloud_bigquery_migration_v2::model::MigrationWorkflow;
104 /// use google_cloud_bigquery_migration_v2::model::MigrationTask;
105 /// let x = MigrationWorkflow::new().set_tasks([
106 /// ("key0", MigrationTask::default()/* use setters */),
107 /// ("key1", MigrationTask::default()/* use (different) setters */),
108 /// ]);
109 /// ```
110 pub fn set_tasks<T, K, V>(mut self, v: T) -> Self
111 where
112 T: std::iter::IntoIterator<Item = (K, V)>,
113 K: std::convert::Into<std::string::String>,
114 V: std::convert::Into<crate::model::MigrationTask>,
115 {
116 use std::iter::Iterator;
117 self.tasks = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
118 self
119 }
120
121 /// Sets the value of [state][crate::model::MigrationWorkflow::state].
122 ///
123 /// # Example
124 /// ```ignore,no_run
125 /// # use google_cloud_bigquery_migration_v2::model::MigrationWorkflow;
126 /// use google_cloud_bigquery_migration_v2::model::migration_workflow::State;
127 /// let x0 = MigrationWorkflow::new().set_state(State::Draft);
128 /// let x1 = MigrationWorkflow::new().set_state(State::Running);
129 /// let x2 = MigrationWorkflow::new().set_state(State::Paused);
130 /// ```
131 pub fn set_state<T: std::convert::Into<crate::model::migration_workflow::State>>(
132 mut self,
133 v: T,
134 ) -> Self {
135 self.state = v.into();
136 self
137 }
138
139 /// Sets the value of [create_time][crate::model::MigrationWorkflow::create_time].
140 ///
141 /// # Example
142 /// ```ignore,no_run
143 /// # use google_cloud_bigquery_migration_v2::model::MigrationWorkflow;
144 /// use wkt::Timestamp;
145 /// let x = MigrationWorkflow::new().set_create_time(Timestamp::default()/* use setters */);
146 /// ```
147 pub fn set_create_time<T>(mut self, v: T) -> Self
148 where
149 T: std::convert::Into<wkt::Timestamp>,
150 {
151 self.create_time = std::option::Option::Some(v.into());
152 self
153 }
154
155 /// Sets or clears the value of [create_time][crate::model::MigrationWorkflow::create_time].
156 ///
157 /// # Example
158 /// ```ignore,no_run
159 /// # use google_cloud_bigquery_migration_v2::model::MigrationWorkflow;
160 /// use wkt::Timestamp;
161 /// let x = MigrationWorkflow::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
162 /// let x = MigrationWorkflow::new().set_or_clear_create_time(None::<Timestamp>);
163 /// ```
164 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
165 where
166 T: std::convert::Into<wkt::Timestamp>,
167 {
168 self.create_time = v.map(|x| x.into());
169 self
170 }
171
172 /// Sets the value of [last_update_time][crate::model::MigrationWorkflow::last_update_time].
173 ///
174 /// # Example
175 /// ```ignore,no_run
176 /// # use google_cloud_bigquery_migration_v2::model::MigrationWorkflow;
177 /// use wkt::Timestamp;
178 /// let x = MigrationWorkflow::new().set_last_update_time(Timestamp::default()/* use setters */);
179 /// ```
180 pub fn set_last_update_time<T>(mut self, v: T) -> Self
181 where
182 T: std::convert::Into<wkt::Timestamp>,
183 {
184 self.last_update_time = std::option::Option::Some(v.into());
185 self
186 }
187
188 /// Sets or clears the value of [last_update_time][crate::model::MigrationWorkflow::last_update_time].
189 ///
190 /// # Example
191 /// ```ignore,no_run
192 /// # use google_cloud_bigquery_migration_v2::model::MigrationWorkflow;
193 /// use wkt::Timestamp;
194 /// let x = MigrationWorkflow::new().set_or_clear_last_update_time(Some(Timestamp::default()/* use setters */));
195 /// let x = MigrationWorkflow::new().set_or_clear_last_update_time(None::<Timestamp>);
196 /// ```
197 pub fn set_or_clear_last_update_time<T>(mut self, v: std::option::Option<T>) -> Self
198 where
199 T: std::convert::Into<wkt::Timestamp>,
200 {
201 self.last_update_time = v.map(|x| x.into());
202 self
203 }
204}
205
206impl wkt::message::Message for MigrationWorkflow {
207 fn typename() -> &'static str {
208 "type.googleapis.com/google.cloud.bigquery.migration.v2.MigrationWorkflow"
209 }
210}
211
212/// Defines additional types related to [MigrationWorkflow].
213pub mod migration_workflow {
214 #[allow(unused_imports)]
215 use super::*;
216
217 /// Possible migration workflow states.
218 ///
219 /// # Working with unknown values
220 ///
221 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
222 /// additional enum variants at any time. Adding new variants is not considered
223 /// a breaking change. Applications should write their code in anticipation of:
224 ///
225 /// - New values appearing in future releases of the client library, **and**
226 /// - New values received dynamically, without application changes.
227 ///
228 /// Please consult the [Working with enums] section in the user guide for some
229 /// guidelines.
230 ///
231 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
232 #[derive(Clone, Debug, PartialEq)]
233 #[non_exhaustive]
234 pub enum State {
235 /// Workflow state is unspecified.
236 Unspecified,
237 /// Workflow is in draft status, i.e. tasks are not yet eligible for
238 /// execution.
239 Draft,
240 /// Workflow is running (i.e. tasks are eligible for execution).
241 Running,
242 /// Workflow is paused. Tasks currently in progress may continue, but no
243 /// further tasks will be scheduled.
244 Paused,
245 /// Workflow is complete. There should not be any task in a non-terminal
246 /// state, but if they are (e.g. forced termination), they will not be
247 /// scheduled.
248 Completed,
249 /// If set, the enum was initialized with an unknown value.
250 ///
251 /// Applications can examine the value using [State::value] or
252 /// [State::name].
253 UnknownValue(state::UnknownValue),
254 }
255
256 #[doc(hidden)]
257 pub mod state {
258 #[allow(unused_imports)]
259 use super::*;
260 #[derive(Clone, Debug, PartialEq)]
261 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
262 }
263
264 impl State {
265 /// Gets the enum value.
266 ///
267 /// Returns `None` if the enum contains an unknown value deserialized from
268 /// the string representation of enums.
269 pub fn value(&self) -> std::option::Option<i32> {
270 match self {
271 Self::Unspecified => std::option::Option::Some(0),
272 Self::Draft => std::option::Option::Some(1),
273 Self::Running => std::option::Option::Some(2),
274 Self::Paused => std::option::Option::Some(3),
275 Self::Completed => std::option::Option::Some(4),
276 Self::UnknownValue(u) => u.0.value(),
277 }
278 }
279
280 /// Gets the enum value as a string.
281 ///
282 /// Returns `None` if the enum contains an unknown value deserialized from
283 /// the integer representation of enums.
284 pub fn name(&self) -> std::option::Option<&str> {
285 match self {
286 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
287 Self::Draft => std::option::Option::Some("DRAFT"),
288 Self::Running => std::option::Option::Some("RUNNING"),
289 Self::Paused => std::option::Option::Some("PAUSED"),
290 Self::Completed => std::option::Option::Some("COMPLETED"),
291 Self::UnknownValue(u) => u.0.name(),
292 }
293 }
294 }
295
296 impl std::default::Default for State {
297 fn default() -> Self {
298 use std::convert::From;
299 Self::from(0)
300 }
301 }
302
303 impl std::fmt::Display for State {
304 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
305 wkt::internal::display_enum(f, self.name(), self.value())
306 }
307 }
308
309 impl std::convert::From<i32> for State {
310 fn from(value: i32) -> Self {
311 match value {
312 0 => Self::Unspecified,
313 1 => Self::Draft,
314 2 => Self::Running,
315 3 => Self::Paused,
316 4 => Self::Completed,
317 _ => Self::UnknownValue(state::UnknownValue(
318 wkt::internal::UnknownEnumValue::Integer(value),
319 )),
320 }
321 }
322 }
323
324 impl std::convert::From<&str> for State {
325 fn from(value: &str) -> Self {
326 use std::string::ToString;
327 match value {
328 "STATE_UNSPECIFIED" => Self::Unspecified,
329 "DRAFT" => Self::Draft,
330 "RUNNING" => Self::Running,
331 "PAUSED" => Self::Paused,
332 "COMPLETED" => Self::Completed,
333 _ => Self::UnknownValue(state::UnknownValue(
334 wkt::internal::UnknownEnumValue::String(value.to_string()),
335 )),
336 }
337 }
338 }
339
340 impl serde::ser::Serialize for State {
341 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
342 where
343 S: serde::Serializer,
344 {
345 match self {
346 Self::Unspecified => serializer.serialize_i32(0),
347 Self::Draft => serializer.serialize_i32(1),
348 Self::Running => serializer.serialize_i32(2),
349 Self::Paused => serializer.serialize_i32(3),
350 Self::Completed => serializer.serialize_i32(4),
351 Self::UnknownValue(u) => u.0.serialize(serializer),
352 }
353 }
354 }
355
356 impl<'de> serde::de::Deserialize<'de> for State {
357 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
358 where
359 D: serde::Deserializer<'de>,
360 {
361 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
362 ".google.cloud.bigquery.migration.v2.MigrationWorkflow.State",
363 ))
364 }
365 }
366}
367
368/// A single task for a migration which has details about the configuration of
369/// the task.
370#[derive(Clone, Default, PartialEq)]
371#[non_exhaustive]
372pub struct MigrationTask {
373 /// Output only. Immutable. The unique identifier for the migration task. The
374 /// ID is server-generated.
375 pub id: std::string::String,
376
377 /// The type of the task. This must be one of the supported task types:
378 /// Translation_Teradata2BQ, Translation_Redshift2BQ, Translation_Bteq2BQ,
379 /// Translation_Oracle2BQ, Translation_HiveQL2BQ, Translation_SparkSQL2BQ,
380 /// Translation_Snowflake2BQ, Translation_Netezza2BQ,
381 /// Translation_AzureSynapse2BQ, Translation_Vertica2BQ,
382 /// Translation_SQLServer2BQ, Translation_Presto2BQ, Translation_MySQL2BQ,
383 /// Translation_Postgresql2BQ, Translation_SQLite2BQ, Translation_Greenplum2BQ.
384 pub r#type: std::string::String,
385
386 /// Output only. The current state of the task.
387 pub state: crate::model::migration_task::State,
388
389 /// Output only. An explanation that may be populated when the task is in
390 /// FAILED state.
391 pub processing_error: std::option::Option<google_cloud_rpc::model::ErrorInfo>,
392
393 /// Time when the task was created.
394 pub create_time: std::option::Option<wkt::Timestamp>,
395
396 /// Time when the task was last updated.
397 pub last_update_time: std::option::Option<wkt::Timestamp>,
398
399 /// Output only. Provides details to errors and issues encountered while
400 /// processing the task. Presence of error details does not mean that the task
401 /// failed.
402 pub resource_error_details: std::vec::Vec<crate::model::ResourceErrorDetail>,
403
404 /// The number or resources with errors. Note: This is not the total
405 /// number of errors as each resource can have more than one error.
406 /// This is used to indicate truncation by having a `resource_error_count`
407 /// that is higher than the size of `resource_error_details`.
408 pub resource_error_count: i32,
409
410 /// The metrics for the task.
411 pub metrics: std::vec::Vec<crate::model::TimeSeries>,
412
413 /// Output only. The result of the task.
414 pub task_result: std::option::Option<crate::model::MigrationTaskResult>,
415
416 /// Count of all the processing errors in this task and its subtasks.
417 pub total_processing_error_count: i32,
418
419 /// Count of all the resource errors in this task and its subtasks.
420 pub total_resource_error_count: i32,
421
422 /// The details of the task.
423 pub task_details: std::option::Option<crate::model::migration_task::TaskDetails>,
424
425 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
426}
427
428impl MigrationTask {
429 /// Creates a new default instance.
430 pub fn new() -> Self {
431 std::default::Default::default()
432 }
433
434 /// Sets the value of [id][crate::model::MigrationTask::id].
435 ///
436 /// # Example
437 /// ```ignore,no_run
438 /// # use google_cloud_bigquery_migration_v2::model::MigrationTask;
439 /// let x = MigrationTask::new().set_id("example");
440 /// ```
441 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
442 self.id = v.into();
443 self
444 }
445
446 /// Sets the value of [r#type][crate::model::MigrationTask::type].
447 ///
448 /// # Example
449 /// ```ignore,no_run
450 /// # use google_cloud_bigquery_migration_v2::model::MigrationTask;
451 /// let x = MigrationTask::new().set_type("example");
452 /// ```
453 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
454 self.r#type = v.into();
455 self
456 }
457
458 /// Sets the value of [state][crate::model::MigrationTask::state].
459 ///
460 /// # Example
461 /// ```ignore,no_run
462 /// # use google_cloud_bigquery_migration_v2::model::MigrationTask;
463 /// use google_cloud_bigquery_migration_v2::model::migration_task::State;
464 /// let x0 = MigrationTask::new().set_state(State::Pending);
465 /// let x1 = MigrationTask::new().set_state(State::Orchestrating);
466 /// let x2 = MigrationTask::new().set_state(State::Running);
467 /// ```
468 pub fn set_state<T: std::convert::Into<crate::model::migration_task::State>>(
469 mut self,
470 v: T,
471 ) -> Self {
472 self.state = v.into();
473 self
474 }
475
476 /// Sets the value of [processing_error][crate::model::MigrationTask::processing_error].
477 ///
478 /// # Example
479 /// ```ignore,no_run
480 /// # use google_cloud_bigquery_migration_v2::model::MigrationTask;
481 /// use google_cloud_rpc::model::ErrorInfo;
482 /// let x = MigrationTask::new().set_processing_error(ErrorInfo::default()/* use setters */);
483 /// ```
484 pub fn set_processing_error<T>(mut self, v: T) -> Self
485 where
486 T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
487 {
488 self.processing_error = std::option::Option::Some(v.into());
489 self
490 }
491
492 /// Sets or clears the value of [processing_error][crate::model::MigrationTask::processing_error].
493 ///
494 /// # Example
495 /// ```ignore,no_run
496 /// # use google_cloud_bigquery_migration_v2::model::MigrationTask;
497 /// use google_cloud_rpc::model::ErrorInfo;
498 /// let x = MigrationTask::new().set_or_clear_processing_error(Some(ErrorInfo::default()/* use setters */));
499 /// let x = MigrationTask::new().set_or_clear_processing_error(None::<ErrorInfo>);
500 /// ```
501 pub fn set_or_clear_processing_error<T>(mut self, v: std::option::Option<T>) -> Self
502 where
503 T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
504 {
505 self.processing_error = v.map(|x| x.into());
506 self
507 }
508
509 /// Sets the value of [create_time][crate::model::MigrationTask::create_time].
510 ///
511 /// # Example
512 /// ```ignore,no_run
513 /// # use google_cloud_bigquery_migration_v2::model::MigrationTask;
514 /// use wkt::Timestamp;
515 /// let x = MigrationTask::new().set_create_time(Timestamp::default()/* use setters */);
516 /// ```
517 pub fn set_create_time<T>(mut self, v: T) -> Self
518 where
519 T: std::convert::Into<wkt::Timestamp>,
520 {
521 self.create_time = std::option::Option::Some(v.into());
522 self
523 }
524
525 /// Sets or clears the value of [create_time][crate::model::MigrationTask::create_time].
526 ///
527 /// # Example
528 /// ```ignore,no_run
529 /// # use google_cloud_bigquery_migration_v2::model::MigrationTask;
530 /// use wkt::Timestamp;
531 /// let x = MigrationTask::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
532 /// let x = MigrationTask::new().set_or_clear_create_time(None::<Timestamp>);
533 /// ```
534 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
535 where
536 T: std::convert::Into<wkt::Timestamp>,
537 {
538 self.create_time = v.map(|x| x.into());
539 self
540 }
541
542 /// Sets the value of [last_update_time][crate::model::MigrationTask::last_update_time].
543 ///
544 /// # Example
545 /// ```ignore,no_run
546 /// # use google_cloud_bigquery_migration_v2::model::MigrationTask;
547 /// use wkt::Timestamp;
548 /// let x = MigrationTask::new().set_last_update_time(Timestamp::default()/* use setters */);
549 /// ```
550 pub fn set_last_update_time<T>(mut self, v: T) -> Self
551 where
552 T: std::convert::Into<wkt::Timestamp>,
553 {
554 self.last_update_time = std::option::Option::Some(v.into());
555 self
556 }
557
558 /// Sets or clears the value of [last_update_time][crate::model::MigrationTask::last_update_time].
559 ///
560 /// # Example
561 /// ```ignore,no_run
562 /// # use google_cloud_bigquery_migration_v2::model::MigrationTask;
563 /// use wkt::Timestamp;
564 /// let x = MigrationTask::new().set_or_clear_last_update_time(Some(Timestamp::default()/* use setters */));
565 /// let x = MigrationTask::new().set_or_clear_last_update_time(None::<Timestamp>);
566 /// ```
567 pub fn set_or_clear_last_update_time<T>(mut self, v: std::option::Option<T>) -> Self
568 where
569 T: std::convert::Into<wkt::Timestamp>,
570 {
571 self.last_update_time = v.map(|x| x.into());
572 self
573 }
574
575 /// Sets the value of [resource_error_details][crate::model::MigrationTask::resource_error_details].
576 ///
577 /// # Example
578 /// ```ignore,no_run
579 /// # use google_cloud_bigquery_migration_v2::model::MigrationTask;
580 /// use google_cloud_bigquery_migration_v2::model::ResourceErrorDetail;
581 /// let x = MigrationTask::new()
582 /// .set_resource_error_details([
583 /// ResourceErrorDetail::default()/* use setters */,
584 /// ResourceErrorDetail::default()/* use (different) setters */,
585 /// ]);
586 /// ```
587 pub fn set_resource_error_details<T, V>(mut self, v: T) -> Self
588 where
589 T: std::iter::IntoIterator<Item = V>,
590 V: std::convert::Into<crate::model::ResourceErrorDetail>,
591 {
592 use std::iter::Iterator;
593 self.resource_error_details = v.into_iter().map(|i| i.into()).collect();
594 self
595 }
596
597 /// Sets the value of [resource_error_count][crate::model::MigrationTask::resource_error_count].
598 ///
599 /// # Example
600 /// ```ignore,no_run
601 /// # use google_cloud_bigquery_migration_v2::model::MigrationTask;
602 /// let x = MigrationTask::new().set_resource_error_count(42);
603 /// ```
604 pub fn set_resource_error_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
605 self.resource_error_count = v.into();
606 self
607 }
608
609 /// Sets the value of [metrics][crate::model::MigrationTask::metrics].
610 ///
611 /// # Example
612 /// ```ignore,no_run
613 /// # use google_cloud_bigquery_migration_v2::model::MigrationTask;
614 /// use google_cloud_bigquery_migration_v2::model::TimeSeries;
615 /// let x = MigrationTask::new()
616 /// .set_metrics([
617 /// TimeSeries::default()/* use setters */,
618 /// TimeSeries::default()/* use (different) setters */,
619 /// ]);
620 /// ```
621 pub fn set_metrics<T, V>(mut self, v: T) -> Self
622 where
623 T: std::iter::IntoIterator<Item = V>,
624 V: std::convert::Into<crate::model::TimeSeries>,
625 {
626 use std::iter::Iterator;
627 self.metrics = v.into_iter().map(|i| i.into()).collect();
628 self
629 }
630
631 /// Sets the value of [task_result][crate::model::MigrationTask::task_result].
632 ///
633 /// # Example
634 /// ```ignore,no_run
635 /// # use google_cloud_bigquery_migration_v2::model::MigrationTask;
636 /// use google_cloud_bigquery_migration_v2::model::MigrationTaskResult;
637 /// let x = MigrationTask::new().set_task_result(MigrationTaskResult::default()/* use setters */);
638 /// ```
639 pub fn set_task_result<T>(mut self, v: T) -> Self
640 where
641 T: std::convert::Into<crate::model::MigrationTaskResult>,
642 {
643 self.task_result = std::option::Option::Some(v.into());
644 self
645 }
646
647 /// Sets or clears the value of [task_result][crate::model::MigrationTask::task_result].
648 ///
649 /// # Example
650 /// ```ignore,no_run
651 /// # use google_cloud_bigquery_migration_v2::model::MigrationTask;
652 /// use google_cloud_bigquery_migration_v2::model::MigrationTaskResult;
653 /// let x = MigrationTask::new().set_or_clear_task_result(Some(MigrationTaskResult::default()/* use setters */));
654 /// let x = MigrationTask::new().set_or_clear_task_result(None::<MigrationTaskResult>);
655 /// ```
656 pub fn set_or_clear_task_result<T>(mut self, v: std::option::Option<T>) -> Self
657 where
658 T: std::convert::Into<crate::model::MigrationTaskResult>,
659 {
660 self.task_result = v.map(|x| x.into());
661 self
662 }
663
664 /// Sets the value of [total_processing_error_count][crate::model::MigrationTask::total_processing_error_count].
665 ///
666 /// # Example
667 /// ```ignore,no_run
668 /// # use google_cloud_bigquery_migration_v2::model::MigrationTask;
669 /// let x = MigrationTask::new().set_total_processing_error_count(42);
670 /// ```
671 pub fn set_total_processing_error_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
672 self.total_processing_error_count = v.into();
673 self
674 }
675
676 /// Sets the value of [total_resource_error_count][crate::model::MigrationTask::total_resource_error_count].
677 ///
678 /// # Example
679 /// ```ignore,no_run
680 /// # use google_cloud_bigquery_migration_v2::model::MigrationTask;
681 /// let x = MigrationTask::new().set_total_resource_error_count(42);
682 /// ```
683 pub fn set_total_resource_error_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
684 self.total_resource_error_count = v.into();
685 self
686 }
687
688 /// Sets the value of [task_details][crate::model::MigrationTask::task_details].
689 ///
690 /// Note that all the setters affecting `task_details` are mutually
691 /// exclusive.
692 ///
693 /// # Example
694 /// ```ignore,no_run
695 /// # use google_cloud_bigquery_migration_v2::model::MigrationTask;
696 /// use google_cloud_bigquery_migration_v2::model::TranslationConfigDetails;
697 /// let x = MigrationTask::new().set_task_details(Some(
698 /// google_cloud_bigquery_migration_v2::model::migration_task::TaskDetails::TranslationConfigDetails(TranslationConfigDetails::default().into())));
699 /// ```
700 pub fn set_task_details<
701 T: std::convert::Into<std::option::Option<crate::model::migration_task::TaskDetails>>,
702 >(
703 mut self,
704 v: T,
705 ) -> Self {
706 self.task_details = v.into();
707 self
708 }
709
710 /// The value of [task_details][crate::model::MigrationTask::task_details]
711 /// if it holds a `TranslationConfigDetails`, `None` if the field is not set or
712 /// holds a different branch.
713 pub fn translation_config_details(
714 &self,
715 ) -> std::option::Option<&std::boxed::Box<crate::model::TranslationConfigDetails>> {
716 #[allow(unreachable_patterns)]
717 self.task_details.as_ref().and_then(|v| match v {
718 crate::model::migration_task::TaskDetails::TranslationConfigDetails(v) => {
719 std::option::Option::Some(v)
720 }
721 _ => std::option::Option::None,
722 })
723 }
724
725 /// Sets the value of [task_details][crate::model::MigrationTask::task_details]
726 /// to hold a `TranslationConfigDetails`.
727 ///
728 /// Note that all the setters affecting `task_details` are
729 /// mutually exclusive.
730 ///
731 /// # Example
732 /// ```ignore,no_run
733 /// # use google_cloud_bigquery_migration_v2::model::MigrationTask;
734 /// use google_cloud_bigquery_migration_v2::model::TranslationConfigDetails;
735 /// let x = MigrationTask::new().set_translation_config_details(TranslationConfigDetails::default()/* use setters */);
736 /// assert!(x.translation_config_details().is_some());
737 /// assert!(x.translation_details().is_none());
738 /// ```
739 pub fn set_translation_config_details<
740 T: std::convert::Into<std::boxed::Box<crate::model::TranslationConfigDetails>>,
741 >(
742 mut self,
743 v: T,
744 ) -> Self {
745 self.task_details = std::option::Option::Some(
746 crate::model::migration_task::TaskDetails::TranslationConfigDetails(v.into()),
747 );
748 self
749 }
750
751 /// The value of [task_details][crate::model::MigrationTask::task_details]
752 /// if it holds a `TranslationDetails`, `None` if the field is not set or
753 /// holds a different branch.
754 pub fn translation_details(
755 &self,
756 ) -> std::option::Option<&std::boxed::Box<crate::model::TranslationDetails>> {
757 #[allow(unreachable_patterns)]
758 self.task_details.as_ref().and_then(|v| match v {
759 crate::model::migration_task::TaskDetails::TranslationDetails(v) => {
760 std::option::Option::Some(v)
761 }
762 _ => std::option::Option::None,
763 })
764 }
765
766 /// Sets the value of [task_details][crate::model::MigrationTask::task_details]
767 /// to hold a `TranslationDetails`.
768 ///
769 /// Note that all the setters affecting `task_details` are
770 /// mutually exclusive.
771 ///
772 /// # Example
773 /// ```ignore,no_run
774 /// # use google_cloud_bigquery_migration_v2::model::MigrationTask;
775 /// use google_cloud_bigquery_migration_v2::model::TranslationDetails;
776 /// let x = MigrationTask::new().set_translation_details(TranslationDetails::default()/* use setters */);
777 /// assert!(x.translation_details().is_some());
778 /// assert!(x.translation_config_details().is_none());
779 /// ```
780 pub fn set_translation_details<
781 T: std::convert::Into<std::boxed::Box<crate::model::TranslationDetails>>,
782 >(
783 mut self,
784 v: T,
785 ) -> Self {
786 self.task_details = std::option::Option::Some(
787 crate::model::migration_task::TaskDetails::TranslationDetails(v.into()),
788 );
789 self
790 }
791}
792
793impl wkt::message::Message for MigrationTask {
794 fn typename() -> &'static str {
795 "type.googleapis.com/google.cloud.bigquery.migration.v2.MigrationTask"
796 }
797}
798
799/// Defines additional types related to [MigrationTask].
800pub mod migration_task {
801 #[allow(unused_imports)]
802 use super::*;
803
804 /// Possible states of a migration task.
805 ///
806 /// # Working with unknown values
807 ///
808 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
809 /// additional enum variants at any time. Adding new variants is not considered
810 /// a breaking change. Applications should write their code in anticipation of:
811 ///
812 /// - New values appearing in future releases of the client library, **and**
813 /// - New values received dynamically, without application changes.
814 ///
815 /// Please consult the [Working with enums] section in the user guide for some
816 /// guidelines.
817 ///
818 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
819 #[derive(Clone, Debug, PartialEq)]
820 #[non_exhaustive]
821 pub enum State {
822 /// The state is unspecified.
823 Unspecified,
824 /// The task is waiting for orchestration.
825 Pending,
826 /// The task is assigned to an orchestrator.
827 Orchestrating,
828 /// The task is running, i.e. its subtasks are ready for execution.
829 Running,
830 /// Tha task is paused. Assigned subtasks can continue, but no new subtasks
831 /// will be scheduled.
832 Paused,
833 /// The task finished successfully.
834 Succeeded,
835 /// The task finished unsuccessfully.
836 Failed,
837 /// If set, the enum was initialized with an unknown value.
838 ///
839 /// Applications can examine the value using [State::value] or
840 /// [State::name].
841 UnknownValue(state::UnknownValue),
842 }
843
844 #[doc(hidden)]
845 pub mod state {
846 #[allow(unused_imports)]
847 use super::*;
848 #[derive(Clone, Debug, PartialEq)]
849 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
850 }
851
852 impl State {
853 /// Gets the enum value.
854 ///
855 /// Returns `None` if the enum contains an unknown value deserialized from
856 /// the string representation of enums.
857 pub fn value(&self) -> std::option::Option<i32> {
858 match self {
859 Self::Unspecified => std::option::Option::Some(0),
860 Self::Pending => std::option::Option::Some(1),
861 Self::Orchestrating => std::option::Option::Some(2),
862 Self::Running => std::option::Option::Some(3),
863 Self::Paused => std::option::Option::Some(4),
864 Self::Succeeded => std::option::Option::Some(5),
865 Self::Failed => std::option::Option::Some(6),
866 Self::UnknownValue(u) => u.0.value(),
867 }
868 }
869
870 /// Gets the enum value as a string.
871 ///
872 /// Returns `None` if the enum contains an unknown value deserialized from
873 /// the integer representation of enums.
874 pub fn name(&self) -> std::option::Option<&str> {
875 match self {
876 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
877 Self::Pending => std::option::Option::Some("PENDING"),
878 Self::Orchestrating => std::option::Option::Some("ORCHESTRATING"),
879 Self::Running => std::option::Option::Some("RUNNING"),
880 Self::Paused => std::option::Option::Some("PAUSED"),
881 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
882 Self::Failed => std::option::Option::Some("FAILED"),
883 Self::UnknownValue(u) => u.0.name(),
884 }
885 }
886 }
887
888 impl std::default::Default for State {
889 fn default() -> Self {
890 use std::convert::From;
891 Self::from(0)
892 }
893 }
894
895 impl std::fmt::Display for State {
896 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
897 wkt::internal::display_enum(f, self.name(), self.value())
898 }
899 }
900
901 impl std::convert::From<i32> for State {
902 fn from(value: i32) -> Self {
903 match value {
904 0 => Self::Unspecified,
905 1 => Self::Pending,
906 2 => Self::Orchestrating,
907 3 => Self::Running,
908 4 => Self::Paused,
909 5 => Self::Succeeded,
910 6 => Self::Failed,
911 _ => Self::UnknownValue(state::UnknownValue(
912 wkt::internal::UnknownEnumValue::Integer(value),
913 )),
914 }
915 }
916 }
917
918 impl std::convert::From<&str> for State {
919 fn from(value: &str) -> Self {
920 use std::string::ToString;
921 match value {
922 "STATE_UNSPECIFIED" => Self::Unspecified,
923 "PENDING" => Self::Pending,
924 "ORCHESTRATING" => Self::Orchestrating,
925 "RUNNING" => Self::Running,
926 "PAUSED" => Self::Paused,
927 "SUCCEEDED" => Self::Succeeded,
928 "FAILED" => Self::Failed,
929 _ => Self::UnknownValue(state::UnknownValue(
930 wkt::internal::UnknownEnumValue::String(value.to_string()),
931 )),
932 }
933 }
934 }
935
936 impl serde::ser::Serialize for State {
937 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
938 where
939 S: serde::Serializer,
940 {
941 match self {
942 Self::Unspecified => serializer.serialize_i32(0),
943 Self::Pending => serializer.serialize_i32(1),
944 Self::Orchestrating => serializer.serialize_i32(2),
945 Self::Running => serializer.serialize_i32(3),
946 Self::Paused => serializer.serialize_i32(4),
947 Self::Succeeded => serializer.serialize_i32(5),
948 Self::Failed => serializer.serialize_i32(6),
949 Self::UnknownValue(u) => u.0.serialize(serializer),
950 }
951 }
952 }
953
954 impl<'de> serde::de::Deserialize<'de> for State {
955 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
956 where
957 D: serde::Deserializer<'de>,
958 {
959 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
960 ".google.cloud.bigquery.migration.v2.MigrationTask.State",
961 ))
962 }
963 }
964
965 /// The details of the task.
966 #[derive(Clone, Debug, PartialEq)]
967 #[non_exhaustive]
968 pub enum TaskDetails {
969 /// Task configuration for CW Batch/Offline SQL Translation.
970 TranslationConfigDetails(std::boxed::Box<crate::model::TranslationConfigDetails>),
971 /// Task details for unified SQL Translation.
972 TranslationDetails(std::boxed::Box<crate::model::TranslationDetails>),
973 }
974}
975
976/// A subtask for a migration which carries details about the configuration of
977/// the subtask. The content of the details should not matter to the end user,
978/// but is a contract between the subtask creator and subtask worker.
979#[derive(Clone, Default, PartialEq)]
980#[non_exhaustive]
981pub struct MigrationSubtask {
982 /// Output only. Immutable. The resource name for the migration subtask. The ID
983 /// is server-generated.
984 ///
985 /// Example: `projects/123/locations/us/workflows/345/subtasks/678`
986 pub name: std::string::String,
987
988 /// The unique ID of the task to which this subtask belongs.
989 pub task_id: std::string::String,
990
991 /// The type of the Subtask. The migration service does not check whether this
992 /// is a known type. It is up to the task creator (i.e. orchestrator or worker)
993 /// to ensure it only creates subtasks for which there are compatible workers
994 /// polling for Subtasks.
995 pub r#type: std::string::String,
996
997 /// Output only. The current state of the subtask.
998 pub state: crate::model::migration_subtask::State,
999
1000 /// Output only. An explanation that may be populated when the task is in
1001 /// FAILED state.
1002 pub processing_error: std::option::Option<google_cloud_rpc::model::ErrorInfo>,
1003
1004 /// Output only. Provides details to errors and issues encountered while
1005 /// processing the subtask. Presence of error details does not mean that the
1006 /// subtask failed.
1007 pub resource_error_details: std::vec::Vec<crate::model::ResourceErrorDetail>,
1008
1009 /// The number or resources with errors. Note: This is not the total
1010 /// number of errors as each resource can have more than one error.
1011 /// This is used to indicate truncation by having a `resource_error_count`
1012 /// that is higher than the size of `resource_error_details`.
1013 pub resource_error_count: i32,
1014
1015 /// Time when the subtask was created.
1016 pub create_time: std::option::Option<wkt::Timestamp>,
1017
1018 /// Time when the subtask was last updated.
1019 pub last_update_time: std::option::Option<wkt::Timestamp>,
1020
1021 /// The metrics for the subtask.
1022 pub metrics: std::vec::Vec<crate::model::TimeSeries>,
1023
1024 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1025}
1026
1027impl MigrationSubtask {
1028 /// Creates a new default instance.
1029 pub fn new() -> Self {
1030 std::default::Default::default()
1031 }
1032
1033 /// Sets the value of [name][crate::model::MigrationSubtask::name].
1034 ///
1035 /// # Example
1036 /// ```ignore,no_run
1037 /// # use google_cloud_bigquery_migration_v2::model::MigrationSubtask;
1038 /// let x = MigrationSubtask::new().set_name("example");
1039 /// ```
1040 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1041 self.name = v.into();
1042 self
1043 }
1044
1045 /// Sets the value of [task_id][crate::model::MigrationSubtask::task_id].
1046 ///
1047 /// # Example
1048 /// ```ignore,no_run
1049 /// # use google_cloud_bigquery_migration_v2::model::MigrationSubtask;
1050 /// let x = MigrationSubtask::new().set_task_id("example");
1051 /// ```
1052 pub fn set_task_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1053 self.task_id = v.into();
1054 self
1055 }
1056
1057 /// Sets the value of [r#type][crate::model::MigrationSubtask::type].
1058 ///
1059 /// # Example
1060 /// ```ignore,no_run
1061 /// # use google_cloud_bigquery_migration_v2::model::MigrationSubtask;
1062 /// let x = MigrationSubtask::new().set_type("example");
1063 /// ```
1064 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1065 self.r#type = v.into();
1066 self
1067 }
1068
1069 /// Sets the value of [state][crate::model::MigrationSubtask::state].
1070 ///
1071 /// # Example
1072 /// ```ignore,no_run
1073 /// # use google_cloud_bigquery_migration_v2::model::MigrationSubtask;
1074 /// use google_cloud_bigquery_migration_v2::model::migration_subtask::State;
1075 /// let x0 = MigrationSubtask::new().set_state(State::Active);
1076 /// let x1 = MigrationSubtask::new().set_state(State::Running);
1077 /// let x2 = MigrationSubtask::new().set_state(State::Succeeded);
1078 /// ```
1079 pub fn set_state<T: std::convert::Into<crate::model::migration_subtask::State>>(
1080 mut self,
1081 v: T,
1082 ) -> Self {
1083 self.state = v.into();
1084 self
1085 }
1086
1087 /// Sets the value of [processing_error][crate::model::MigrationSubtask::processing_error].
1088 ///
1089 /// # Example
1090 /// ```ignore,no_run
1091 /// # use google_cloud_bigquery_migration_v2::model::MigrationSubtask;
1092 /// use google_cloud_rpc::model::ErrorInfo;
1093 /// let x = MigrationSubtask::new().set_processing_error(ErrorInfo::default()/* use setters */);
1094 /// ```
1095 pub fn set_processing_error<T>(mut self, v: T) -> Self
1096 where
1097 T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
1098 {
1099 self.processing_error = std::option::Option::Some(v.into());
1100 self
1101 }
1102
1103 /// Sets or clears the value of [processing_error][crate::model::MigrationSubtask::processing_error].
1104 ///
1105 /// # Example
1106 /// ```ignore,no_run
1107 /// # use google_cloud_bigquery_migration_v2::model::MigrationSubtask;
1108 /// use google_cloud_rpc::model::ErrorInfo;
1109 /// let x = MigrationSubtask::new().set_or_clear_processing_error(Some(ErrorInfo::default()/* use setters */));
1110 /// let x = MigrationSubtask::new().set_or_clear_processing_error(None::<ErrorInfo>);
1111 /// ```
1112 pub fn set_or_clear_processing_error<T>(mut self, v: std::option::Option<T>) -> Self
1113 where
1114 T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
1115 {
1116 self.processing_error = v.map(|x| x.into());
1117 self
1118 }
1119
1120 /// Sets the value of [resource_error_details][crate::model::MigrationSubtask::resource_error_details].
1121 ///
1122 /// # Example
1123 /// ```ignore,no_run
1124 /// # use google_cloud_bigquery_migration_v2::model::MigrationSubtask;
1125 /// use google_cloud_bigquery_migration_v2::model::ResourceErrorDetail;
1126 /// let x = MigrationSubtask::new()
1127 /// .set_resource_error_details([
1128 /// ResourceErrorDetail::default()/* use setters */,
1129 /// ResourceErrorDetail::default()/* use (different) setters */,
1130 /// ]);
1131 /// ```
1132 pub fn set_resource_error_details<T, V>(mut self, v: T) -> Self
1133 where
1134 T: std::iter::IntoIterator<Item = V>,
1135 V: std::convert::Into<crate::model::ResourceErrorDetail>,
1136 {
1137 use std::iter::Iterator;
1138 self.resource_error_details = v.into_iter().map(|i| i.into()).collect();
1139 self
1140 }
1141
1142 /// Sets the value of [resource_error_count][crate::model::MigrationSubtask::resource_error_count].
1143 ///
1144 /// # Example
1145 /// ```ignore,no_run
1146 /// # use google_cloud_bigquery_migration_v2::model::MigrationSubtask;
1147 /// let x = MigrationSubtask::new().set_resource_error_count(42);
1148 /// ```
1149 pub fn set_resource_error_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1150 self.resource_error_count = v.into();
1151 self
1152 }
1153
1154 /// Sets the value of [create_time][crate::model::MigrationSubtask::create_time].
1155 ///
1156 /// # Example
1157 /// ```ignore,no_run
1158 /// # use google_cloud_bigquery_migration_v2::model::MigrationSubtask;
1159 /// use wkt::Timestamp;
1160 /// let x = MigrationSubtask::new().set_create_time(Timestamp::default()/* use setters */);
1161 /// ```
1162 pub fn set_create_time<T>(mut self, v: T) -> Self
1163 where
1164 T: std::convert::Into<wkt::Timestamp>,
1165 {
1166 self.create_time = std::option::Option::Some(v.into());
1167 self
1168 }
1169
1170 /// Sets or clears the value of [create_time][crate::model::MigrationSubtask::create_time].
1171 ///
1172 /// # Example
1173 /// ```ignore,no_run
1174 /// # use google_cloud_bigquery_migration_v2::model::MigrationSubtask;
1175 /// use wkt::Timestamp;
1176 /// let x = MigrationSubtask::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1177 /// let x = MigrationSubtask::new().set_or_clear_create_time(None::<Timestamp>);
1178 /// ```
1179 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1180 where
1181 T: std::convert::Into<wkt::Timestamp>,
1182 {
1183 self.create_time = v.map(|x| x.into());
1184 self
1185 }
1186
1187 /// Sets the value of [last_update_time][crate::model::MigrationSubtask::last_update_time].
1188 ///
1189 /// # Example
1190 /// ```ignore,no_run
1191 /// # use google_cloud_bigquery_migration_v2::model::MigrationSubtask;
1192 /// use wkt::Timestamp;
1193 /// let x = MigrationSubtask::new().set_last_update_time(Timestamp::default()/* use setters */);
1194 /// ```
1195 pub fn set_last_update_time<T>(mut self, v: T) -> Self
1196 where
1197 T: std::convert::Into<wkt::Timestamp>,
1198 {
1199 self.last_update_time = std::option::Option::Some(v.into());
1200 self
1201 }
1202
1203 /// Sets or clears the value of [last_update_time][crate::model::MigrationSubtask::last_update_time].
1204 ///
1205 /// # Example
1206 /// ```ignore,no_run
1207 /// # use google_cloud_bigquery_migration_v2::model::MigrationSubtask;
1208 /// use wkt::Timestamp;
1209 /// let x = MigrationSubtask::new().set_or_clear_last_update_time(Some(Timestamp::default()/* use setters */));
1210 /// let x = MigrationSubtask::new().set_or_clear_last_update_time(None::<Timestamp>);
1211 /// ```
1212 pub fn set_or_clear_last_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1213 where
1214 T: std::convert::Into<wkt::Timestamp>,
1215 {
1216 self.last_update_time = v.map(|x| x.into());
1217 self
1218 }
1219
1220 /// Sets the value of [metrics][crate::model::MigrationSubtask::metrics].
1221 ///
1222 /// # Example
1223 /// ```ignore,no_run
1224 /// # use google_cloud_bigquery_migration_v2::model::MigrationSubtask;
1225 /// use google_cloud_bigquery_migration_v2::model::TimeSeries;
1226 /// let x = MigrationSubtask::new()
1227 /// .set_metrics([
1228 /// TimeSeries::default()/* use setters */,
1229 /// TimeSeries::default()/* use (different) setters */,
1230 /// ]);
1231 /// ```
1232 pub fn set_metrics<T, V>(mut self, v: T) -> Self
1233 where
1234 T: std::iter::IntoIterator<Item = V>,
1235 V: std::convert::Into<crate::model::TimeSeries>,
1236 {
1237 use std::iter::Iterator;
1238 self.metrics = v.into_iter().map(|i| i.into()).collect();
1239 self
1240 }
1241}
1242
1243impl wkt::message::Message for MigrationSubtask {
1244 fn typename() -> &'static str {
1245 "type.googleapis.com/google.cloud.bigquery.migration.v2.MigrationSubtask"
1246 }
1247}
1248
1249/// Defines additional types related to [MigrationSubtask].
1250pub mod migration_subtask {
1251 #[allow(unused_imports)]
1252 use super::*;
1253
1254 /// Possible states of a migration subtask.
1255 ///
1256 /// # Working with unknown values
1257 ///
1258 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1259 /// additional enum variants at any time. Adding new variants is not considered
1260 /// a breaking change. Applications should write their code in anticipation of:
1261 ///
1262 /// - New values appearing in future releases of the client library, **and**
1263 /// - New values received dynamically, without application changes.
1264 ///
1265 /// Please consult the [Working with enums] section in the user guide for some
1266 /// guidelines.
1267 ///
1268 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1269 #[derive(Clone, Debug, PartialEq)]
1270 #[non_exhaustive]
1271 pub enum State {
1272 /// The state is unspecified.
1273 Unspecified,
1274 /// The subtask is ready, i.e. it is ready for execution.
1275 Active,
1276 /// The subtask is running, i.e. it is assigned to a worker for execution.
1277 Running,
1278 /// The subtask finished successfully.
1279 Succeeded,
1280 /// The subtask finished unsuccessfully.
1281 Failed,
1282 /// The subtask is paused, i.e., it will not be scheduled. If it was already
1283 /// assigned,it might still finish but no new lease renewals will be granted.
1284 Paused,
1285 /// The subtask is pending a dependency. It will be scheduled once its
1286 /// dependencies are done.
1287 PendingDependency,
1288 /// If set, the enum was initialized with an unknown value.
1289 ///
1290 /// Applications can examine the value using [State::value] or
1291 /// [State::name].
1292 UnknownValue(state::UnknownValue),
1293 }
1294
1295 #[doc(hidden)]
1296 pub mod state {
1297 #[allow(unused_imports)]
1298 use super::*;
1299 #[derive(Clone, Debug, PartialEq)]
1300 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1301 }
1302
1303 impl State {
1304 /// Gets the enum value.
1305 ///
1306 /// Returns `None` if the enum contains an unknown value deserialized from
1307 /// the string representation of enums.
1308 pub fn value(&self) -> std::option::Option<i32> {
1309 match self {
1310 Self::Unspecified => std::option::Option::Some(0),
1311 Self::Active => std::option::Option::Some(1),
1312 Self::Running => std::option::Option::Some(2),
1313 Self::Succeeded => std::option::Option::Some(3),
1314 Self::Failed => std::option::Option::Some(4),
1315 Self::Paused => std::option::Option::Some(5),
1316 Self::PendingDependency => std::option::Option::Some(6),
1317 Self::UnknownValue(u) => u.0.value(),
1318 }
1319 }
1320
1321 /// Gets the enum value as a string.
1322 ///
1323 /// Returns `None` if the enum contains an unknown value deserialized from
1324 /// the integer representation of enums.
1325 pub fn name(&self) -> std::option::Option<&str> {
1326 match self {
1327 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1328 Self::Active => std::option::Option::Some("ACTIVE"),
1329 Self::Running => std::option::Option::Some("RUNNING"),
1330 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
1331 Self::Failed => std::option::Option::Some("FAILED"),
1332 Self::Paused => std::option::Option::Some("PAUSED"),
1333 Self::PendingDependency => std::option::Option::Some("PENDING_DEPENDENCY"),
1334 Self::UnknownValue(u) => u.0.name(),
1335 }
1336 }
1337 }
1338
1339 impl std::default::Default for State {
1340 fn default() -> Self {
1341 use std::convert::From;
1342 Self::from(0)
1343 }
1344 }
1345
1346 impl std::fmt::Display for State {
1347 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1348 wkt::internal::display_enum(f, self.name(), self.value())
1349 }
1350 }
1351
1352 impl std::convert::From<i32> for State {
1353 fn from(value: i32) -> Self {
1354 match value {
1355 0 => Self::Unspecified,
1356 1 => Self::Active,
1357 2 => Self::Running,
1358 3 => Self::Succeeded,
1359 4 => Self::Failed,
1360 5 => Self::Paused,
1361 6 => Self::PendingDependency,
1362 _ => Self::UnknownValue(state::UnknownValue(
1363 wkt::internal::UnknownEnumValue::Integer(value),
1364 )),
1365 }
1366 }
1367 }
1368
1369 impl std::convert::From<&str> for State {
1370 fn from(value: &str) -> Self {
1371 use std::string::ToString;
1372 match value {
1373 "STATE_UNSPECIFIED" => Self::Unspecified,
1374 "ACTIVE" => Self::Active,
1375 "RUNNING" => Self::Running,
1376 "SUCCEEDED" => Self::Succeeded,
1377 "FAILED" => Self::Failed,
1378 "PAUSED" => Self::Paused,
1379 "PENDING_DEPENDENCY" => Self::PendingDependency,
1380 _ => Self::UnknownValue(state::UnknownValue(
1381 wkt::internal::UnknownEnumValue::String(value.to_string()),
1382 )),
1383 }
1384 }
1385 }
1386
1387 impl serde::ser::Serialize for State {
1388 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1389 where
1390 S: serde::Serializer,
1391 {
1392 match self {
1393 Self::Unspecified => serializer.serialize_i32(0),
1394 Self::Active => serializer.serialize_i32(1),
1395 Self::Running => serializer.serialize_i32(2),
1396 Self::Succeeded => serializer.serialize_i32(3),
1397 Self::Failed => serializer.serialize_i32(4),
1398 Self::Paused => serializer.serialize_i32(5),
1399 Self::PendingDependency => serializer.serialize_i32(6),
1400 Self::UnknownValue(u) => u.0.serialize(serializer),
1401 }
1402 }
1403 }
1404
1405 impl<'de> serde::de::Deserialize<'de> for State {
1406 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1407 where
1408 D: serde::Deserializer<'de>,
1409 {
1410 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1411 ".google.cloud.bigquery.migration.v2.MigrationSubtask.State",
1412 ))
1413 }
1414 }
1415}
1416
1417/// The migration task result.
1418#[derive(Clone, Default, PartialEq)]
1419#[non_exhaustive]
1420pub struct MigrationTaskResult {
1421 /// Details specific to the task type.
1422 pub details: std::option::Option<crate::model::migration_task_result::Details>,
1423
1424 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1425}
1426
1427impl MigrationTaskResult {
1428 /// Creates a new default instance.
1429 pub fn new() -> Self {
1430 std::default::Default::default()
1431 }
1432
1433 /// Sets the value of [details][crate::model::MigrationTaskResult::details].
1434 ///
1435 /// Note that all the setters affecting `details` are mutually
1436 /// exclusive.
1437 ///
1438 /// # Example
1439 /// ```ignore,no_run
1440 /// # use google_cloud_bigquery_migration_v2::model::MigrationTaskResult;
1441 /// use google_cloud_bigquery_migration_v2::model::TranslationTaskResult;
1442 /// let x = MigrationTaskResult::new().set_details(Some(
1443 /// google_cloud_bigquery_migration_v2::model::migration_task_result::Details::TranslationTaskResult(TranslationTaskResult::default().into())));
1444 /// ```
1445 pub fn set_details<
1446 T: std::convert::Into<std::option::Option<crate::model::migration_task_result::Details>>,
1447 >(
1448 mut self,
1449 v: T,
1450 ) -> Self {
1451 self.details = v.into();
1452 self
1453 }
1454
1455 /// The value of [details][crate::model::MigrationTaskResult::details]
1456 /// if it holds a `TranslationTaskResult`, `None` if the field is not set or
1457 /// holds a different branch.
1458 pub fn translation_task_result(
1459 &self,
1460 ) -> std::option::Option<&std::boxed::Box<crate::model::TranslationTaskResult>> {
1461 #[allow(unreachable_patterns)]
1462 self.details.as_ref().and_then(|v| match v {
1463 crate::model::migration_task_result::Details::TranslationTaskResult(v) => {
1464 std::option::Option::Some(v)
1465 }
1466 _ => std::option::Option::None,
1467 })
1468 }
1469
1470 /// Sets the value of [details][crate::model::MigrationTaskResult::details]
1471 /// to hold a `TranslationTaskResult`.
1472 ///
1473 /// Note that all the setters affecting `details` are
1474 /// mutually exclusive.
1475 ///
1476 /// # Example
1477 /// ```ignore,no_run
1478 /// # use google_cloud_bigquery_migration_v2::model::MigrationTaskResult;
1479 /// use google_cloud_bigquery_migration_v2::model::TranslationTaskResult;
1480 /// let x = MigrationTaskResult::new().set_translation_task_result(TranslationTaskResult::default()/* use setters */);
1481 /// assert!(x.translation_task_result().is_some());
1482 /// ```
1483 pub fn set_translation_task_result<
1484 T: std::convert::Into<std::boxed::Box<crate::model::TranslationTaskResult>>,
1485 >(
1486 mut self,
1487 v: T,
1488 ) -> Self {
1489 self.details = std::option::Option::Some(
1490 crate::model::migration_task_result::Details::TranslationTaskResult(v.into()),
1491 );
1492 self
1493 }
1494}
1495
1496impl wkt::message::Message for MigrationTaskResult {
1497 fn typename() -> &'static str {
1498 "type.googleapis.com/google.cloud.bigquery.migration.v2.MigrationTaskResult"
1499 }
1500}
1501
1502/// Defines additional types related to [MigrationTaskResult].
1503pub mod migration_task_result {
1504 #[allow(unused_imports)]
1505 use super::*;
1506
1507 /// Details specific to the task type.
1508 #[derive(Clone, Debug, PartialEq)]
1509 #[non_exhaustive]
1510 pub enum Details {
1511 /// Details specific to translation task types.
1512 TranslationTaskResult(std::boxed::Box<crate::model::TranslationTaskResult>),
1513 }
1514}
1515
1516/// Translation specific result details from the migration task.
1517#[derive(Clone, Default, PartialEq)]
1518#[non_exhaustive]
1519pub struct TranslationTaskResult {
1520 /// The list of the translated literals.
1521 pub translated_literals: std::vec::Vec<crate::model::Literal>,
1522
1523 /// The records from the aggregate CSV report for a migration workflow.
1524 pub report_log_messages: std::vec::Vec<crate::model::GcsReportLogMessage>,
1525
1526 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1527}
1528
1529impl TranslationTaskResult {
1530 /// Creates a new default instance.
1531 pub fn new() -> Self {
1532 std::default::Default::default()
1533 }
1534
1535 /// Sets the value of [translated_literals][crate::model::TranslationTaskResult::translated_literals].
1536 ///
1537 /// # Example
1538 /// ```ignore,no_run
1539 /// # use google_cloud_bigquery_migration_v2::model::TranslationTaskResult;
1540 /// use google_cloud_bigquery_migration_v2::model::Literal;
1541 /// let x = TranslationTaskResult::new()
1542 /// .set_translated_literals([
1543 /// Literal::default()/* use setters */,
1544 /// Literal::default()/* use (different) setters */,
1545 /// ]);
1546 /// ```
1547 pub fn set_translated_literals<T, V>(mut self, v: T) -> Self
1548 where
1549 T: std::iter::IntoIterator<Item = V>,
1550 V: std::convert::Into<crate::model::Literal>,
1551 {
1552 use std::iter::Iterator;
1553 self.translated_literals = v.into_iter().map(|i| i.into()).collect();
1554 self
1555 }
1556
1557 /// Sets the value of [report_log_messages][crate::model::TranslationTaskResult::report_log_messages].
1558 ///
1559 /// # Example
1560 /// ```ignore,no_run
1561 /// # use google_cloud_bigquery_migration_v2::model::TranslationTaskResult;
1562 /// use google_cloud_bigquery_migration_v2::model::GcsReportLogMessage;
1563 /// let x = TranslationTaskResult::new()
1564 /// .set_report_log_messages([
1565 /// GcsReportLogMessage::default()/* use setters */,
1566 /// GcsReportLogMessage::default()/* use (different) setters */,
1567 /// ]);
1568 /// ```
1569 pub fn set_report_log_messages<T, V>(mut self, v: T) -> Self
1570 where
1571 T: std::iter::IntoIterator<Item = V>,
1572 V: std::convert::Into<crate::model::GcsReportLogMessage>,
1573 {
1574 use std::iter::Iterator;
1575 self.report_log_messages = v.into_iter().map(|i| i.into()).collect();
1576 self
1577 }
1578}
1579
1580impl wkt::message::Message for TranslationTaskResult {
1581 fn typename() -> &'static str {
1582 "type.googleapis.com/google.cloud.bigquery.migration.v2.TranslationTaskResult"
1583 }
1584}
1585
1586/// Provides details for errors and the corresponding resources.
1587#[derive(Clone, Default, PartialEq)]
1588#[non_exhaustive]
1589pub struct ResourceErrorDetail {
1590 /// Required. Information about the resource where the error is located.
1591 pub resource_info: std::option::Option<google_cloud_rpc::model::ResourceInfo>,
1592
1593 /// Required. The error details for the resource.
1594 pub error_details: std::vec::Vec<crate::model::ErrorDetail>,
1595
1596 /// Required. How many errors there are in total for the resource. Truncation
1597 /// can be indicated by having an `error_count` that is higher than the size of
1598 /// `error_details`.
1599 pub error_count: i32,
1600
1601 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1602}
1603
1604impl ResourceErrorDetail {
1605 /// Creates a new default instance.
1606 pub fn new() -> Self {
1607 std::default::Default::default()
1608 }
1609
1610 /// Sets the value of [resource_info][crate::model::ResourceErrorDetail::resource_info].
1611 ///
1612 /// # Example
1613 /// ```ignore,no_run
1614 /// # use google_cloud_bigquery_migration_v2::model::ResourceErrorDetail;
1615 /// use google_cloud_rpc::model::ResourceInfo;
1616 /// let x = ResourceErrorDetail::new().set_resource_info(ResourceInfo::default()/* use setters */);
1617 /// ```
1618 pub fn set_resource_info<T>(mut self, v: T) -> Self
1619 where
1620 T: std::convert::Into<google_cloud_rpc::model::ResourceInfo>,
1621 {
1622 self.resource_info = std::option::Option::Some(v.into());
1623 self
1624 }
1625
1626 /// Sets or clears the value of [resource_info][crate::model::ResourceErrorDetail::resource_info].
1627 ///
1628 /// # Example
1629 /// ```ignore,no_run
1630 /// # use google_cloud_bigquery_migration_v2::model::ResourceErrorDetail;
1631 /// use google_cloud_rpc::model::ResourceInfo;
1632 /// let x = ResourceErrorDetail::new().set_or_clear_resource_info(Some(ResourceInfo::default()/* use setters */));
1633 /// let x = ResourceErrorDetail::new().set_or_clear_resource_info(None::<ResourceInfo>);
1634 /// ```
1635 pub fn set_or_clear_resource_info<T>(mut self, v: std::option::Option<T>) -> Self
1636 where
1637 T: std::convert::Into<google_cloud_rpc::model::ResourceInfo>,
1638 {
1639 self.resource_info = v.map(|x| x.into());
1640 self
1641 }
1642
1643 /// Sets the value of [error_details][crate::model::ResourceErrorDetail::error_details].
1644 ///
1645 /// # Example
1646 /// ```ignore,no_run
1647 /// # use google_cloud_bigquery_migration_v2::model::ResourceErrorDetail;
1648 /// use google_cloud_bigquery_migration_v2::model::ErrorDetail;
1649 /// let x = ResourceErrorDetail::new()
1650 /// .set_error_details([
1651 /// ErrorDetail::default()/* use setters */,
1652 /// ErrorDetail::default()/* use (different) setters */,
1653 /// ]);
1654 /// ```
1655 pub fn set_error_details<T, V>(mut self, v: T) -> Self
1656 where
1657 T: std::iter::IntoIterator<Item = V>,
1658 V: std::convert::Into<crate::model::ErrorDetail>,
1659 {
1660 use std::iter::Iterator;
1661 self.error_details = v.into_iter().map(|i| i.into()).collect();
1662 self
1663 }
1664
1665 /// Sets the value of [error_count][crate::model::ResourceErrorDetail::error_count].
1666 ///
1667 /// # Example
1668 /// ```ignore,no_run
1669 /// # use google_cloud_bigquery_migration_v2::model::ResourceErrorDetail;
1670 /// let x = ResourceErrorDetail::new().set_error_count(42);
1671 /// ```
1672 pub fn set_error_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1673 self.error_count = v.into();
1674 self
1675 }
1676}
1677
1678impl wkt::message::Message for ResourceErrorDetail {
1679 fn typename() -> &'static str {
1680 "type.googleapis.com/google.cloud.bigquery.migration.v2.ResourceErrorDetail"
1681 }
1682}
1683
1684/// Provides details for errors, e.g. issues that where encountered when
1685/// processing a subtask.
1686#[derive(Clone, Default, PartialEq)]
1687#[non_exhaustive]
1688pub struct ErrorDetail {
1689 /// Optional. The exact location within the resource (if applicable).
1690 pub location: std::option::Option<crate::model::ErrorLocation>,
1691
1692 /// Required. Describes the cause of the error with structured detail.
1693 pub error_info: std::option::Option<google_cloud_rpc::model::ErrorInfo>,
1694
1695 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1696}
1697
1698impl ErrorDetail {
1699 /// Creates a new default instance.
1700 pub fn new() -> Self {
1701 std::default::Default::default()
1702 }
1703
1704 /// Sets the value of [location][crate::model::ErrorDetail::location].
1705 ///
1706 /// # Example
1707 /// ```ignore,no_run
1708 /// # use google_cloud_bigquery_migration_v2::model::ErrorDetail;
1709 /// use google_cloud_bigquery_migration_v2::model::ErrorLocation;
1710 /// let x = ErrorDetail::new().set_location(ErrorLocation::default()/* use setters */);
1711 /// ```
1712 pub fn set_location<T>(mut self, v: T) -> Self
1713 where
1714 T: std::convert::Into<crate::model::ErrorLocation>,
1715 {
1716 self.location = std::option::Option::Some(v.into());
1717 self
1718 }
1719
1720 /// Sets or clears the value of [location][crate::model::ErrorDetail::location].
1721 ///
1722 /// # Example
1723 /// ```ignore,no_run
1724 /// # use google_cloud_bigquery_migration_v2::model::ErrorDetail;
1725 /// use google_cloud_bigquery_migration_v2::model::ErrorLocation;
1726 /// let x = ErrorDetail::new().set_or_clear_location(Some(ErrorLocation::default()/* use setters */));
1727 /// let x = ErrorDetail::new().set_or_clear_location(None::<ErrorLocation>);
1728 /// ```
1729 pub fn set_or_clear_location<T>(mut self, v: std::option::Option<T>) -> Self
1730 where
1731 T: std::convert::Into<crate::model::ErrorLocation>,
1732 {
1733 self.location = v.map(|x| x.into());
1734 self
1735 }
1736
1737 /// Sets the value of [error_info][crate::model::ErrorDetail::error_info].
1738 ///
1739 /// # Example
1740 /// ```ignore,no_run
1741 /// # use google_cloud_bigquery_migration_v2::model::ErrorDetail;
1742 /// use google_cloud_rpc::model::ErrorInfo;
1743 /// let x = ErrorDetail::new().set_error_info(ErrorInfo::default()/* use setters */);
1744 /// ```
1745 pub fn set_error_info<T>(mut self, v: T) -> Self
1746 where
1747 T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
1748 {
1749 self.error_info = std::option::Option::Some(v.into());
1750 self
1751 }
1752
1753 /// Sets or clears the value of [error_info][crate::model::ErrorDetail::error_info].
1754 ///
1755 /// # Example
1756 /// ```ignore,no_run
1757 /// # use google_cloud_bigquery_migration_v2::model::ErrorDetail;
1758 /// use google_cloud_rpc::model::ErrorInfo;
1759 /// let x = ErrorDetail::new().set_or_clear_error_info(Some(ErrorInfo::default()/* use setters */));
1760 /// let x = ErrorDetail::new().set_or_clear_error_info(None::<ErrorInfo>);
1761 /// ```
1762 pub fn set_or_clear_error_info<T>(mut self, v: std::option::Option<T>) -> Self
1763 where
1764 T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
1765 {
1766 self.error_info = v.map(|x| x.into());
1767 self
1768 }
1769}
1770
1771impl wkt::message::Message for ErrorDetail {
1772 fn typename() -> &'static str {
1773 "type.googleapis.com/google.cloud.bigquery.migration.v2.ErrorDetail"
1774 }
1775}
1776
1777/// Holds information about where the error is located.
1778#[derive(Clone, Default, PartialEq)]
1779#[non_exhaustive]
1780pub struct ErrorLocation {
1781 /// Optional. If applicable, denotes the line where the error occurred. A zero
1782 /// value means that there is no line information.
1783 pub line: i32,
1784
1785 /// Optional. If applicable, denotes the column where the error occurred. A
1786 /// zero value means that there is no columns information.
1787 pub column: i32,
1788
1789 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1790}
1791
1792impl ErrorLocation {
1793 /// Creates a new default instance.
1794 pub fn new() -> Self {
1795 std::default::Default::default()
1796 }
1797
1798 /// Sets the value of [line][crate::model::ErrorLocation::line].
1799 ///
1800 /// # Example
1801 /// ```ignore,no_run
1802 /// # use google_cloud_bigquery_migration_v2::model::ErrorLocation;
1803 /// let x = ErrorLocation::new().set_line(42);
1804 /// ```
1805 pub fn set_line<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1806 self.line = v.into();
1807 self
1808 }
1809
1810 /// Sets the value of [column][crate::model::ErrorLocation::column].
1811 ///
1812 /// # Example
1813 /// ```ignore,no_run
1814 /// # use google_cloud_bigquery_migration_v2::model::ErrorLocation;
1815 /// let x = ErrorLocation::new().set_column(42);
1816 /// ```
1817 pub fn set_column<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1818 self.column = v.into();
1819 self
1820 }
1821}
1822
1823impl wkt::message::Message for ErrorLocation {
1824 fn typename() -> &'static str {
1825 "type.googleapis.com/google.cloud.bigquery.migration.v2.ErrorLocation"
1826 }
1827}
1828
1829/// The metrics object for a SubTask.
1830#[derive(Clone, Default, PartialEq)]
1831#[non_exhaustive]
1832pub struct TimeSeries {
1833 /// Required. The name of the metric.
1834 ///
1835 /// If the metric is not known by the service yet, it will be auto-created.
1836 pub metric: std::string::String,
1837
1838 /// Required. The value type of the time series.
1839 pub value_type: google_cloud_api::model::metric_descriptor::ValueType,
1840
1841 /// Optional. The metric kind of the time series.
1842 ///
1843 /// If present, it must be the same as the metric kind of the associated
1844 /// metric. If the associated metric's descriptor must be auto-created, then
1845 /// this field specifies the metric kind of the new descriptor and must be
1846 /// either `GAUGE` (the default) or `CUMULATIVE`.
1847 pub metric_kind: google_cloud_api::model::metric_descriptor::MetricKind,
1848
1849 /// Required. The data points of this time series. When listing time series,
1850 /// points are returned in reverse time order.
1851 ///
1852 /// When creating a time series, this field must contain exactly one point and
1853 /// the point's type must be the same as the value type of the associated
1854 /// metric. If the associated metric's descriptor must be auto-created, then
1855 /// the value type of the descriptor is determined by the point's type, which
1856 /// must be `BOOL`, `INT64`, `DOUBLE`, or `DISTRIBUTION`.
1857 pub points: std::vec::Vec<crate::model::Point>,
1858
1859 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1860}
1861
1862impl TimeSeries {
1863 /// Creates a new default instance.
1864 pub fn new() -> Self {
1865 std::default::Default::default()
1866 }
1867
1868 /// Sets the value of [metric][crate::model::TimeSeries::metric].
1869 ///
1870 /// # Example
1871 /// ```ignore,no_run
1872 /// # use google_cloud_bigquery_migration_v2::model::TimeSeries;
1873 /// let x = TimeSeries::new().set_metric("example");
1874 /// ```
1875 pub fn set_metric<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1876 self.metric = v.into();
1877 self
1878 }
1879
1880 /// Sets the value of [value_type][crate::model::TimeSeries::value_type].
1881 ///
1882 /// # Example
1883 /// ```ignore,no_run
1884 /// # use google_cloud_bigquery_migration_v2::model::TimeSeries;
1885 /// use google_cloud_api::model::metric_descriptor::ValueType;
1886 /// let x0 = TimeSeries::new().set_value_type(ValueType::Bool);
1887 /// let x1 = TimeSeries::new().set_value_type(ValueType::Int64);
1888 /// let x2 = TimeSeries::new().set_value_type(ValueType::Double);
1889 /// ```
1890 pub fn set_value_type<
1891 T: std::convert::Into<google_cloud_api::model::metric_descriptor::ValueType>,
1892 >(
1893 mut self,
1894 v: T,
1895 ) -> Self {
1896 self.value_type = v.into();
1897 self
1898 }
1899
1900 /// Sets the value of [metric_kind][crate::model::TimeSeries::metric_kind].
1901 ///
1902 /// # Example
1903 /// ```ignore,no_run
1904 /// # use google_cloud_bigquery_migration_v2::model::TimeSeries;
1905 /// use google_cloud_api::model::metric_descriptor::MetricKind;
1906 /// let x0 = TimeSeries::new().set_metric_kind(MetricKind::Gauge);
1907 /// let x1 = TimeSeries::new().set_metric_kind(MetricKind::Delta);
1908 /// let x2 = TimeSeries::new().set_metric_kind(MetricKind::Cumulative);
1909 /// ```
1910 pub fn set_metric_kind<
1911 T: std::convert::Into<google_cloud_api::model::metric_descriptor::MetricKind>,
1912 >(
1913 mut self,
1914 v: T,
1915 ) -> Self {
1916 self.metric_kind = v.into();
1917 self
1918 }
1919
1920 /// Sets the value of [points][crate::model::TimeSeries::points].
1921 ///
1922 /// # Example
1923 /// ```ignore,no_run
1924 /// # use google_cloud_bigquery_migration_v2::model::TimeSeries;
1925 /// use google_cloud_bigquery_migration_v2::model::Point;
1926 /// let x = TimeSeries::new()
1927 /// .set_points([
1928 /// Point::default()/* use setters */,
1929 /// Point::default()/* use (different) setters */,
1930 /// ]);
1931 /// ```
1932 pub fn set_points<T, V>(mut self, v: T) -> Self
1933 where
1934 T: std::iter::IntoIterator<Item = V>,
1935 V: std::convert::Into<crate::model::Point>,
1936 {
1937 use std::iter::Iterator;
1938 self.points = v.into_iter().map(|i| i.into()).collect();
1939 self
1940 }
1941}
1942
1943impl wkt::message::Message for TimeSeries {
1944 fn typename() -> &'static str {
1945 "type.googleapis.com/google.cloud.bigquery.migration.v2.TimeSeries"
1946 }
1947}
1948
1949/// A single data point in a time series.
1950#[derive(Clone, Default, PartialEq)]
1951#[non_exhaustive]
1952pub struct Point {
1953 /// The time interval to which the data point applies. For `GAUGE` metrics,
1954 /// the start time does not need to be supplied, but if it is supplied, it must
1955 /// equal the end time. For `DELTA` metrics, the start and end time should
1956 /// specify a non-zero interval, with subsequent points specifying contiguous
1957 /// and non-overlapping intervals. For `CUMULATIVE` metrics, the start and end
1958 /// time should specify a non-zero interval, with subsequent points specifying
1959 /// the same start time and increasing end times, until an event resets the
1960 /// cumulative value to zero and sets a new start time for the following
1961 /// points.
1962 pub interval: std::option::Option<crate::model::TimeInterval>,
1963
1964 /// The value of the data point.
1965 pub value: std::option::Option<crate::model::TypedValue>,
1966
1967 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1968}
1969
1970impl Point {
1971 /// Creates a new default instance.
1972 pub fn new() -> Self {
1973 std::default::Default::default()
1974 }
1975
1976 /// Sets the value of [interval][crate::model::Point::interval].
1977 ///
1978 /// # Example
1979 /// ```ignore,no_run
1980 /// # use google_cloud_bigquery_migration_v2::model::Point;
1981 /// use google_cloud_bigquery_migration_v2::model::TimeInterval;
1982 /// let x = Point::new().set_interval(TimeInterval::default()/* use setters */);
1983 /// ```
1984 pub fn set_interval<T>(mut self, v: T) -> Self
1985 where
1986 T: std::convert::Into<crate::model::TimeInterval>,
1987 {
1988 self.interval = std::option::Option::Some(v.into());
1989 self
1990 }
1991
1992 /// Sets or clears the value of [interval][crate::model::Point::interval].
1993 ///
1994 /// # Example
1995 /// ```ignore,no_run
1996 /// # use google_cloud_bigquery_migration_v2::model::Point;
1997 /// use google_cloud_bigquery_migration_v2::model::TimeInterval;
1998 /// let x = Point::new().set_or_clear_interval(Some(TimeInterval::default()/* use setters */));
1999 /// let x = Point::new().set_or_clear_interval(None::<TimeInterval>);
2000 /// ```
2001 pub fn set_or_clear_interval<T>(mut self, v: std::option::Option<T>) -> Self
2002 where
2003 T: std::convert::Into<crate::model::TimeInterval>,
2004 {
2005 self.interval = v.map(|x| x.into());
2006 self
2007 }
2008
2009 /// Sets the value of [value][crate::model::Point::value].
2010 ///
2011 /// # Example
2012 /// ```ignore,no_run
2013 /// # use google_cloud_bigquery_migration_v2::model::Point;
2014 /// use google_cloud_bigquery_migration_v2::model::TypedValue;
2015 /// let x = Point::new().set_value(TypedValue::default()/* use setters */);
2016 /// ```
2017 pub fn set_value<T>(mut self, v: T) -> Self
2018 where
2019 T: std::convert::Into<crate::model::TypedValue>,
2020 {
2021 self.value = std::option::Option::Some(v.into());
2022 self
2023 }
2024
2025 /// Sets or clears the value of [value][crate::model::Point::value].
2026 ///
2027 /// # Example
2028 /// ```ignore,no_run
2029 /// # use google_cloud_bigquery_migration_v2::model::Point;
2030 /// use google_cloud_bigquery_migration_v2::model::TypedValue;
2031 /// let x = Point::new().set_or_clear_value(Some(TypedValue::default()/* use setters */));
2032 /// let x = Point::new().set_or_clear_value(None::<TypedValue>);
2033 /// ```
2034 pub fn set_or_clear_value<T>(mut self, v: std::option::Option<T>) -> Self
2035 where
2036 T: std::convert::Into<crate::model::TypedValue>,
2037 {
2038 self.value = v.map(|x| x.into());
2039 self
2040 }
2041}
2042
2043impl wkt::message::Message for Point {
2044 fn typename() -> &'static str {
2045 "type.googleapis.com/google.cloud.bigquery.migration.v2.Point"
2046 }
2047}
2048
2049/// A time interval extending just after a start time through an end time.
2050/// If the start time is the same as the end time, then the interval
2051/// represents a single point in time.
2052#[derive(Clone, Default, PartialEq)]
2053#[non_exhaustive]
2054pub struct TimeInterval {
2055 /// Optional. The beginning of the time interval. The default value
2056 /// for the start time is the end time. The start time must not be
2057 /// later than the end time.
2058 pub start_time: std::option::Option<wkt::Timestamp>,
2059
2060 /// Required. The end of the time interval.
2061 pub end_time: std::option::Option<wkt::Timestamp>,
2062
2063 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2064}
2065
2066impl TimeInterval {
2067 /// Creates a new default instance.
2068 pub fn new() -> Self {
2069 std::default::Default::default()
2070 }
2071
2072 /// Sets the value of [start_time][crate::model::TimeInterval::start_time].
2073 ///
2074 /// # Example
2075 /// ```ignore,no_run
2076 /// # use google_cloud_bigquery_migration_v2::model::TimeInterval;
2077 /// use wkt::Timestamp;
2078 /// let x = TimeInterval::new().set_start_time(Timestamp::default()/* use setters */);
2079 /// ```
2080 pub fn set_start_time<T>(mut self, v: T) -> Self
2081 where
2082 T: std::convert::Into<wkt::Timestamp>,
2083 {
2084 self.start_time = std::option::Option::Some(v.into());
2085 self
2086 }
2087
2088 /// Sets or clears the value of [start_time][crate::model::TimeInterval::start_time].
2089 ///
2090 /// # Example
2091 /// ```ignore,no_run
2092 /// # use google_cloud_bigquery_migration_v2::model::TimeInterval;
2093 /// use wkt::Timestamp;
2094 /// let x = TimeInterval::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
2095 /// let x = TimeInterval::new().set_or_clear_start_time(None::<Timestamp>);
2096 /// ```
2097 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
2098 where
2099 T: std::convert::Into<wkt::Timestamp>,
2100 {
2101 self.start_time = v.map(|x| x.into());
2102 self
2103 }
2104
2105 /// Sets the value of [end_time][crate::model::TimeInterval::end_time].
2106 ///
2107 /// # Example
2108 /// ```ignore,no_run
2109 /// # use google_cloud_bigquery_migration_v2::model::TimeInterval;
2110 /// use wkt::Timestamp;
2111 /// let x = TimeInterval::new().set_end_time(Timestamp::default()/* use setters */);
2112 /// ```
2113 pub fn set_end_time<T>(mut self, v: T) -> Self
2114 where
2115 T: std::convert::Into<wkt::Timestamp>,
2116 {
2117 self.end_time = std::option::Option::Some(v.into());
2118 self
2119 }
2120
2121 /// Sets or clears the value of [end_time][crate::model::TimeInterval::end_time].
2122 ///
2123 /// # Example
2124 /// ```ignore,no_run
2125 /// # use google_cloud_bigquery_migration_v2::model::TimeInterval;
2126 /// use wkt::Timestamp;
2127 /// let x = TimeInterval::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
2128 /// let x = TimeInterval::new().set_or_clear_end_time(None::<Timestamp>);
2129 /// ```
2130 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2131 where
2132 T: std::convert::Into<wkt::Timestamp>,
2133 {
2134 self.end_time = v.map(|x| x.into());
2135 self
2136 }
2137}
2138
2139impl wkt::message::Message for TimeInterval {
2140 fn typename() -> &'static str {
2141 "type.googleapis.com/google.cloud.bigquery.migration.v2.TimeInterval"
2142 }
2143}
2144
2145/// A single strongly-typed value.
2146#[derive(Clone, Default, PartialEq)]
2147#[non_exhaustive]
2148pub struct TypedValue {
2149 /// The typed value field.
2150 pub value: std::option::Option<crate::model::typed_value::Value>,
2151
2152 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2153}
2154
2155impl TypedValue {
2156 /// Creates a new default instance.
2157 pub fn new() -> Self {
2158 std::default::Default::default()
2159 }
2160
2161 /// Sets the value of [value][crate::model::TypedValue::value].
2162 ///
2163 /// Note that all the setters affecting `value` are mutually
2164 /// exclusive.
2165 ///
2166 /// # Example
2167 /// ```ignore,no_run
2168 /// # use google_cloud_bigquery_migration_v2::model::TypedValue;
2169 /// use google_cloud_bigquery_migration_v2::model::typed_value::Value;
2170 /// let x = TypedValue::new().set_value(Some(Value::BoolValue(true)));
2171 /// ```
2172 pub fn set_value<
2173 T: std::convert::Into<std::option::Option<crate::model::typed_value::Value>>,
2174 >(
2175 mut self,
2176 v: T,
2177 ) -> Self {
2178 self.value = v.into();
2179 self
2180 }
2181
2182 /// The value of [value][crate::model::TypedValue::value]
2183 /// if it holds a `BoolValue`, `None` if the field is not set or
2184 /// holds a different branch.
2185 pub fn bool_value(&self) -> std::option::Option<&bool> {
2186 #[allow(unreachable_patterns)]
2187 self.value.as_ref().and_then(|v| match v {
2188 crate::model::typed_value::Value::BoolValue(v) => std::option::Option::Some(v),
2189 _ => std::option::Option::None,
2190 })
2191 }
2192
2193 /// Sets the value of [value][crate::model::TypedValue::value]
2194 /// to hold a `BoolValue`.
2195 ///
2196 /// Note that all the setters affecting `value` are
2197 /// mutually exclusive.
2198 ///
2199 /// # Example
2200 /// ```ignore,no_run
2201 /// # use google_cloud_bigquery_migration_v2::model::TypedValue;
2202 /// let x = TypedValue::new().set_bool_value(true);
2203 /// assert!(x.bool_value().is_some());
2204 /// assert!(x.int64_value().is_none());
2205 /// assert!(x.double_value().is_none());
2206 /// assert!(x.string_value().is_none());
2207 /// assert!(x.distribution_value().is_none());
2208 /// ```
2209 pub fn set_bool_value<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2210 self.value =
2211 std::option::Option::Some(crate::model::typed_value::Value::BoolValue(v.into()));
2212 self
2213 }
2214
2215 /// The value of [value][crate::model::TypedValue::value]
2216 /// if it holds a `Int64Value`, `None` if the field is not set or
2217 /// holds a different branch.
2218 pub fn int64_value(&self) -> std::option::Option<&i64> {
2219 #[allow(unreachable_patterns)]
2220 self.value.as_ref().and_then(|v| match v {
2221 crate::model::typed_value::Value::Int64Value(v) => std::option::Option::Some(v),
2222 _ => std::option::Option::None,
2223 })
2224 }
2225
2226 /// Sets the value of [value][crate::model::TypedValue::value]
2227 /// to hold a `Int64Value`.
2228 ///
2229 /// Note that all the setters affecting `value` are
2230 /// mutually exclusive.
2231 ///
2232 /// # Example
2233 /// ```ignore,no_run
2234 /// # use google_cloud_bigquery_migration_v2::model::TypedValue;
2235 /// let x = TypedValue::new().set_int64_value(42);
2236 /// assert!(x.int64_value().is_some());
2237 /// assert!(x.bool_value().is_none());
2238 /// assert!(x.double_value().is_none());
2239 /// assert!(x.string_value().is_none());
2240 /// assert!(x.distribution_value().is_none());
2241 /// ```
2242 pub fn set_int64_value<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2243 self.value =
2244 std::option::Option::Some(crate::model::typed_value::Value::Int64Value(v.into()));
2245 self
2246 }
2247
2248 /// The value of [value][crate::model::TypedValue::value]
2249 /// if it holds a `DoubleValue`, `None` if the field is not set or
2250 /// holds a different branch.
2251 pub fn double_value(&self) -> std::option::Option<&f64> {
2252 #[allow(unreachable_patterns)]
2253 self.value.as_ref().and_then(|v| match v {
2254 crate::model::typed_value::Value::DoubleValue(v) => std::option::Option::Some(v),
2255 _ => std::option::Option::None,
2256 })
2257 }
2258
2259 /// Sets the value of [value][crate::model::TypedValue::value]
2260 /// to hold a `DoubleValue`.
2261 ///
2262 /// Note that all the setters affecting `value` are
2263 /// mutually exclusive.
2264 ///
2265 /// # Example
2266 /// ```ignore,no_run
2267 /// # use google_cloud_bigquery_migration_v2::model::TypedValue;
2268 /// let x = TypedValue::new().set_double_value(42.0);
2269 /// assert!(x.double_value().is_some());
2270 /// assert!(x.bool_value().is_none());
2271 /// assert!(x.int64_value().is_none());
2272 /// assert!(x.string_value().is_none());
2273 /// assert!(x.distribution_value().is_none());
2274 /// ```
2275 pub fn set_double_value<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
2276 self.value =
2277 std::option::Option::Some(crate::model::typed_value::Value::DoubleValue(v.into()));
2278 self
2279 }
2280
2281 /// The value of [value][crate::model::TypedValue::value]
2282 /// if it holds a `StringValue`, `None` if the field is not set or
2283 /// holds a different branch.
2284 pub fn string_value(&self) -> std::option::Option<&std::string::String> {
2285 #[allow(unreachable_patterns)]
2286 self.value.as_ref().and_then(|v| match v {
2287 crate::model::typed_value::Value::StringValue(v) => std::option::Option::Some(v),
2288 _ => std::option::Option::None,
2289 })
2290 }
2291
2292 /// Sets the value of [value][crate::model::TypedValue::value]
2293 /// to hold a `StringValue`.
2294 ///
2295 /// Note that all the setters affecting `value` are
2296 /// mutually exclusive.
2297 ///
2298 /// # Example
2299 /// ```ignore,no_run
2300 /// # use google_cloud_bigquery_migration_v2::model::TypedValue;
2301 /// let x = TypedValue::new().set_string_value("example");
2302 /// assert!(x.string_value().is_some());
2303 /// assert!(x.bool_value().is_none());
2304 /// assert!(x.int64_value().is_none());
2305 /// assert!(x.double_value().is_none());
2306 /// assert!(x.distribution_value().is_none());
2307 /// ```
2308 pub fn set_string_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2309 self.value =
2310 std::option::Option::Some(crate::model::typed_value::Value::StringValue(v.into()));
2311 self
2312 }
2313
2314 /// The value of [value][crate::model::TypedValue::value]
2315 /// if it holds a `DistributionValue`, `None` if the field is not set or
2316 /// holds a different branch.
2317 pub fn distribution_value(
2318 &self,
2319 ) -> std::option::Option<&std::boxed::Box<google_cloud_api::model::Distribution>> {
2320 #[allow(unreachable_patterns)]
2321 self.value.as_ref().and_then(|v| match v {
2322 crate::model::typed_value::Value::DistributionValue(v) => std::option::Option::Some(v),
2323 _ => std::option::Option::None,
2324 })
2325 }
2326
2327 /// Sets the value of [value][crate::model::TypedValue::value]
2328 /// to hold a `DistributionValue`.
2329 ///
2330 /// Note that all the setters affecting `value` are
2331 /// mutually exclusive.
2332 ///
2333 /// # Example
2334 /// ```ignore,no_run
2335 /// # use google_cloud_bigquery_migration_v2::model::TypedValue;
2336 /// use google_cloud_api::model::Distribution;
2337 /// let x = TypedValue::new().set_distribution_value(Distribution::default()/* use setters */);
2338 /// assert!(x.distribution_value().is_some());
2339 /// assert!(x.bool_value().is_none());
2340 /// assert!(x.int64_value().is_none());
2341 /// assert!(x.double_value().is_none());
2342 /// assert!(x.string_value().is_none());
2343 /// ```
2344 pub fn set_distribution_value<
2345 T: std::convert::Into<std::boxed::Box<google_cloud_api::model::Distribution>>,
2346 >(
2347 mut self,
2348 v: T,
2349 ) -> Self {
2350 self.value = std::option::Option::Some(
2351 crate::model::typed_value::Value::DistributionValue(v.into()),
2352 );
2353 self
2354 }
2355}
2356
2357impl wkt::message::Message for TypedValue {
2358 fn typename() -> &'static str {
2359 "type.googleapis.com/google.cloud.bigquery.migration.v2.TypedValue"
2360 }
2361}
2362
2363/// Defines additional types related to [TypedValue].
2364pub mod typed_value {
2365 #[allow(unused_imports)]
2366 use super::*;
2367
2368 /// The typed value field.
2369 #[derive(Clone, Debug, PartialEq)]
2370 #[non_exhaustive]
2371 pub enum Value {
2372 /// A Boolean value: `true` or `false`.
2373 BoolValue(bool),
2374 /// A 64-bit integer. Its range is approximately `+/-9.2x10^18`.
2375 Int64Value(i64),
2376 /// A 64-bit double-precision floating-point number. Its magnitude
2377 /// is approximately `+/-10^(+/-300)` and it has 16 significant digits of
2378 /// precision.
2379 DoubleValue(f64),
2380 /// A variable-length string value.
2381 StringValue(std::string::String),
2382 /// A distribution value.
2383 DistributionValue(std::boxed::Box<google_cloud_api::model::Distribution>),
2384 }
2385}
2386
2387/// Request to create a migration workflow resource.
2388#[derive(Clone, Default, PartialEq)]
2389#[non_exhaustive]
2390pub struct CreateMigrationWorkflowRequest {
2391 /// Required. The name of the project to which this migration workflow belongs.
2392 /// Example: `projects/foo/locations/bar`
2393 pub parent: std::string::String,
2394
2395 /// Required. The migration workflow to create.
2396 pub migration_workflow: std::option::Option<crate::model::MigrationWorkflow>,
2397
2398 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2399}
2400
2401impl CreateMigrationWorkflowRequest {
2402 /// Creates a new default instance.
2403 pub fn new() -> Self {
2404 std::default::Default::default()
2405 }
2406
2407 /// Sets the value of [parent][crate::model::CreateMigrationWorkflowRequest::parent].
2408 ///
2409 /// # Example
2410 /// ```ignore,no_run
2411 /// # use google_cloud_bigquery_migration_v2::model::CreateMigrationWorkflowRequest;
2412 /// let x = CreateMigrationWorkflowRequest::new().set_parent("example");
2413 /// ```
2414 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2415 self.parent = v.into();
2416 self
2417 }
2418
2419 /// Sets the value of [migration_workflow][crate::model::CreateMigrationWorkflowRequest::migration_workflow].
2420 ///
2421 /// # Example
2422 /// ```ignore,no_run
2423 /// # use google_cloud_bigquery_migration_v2::model::CreateMigrationWorkflowRequest;
2424 /// use google_cloud_bigquery_migration_v2::model::MigrationWorkflow;
2425 /// let x = CreateMigrationWorkflowRequest::new().set_migration_workflow(MigrationWorkflow::default()/* use setters */);
2426 /// ```
2427 pub fn set_migration_workflow<T>(mut self, v: T) -> Self
2428 where
2429 T: std::convert::Into<crate::model::MigrationWorkflow>,
2430 {
2431 self.migration_workflow = std::option::Option::Some(v.into());
2432 self
2433 }
2434
2435 /// Sets or clears the value of [migration_workflow][crate::model::CreateMigrationWorkflowRequest::migration_workflow].
2436 ///
2437 /// # Example
2438 /// ```ignore,no_run
2439 /// # use google_cloud_bigquery_migration_v2::model::CreateMigrationWorkflowRequest;
2440 /// use google_cloud_bigquery_migration_v2::model::MigrationWorkflow;
2441 /// let x = CreateMigrationWorkflowRequest::new().set_or_clear_migration_workflow(Some(MigrationWorkflow::default()/* use setters */));
2442 /// let x = CreateMigrationWorkflowRequest::new().set_or_clear_migration_workflow(None::<MigrationWorkflow>);
2443 /// ```
2444 pub fn set_or_clear_migration_workflow<T>(mut self, v: std::option::Option<T>) -> Self
2445 where
2446 T: std::convert::Into<crate::model::MigrationWorkflow>,
2447 {
2448 self.migration_workflow = v.map(|x| x.into());
2449 self
2450 }
2451}
2452
2453impl wkt::message::Message for CreateMigrationWorkflowRequest {
2454 fn typename() -> &'static str {
2455 "type.googleapis.com/google.cloud.bigquery.migration.v2.CreateMigrationWorkflowRequest"
2456 }
2457}
2458
2459/// A request to get a previously created migration workflow.
2460#[derive(Clone, Default, PartialEq)]
2461#[non_exhaustive]
2462pub struct GetMigrationWorkflowRequest {
2463 /// Required. The unique identifier for the migration workflow.
2464 /// Example: `projects/123/locations/us/workflows/1234`
2465 pub name: std::string::String,
2466
2467 /// The list of fields to be retrieved.
2468 pub read_mask: std::option::Option<wkt::FieldMask>,
2469
2470 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2471}
2472
2473impl GetMigrationWorkflowRequest {
2474 /// Creates a new default instance.
2475 pub fn new() -> Self {
2476 std::default::Default::default()
2477 }
2478
2479 /// Sets the value of [name][crate::model::GetMigrationWorkflowRequest::name].
2480 ///
2481 /// # Example
2482 /// ```ignore,no_run
2483 /// # use google_cloud_bigquery_migration_v2::model::GetMigrationWorkflowRequest;
2484 /// let x = GetMigrationWorkflowRequest::new().set_name("example");
2485 /// ```
2486 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2487 self.name = v.into();
2488 self
2489 }
2490
2491 /// Sets the value of [read_mask][crate::model::GetMigrationWorkflowRequest::read_mask].
2492 ///
2493 /// # Example
2494 /// ```ignore,no_run
2495 /// # use google_cloud_bigquery_migration_v2::model::GetMigrationWorkflowRequest;
2496 /// use wkt::FieldMask;
2497 /// let x = GetMigrationWorkflowRequest::new().set_read_mask(FieldMask::default()/* use setters */);
2498 /// ```
2499 pub fn set_read_mask<T>(mut self, v: T) -> Self
2500 where
2501 T: std::convert::Into<wkt::FieldMask>,
2502 {
2503 self.read_mask = std::option::Option::Some(v.into());
2504 self
2505 }
2506
2507 /// Sets or clears the value of [read_mask][crate::model::GetMigrationWorkflowRequest::read_mask].
2508 ///
2509 /// # Example
2510 /// ```ignore,no_run
2511 /// # use google_cloud_bigquery_migration_v2::model::GetMigrationWorkflowRequest;
2512 /// use wkt::FieldMask;
2513 /// let x = GetMigrationWorkflowRequest::new().set_or_clear_read_mask(Some(FieldMask::default()/* use setters */));
2514 /// let x = GetMigrationWorkflowRequest::new().set_or_clear_read_mask(None::<FieldMask>);
2515 /// ```
2516 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
2517 where
2518 T: std::convert::Into<wkt::FieldMask>,
2519 {
2520 self.read_mask = v.map(|x| x.into());
2521 self
2522 }
2523}
2524
2525impl wkt::message::Message for GetMigrationWorkflowRequest {
2526 fn typename() -> &'static str {
2527 "type.googleapis.com/google.cloud.bigquery.migration.v2.GetMigrationWorkflowRequest"
2528 }
2529}
2530
2531/// A request to list previously created migration workflows.
2532#[derive(Clone, Default, PartialEq)]
2533#[non_exhaustive]
2534pub struct ListMigrationWorkflowsRequest {
2535 /// Required. The project and location of the migration workflows to list.
2536 /// Example: `projects/123/locations/us`
2537 pub parent: std::string::String,
2538
2539 /// The list of fields to be retrieved.
2540 pub read_mask: std::option::Option<wkt::FieldMask>,
2541
2542 /// The maximum number of migration workflows to return. The service may return
2543 /// fewer than this number.
2544 pub page_size: i32,
2545
2546 /// A page token, received from previous `ListMigrationWorkflows` call.
2547 /// Provide this to retrieve the subsequent page.
2548 ///
2549 /// When paginating, all other parameters provided to `ListMigrationWorkflows`
2550 /// must match the call that provided the page token.
2551 pub page_token: std::string::String,
2552
2553 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2554}
2555
2556impl ListMigrationWorkflowsRequest {
2557 /// Creates a new default instance.
2558 pub fn new() -> Self {
2559 std::default::Default::default()
2560 }
2561
2562 /// Sets the value of [parent][crate::model::ListMigrationWorkflowsRequest::parent].
2563 ///
2564 /// # Example
2565 /// ```ignore,no_run
2566 /// # use google_cloud_bigquery_migration_v2::model::ListMigrationWorkflowsRequest;
2567 /// let x = ListMigrationWorkflowsRequest::new().set_parent("example");
2568 /// ```
2569 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2570 self.parent = v.into();
2571 self
2572 }
2573
2574 /// Sets the value of [read_mask][crate::model::ListMigrationWorkflowsRequest::read_mask].
2575 ///
2576 /// # Example
2577 /// ```ignore,no_run
2578 /// # use google_cloud_bigquery_migration_v2::model::ListMigrationWorkflowsRequest;
2579 /// use wkt::FieldMask;
2580 /// let x = ListMigrationWorkflowsRequest::new().set_read_mask(FieldMask::default()/* use setters */);
2581 /// ```
2582 pub fn set_read_mask<T>(mut self, v: T) -> Self
2583 where
2584 T: std::convert::Into<wkt::FieldMask>,
2585 {
2586 self.read_mask = std::option::Option::Some(v.into());
2587 self
2588 }
2589
2590 /// Sets or clears the value of [read_mask][crate::model::ListMigrationWorkflowsRequest::read_mask].
2591 ///
2592 /// # Example
2593 /// ```ignore,no_run
2594 /// # use google_cloud_bigquery_migration_v2::model::ListMigrationWorkflowsRequest;
2595 /// use wkt::FieldMask;
2596 /// let x = ListMigrationWorkflowsRequest::new().set_or_clear_read_mask(Some(FieldMask::default()/* use setters */));
2597 /// let x = ListMigrationWorkflowsRequest::new().set_or_clear_read_mask(None::<FieldMask>);
2598 /// ```
2599 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
2600 where
2601 T: std::convert::Into<wkt::FieldMask>,
2602 {
2603 self.read_mask = v.map(|x| x.into());
2604 self
2605 }
2606
2607 /// Sets the value of [page_size][crate::model::ListMigrationWorkflowsRequest::page_size].
2608 ///
2609 /// # Example
2610 /// ```ignore,no_run
2611 /// # use google_cloud_bigquery_migration_v2::model::ListMigrationWorkflowsRequest;
2612 /// let x = ListMigrationWorkflowsRequest::new().set_page_size(42);
2613 /// ```
2614 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2615 self.page_size = v.into();
2616 self
2617 }
2618
2619 /// Sets the value of [page_token][crate::model::ListMigrationWorkflowsRequest::page_token].
2620 ///
2621 /// # Example
2622 /// ```ignore,no_run
2623 /// # use google_cloud_bigquery_migration_v2::model::ListMigrationWorkflowsRequest;
2624 /// let x = ListMigrationWorkflowsRequest::new().set_page_token("example");
2625 /// ```
2626 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2627 self.page_token = v.into();
2628 self
2629 }
2630}
2631
2632impl wkt::message::Message for ListMigrationWorkflowsRequest {
2633 fn typename() -> &'static str {
2634 "type.googleapis.com/google.cloud.bigquery.migration.v2.ListMigrationWorkflowsRequest"
2635 }
2636}
2637
2638/// Response object for a `ListMigrationWorkflows` call.
2639#[derive(Clone, Default, PartialEq)]
2640#[non_exhaustive]
2641pub struct ListMigrationWorkflowsResponse {
2642 /// The migration workflows for the specified project / location.
2643 pub migration_workflows: std::vec::Vec<crate::model::MigrationWorkflow>,
2644
2645 /// A token, which can be sent as `page_token` to retrieve the next page.
2646 /// If this field is omitted, there are no subsequent pages.
2647 pub next_page_token: std::string::String,
2648
2649 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2650}
2651
2652impl ListMigrationWorkflowsResponse {
2653 /// Creates a new default instance.
2654 pub fn new() -> Self {
2655 std::default::Default::default()
2656 }
2657
2658 /// Sets the value of [migration_workflows][crate::model::ListMigrationWorkflowsResponse::migration_workflows].
2659 ///
2660 /// # Example
2661 /// ```ignore,no_run
2662 /// # use google_cloud_bigquery_migration_v2::model::ListMigrationWorkflowsResponse;
2663 /// use google_cloud_bigquery_migration_v2::model::MigrationWorkflow;
2664 /// let x = ListMigrationWorkflowsResponse::new()
2665 /// .set_migration_workflows([
2666 /// MigrationWorkflow::default()/* use setters */,
2667 /// MigrationWorkflow::default()/* use (different) setters */,
2668 /// ]);
2669 /// ```
2670 pub fn set_migration_workflows<T, V>(mut self, v: T) -> Self
2671 where
2672 T: std::iter::IntoIterator<Item = V>,
2673 V: std::convert::Into<crate::model::MigrationWorkflow>,
2674 {
2675 use std::iter::Iterator;
2676 self.migration_workflows = v.into_iter().map(|i| i.into()).collect();
2677 self
2678 }
2679
2680 /// Sets the value of [next_page_token][crate::model::ListMigrationWorkflowsResponse::next_page_token].
2681 ///
2682 /// # Example
2683 /// ```ignore,no_run
2684 /// # use google_cloud_bigquery_migration_v2::model::ListMigrationWorkflowsResponse;
2685 /// let x = ListMigrationWorkflowsResponse::new().set_next_page_token("example");
2686 /// ```
2687 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2688 self.next_page_token = v.into();
2689 self
2690 }
2691}
2692
2693impl wkt::message::Message for ListMigrationWorkflowsResponse {
2694 fn typename() -> &'static str {
2695 "type.googleapis.com/google.cloud.bigquery.migration.v2.ListMigrationWorkflowsResponse"
2696 }
2697}
2698
2699#[doc(hidden)]
2700impl google_cloud_gax::paginator::internal::PageableResponse for ListMigrationWorkflowsResponse {
2701 type PageItem = crate::model::MigrationWorkflow;
2702
2703 fn items(self) -> std::vec::Vec<Self::PageItem> {
2704 self.migration_workflows
2705 }
2706
2707 fn next_page_token(&self) -> std::string::String {
2708 use std::clone::Clone;
2709 self.next_page_token.clone()
2710 }
2711}
2712
2713/// A request to delete a previously created migration workflow.
2714#[derive(Clone, Default, PartialEq)]
2715#[non_exhaustive]
2716pub struct DeleteMigrationWorkflowRequest {
2717 /// Required. The unique identifier for the migration workflow.
2718 /// Example: `projects/123/locations/us/workflows/1234`
2719 pub name: std::string::String,
2720
2721 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2722}
2723
2724impl DeleteMigrationWorkflowRequest {
2725 /// Creates a new default instance.
2726 pub fn new() -> Self {
2727 std::default::Default::default()
2728 }
2729
2730 /// Sets the value of [name][crate::model::DeleteMigrationWorkflowRequest::name].
2731 ///
2732 /// # Example
2733 /// ```ignore,no_run
2734 /// # use google_cloud_bigquery_migration_v2::model::DeleteMigrationWorkflowRequest;
2735 /// let x = DeleteMigrationWorkflowRequest::new().set_name("example");
2736 /// ```
2737 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2738 self.name = v.into();
2739 self
2740 }
2741}
2742
2743impl wkt::message::Message for DeleteMigrationWorkflowRequest {
2744 fn typename() -> &'static str {
2745 "type.googleapis.com/google.cloud.bigquery.migration.v2.DeleteMigrationWorkflowRequest"
2746 }
2747}
2748
2749/// A request to start a previously created migration workflow.
2750#[derive(Clone, Default, PartialEq)]
2751#[non_exhaustive]
2752pub struct StartMigrationWorkflowRequest {
2753 /// Required. The unique identifier for the migration workflow.
2754 /// Example: `projects/123/locations/us/workflows/1234`
2755 pub name: std::string::String,
2756
2757 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2758}
2759
2760impl StartMigrationWorkflowRequest {
2761 /// Creates a new default instance.
2762 pub fn new() -> Self {
2763 std::default::Default::default()
2764 }
2765
2766 /// Sets the value of [name][crate::model::StartMigrationWorkflowRequest::name].
2767 ///
2768 /// # Example
2769 /// ```ignore,no_run
2770 /// # use google_cloud_bigquery_migration_v2::model::StartMigrationWorkflowRequest;
2771 /// let x = StartMigrationWorkflowRequest::new().set_name("example");
2772 /// ```
2773 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2774 self.name = v.into();
2775 self
2776 }
2777}
2778
2779impl wkt::message::Message for StartMigrationWorkflowRequest {
2780 fn typename() -> &'static str {
2781 "type.googleapis.com/google.cloud.bigquery.migration.v2.StartMigrationWorkflowRequest"
2782 }
2783}
2784
2785/// A request to get a previously created migration subtasks.
2786#[derive(Clone, Default, PartialEq)]
2787#[non_exhaustive]
2788pub struct GetMigrationSubtaskRequest {
2789 /// Required. The unique identifier for the migration subtask.
2790 /// Example: `projects/123/locations/us/workflows/1234/subtasks/543`
2791 pub name: std::string::String,
2792
2793 /// Optional. The list of fields to be retrieved.
2794 pub read_mask: std::option::Option<wkt::FieldMask>,
2795
2796 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2797}
2798
2799impl GetMigrationSubtaskRequest {
2800 /// Creates a new default instance.
2801 pub fn new() -> Self {
2802 std::default::Default::default()
2803 }
2804
2805 /// Sets the value of [name][crate::model::GetMigrationSubtaskRequest::name].
2806 ///
2807 /// # Example
2808 /// ```ignore,no_run
2809 /// # use google_cloud_bigquery_migration_v2::model::GetMigrationSubtaskRequest;
2810 /// let x = GetMigrationSubtaskRequest::new().set_name("example");
2811 /// ```
2812 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2813 self.name = v.into();
2814 self
2815 }
2816
2817 /// Sets the value of [read_mask][crate::model::GetMigrationSubtaskRequest::read_mask].
2818 ///
2819 /// # Example
2820 /// ```ignore,no_run
2821 /// # use google_cloud_bigquery_migration_v2::model::GetMigrationSubtaskRequest;
2822 /// use wkt::FieldMask;
2823 /// let x = GetMigrationSubtaskRequest::new().set_read_mask(FieldMask::default()/* use setters */);
2824 /// ```
2825 pub fn set_read_mask<T>(mut self, v: T) -> Self
2826 where
2827 T: std::convert::Into<wkt::FieldMask>,
2828 {
2829 self.read_mask = std::option::Option::Some(v.into());
2830 self
2831 }
2832
2833 /// Sets or clears the value of [read_mask][crate::model::GetMigrationSubtaskRequest::read_mask].
2834 ///
2835 /// # Example
2836 /// ```ignore,no_run
2837 /// # use google_cloud_bigquery_migration_v2::model::GetMigrationSubtaskRequest;
2838 /// use wkt::FieldMask;
2839 /// let x = GetMigrationSubtaskRequest::new().set_or_clear_read_mask(Some(FieldMask::default()/* use setters */));
2840 /// let x = GetMigrationSubtaskRequest::new().set_or_clear_read_mask(None::<FieldMask>);
2841 /// ```
2842 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
2843 where
2844 T: std::convert::Into<wkt::FieldMask>,
2845 {
2846 self.read_mask = v.map(|x| x.into());
2847 self
2848 }
2849}
2850
2851impl wkt::message::Message for GetMigrationSubtaskRequest {
2852 fn typename() -> &'static str {
2853 "type.googleapis.com/google.cloud.bigquery.migration.v2.GetMigrationSubtaskRequest"
2854 }
2855}
2856
2857/// A request to list previously created migration subtasks.
2858#[derive(Clone, Default, PartialEq)]
2859#[non_exhaustive]
2860pub struct ListMigrationSubtasksRequest {
2861 /// Required. The migration task of the subtasks to list.
2862 /// Example: `projects/123/locations/us/workflows/1234`
2863 pub parent: std::string::String,
2864
2865 /// Optional. The list of fields to be retrieved.
2866 pub read_mask: std::option::Option<wkt::FieldMask>,
2867
2868 /// Optional. The maximum number of migration tasks to return. The service may
2869 /// return fewer than this number.
2870 pub page_size: i32,
2871
2872 /// Optional. A page token, received from previous `ListMigrationSubtasks`
2873 /// call. Provide this to retrieve the subsequent page.
2874 ///
2875 /// When paginating, all other parameters provided to `ListMigrationSubtasks`
2876 /// must match the call that provided the page token.
2877 pub page_token: std::string::String,
2878
2879 /// Optional. The filter to apply. This can be used to get the subtasks of a
2880 /// specific tasks in a workflow, e.g. `migration_task = "ab012"` where
2881 /// `"ab012"` is the task ID (not the name in the named map).
2882 pub filter: std::string::String,
2883
2884 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2885}
2886
2887impl ListMigrationSubtasksRequest {
2888 /// Creates a new default instance.
2889 pub fn new() -> Self {
2890 std::default::Default::default()
2891 }
2892
2893 /// Sets the value of [parent][crate::model::ListMigrationSubtasksRequest::parent].
2894 ///
2895 /// # Example
2896 /// ```ignore,no_run
2897 /// # use google_cloud_bigquery_migration_v2::model::ListMigrationSubtasksRequest;
2898 /// let x = ListMigrationSubtasksRequest::new().set_parent("example");
2899 /// ```
2900 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2901 self.parent = v.into();
2902 self
2903 }
2904
2905 /// Sets the value of [read_mask][crate::model::ListMigrationSubtasksRequest::read_mask].
2906 ///
2907 /// # Example
2908 /// ```ignore,no_run
2909 /// # use google_cloud_bigquery_migration_v2::model::ListMigrationSubtasksRequest;
2910 /// use wkt::FieldMask;
2911 /// let x = ListMigrationSubtasksRequest::new().set_read_mask(FieldMask::default()/* use setters */);
2912 /// ```
2913 pub fn set_read_mask<T>(mut self, v: T) -> Self
2914 where
2915 T: std::convert::Into<wkt::FieldMask>,
2916 {
2917 self.read_mask = std::option::Option::Some(v.into());
2918 self
2919 }
2920
2921 /// Sets or clears the value of [read_mask][crate::model::ListMigrationSubtasksRequest::read_mask].
2922 ///
2923 /// # Example
2924 /// ```ignore,no_run
2925 /// # use google_cloud_bigquery_migration_v2::model::ListMigrationSubtasksRequest;
2926 /// use wkt::FieldMask;
2927 /// let x = ListMigrationSubtasksRequest::new().set_or_clear_read_mask(Some(FieldMask::default()/* use setters */));
2928 /// let x = ListMigrationSubtasksRequest::new().set_or_clear_read_mask(None::<FieldMask>);
2929 /// ```
2930 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
2931 where
2932 T: std::convert::Into<wkt::FieldMask>,
2933 {
2934 self.read_mask = v.map(|x| x.into());
2935 self
2936 }
2937
2938 /// Sets the value of [page_size][crate::model::ListMigrationSubtasksRequest::page_size].
2939 ///
2940 /// # Example
2941 /// ```ignore,no_run
2942 /// # use google_cloud_bigquery_migration_v2::model::ListMigrationSubtasksRequest;
2943 /// let x = ListMigrationSubtasksRequest::new().set_page_size(42);
2944 /// ```
2945 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2946 self.page_size = v.into();
2947 self
2948 }
2949
2950 /// Sets the value of [page_token][crate::model::ListMigrationSubtasksRequest::page_token].
2951 ///
2952 /// # Example
2953 /// ```ignore,no_run
2954 /// # use google_cloud_bigquery_migration_v2::model::ListMigrationSubtasksRequest;
2955 /// let x = ListMigrationSubtasksRequest::new().set_page_token("example");
2956 /// ```
2957 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2958 self.page_token = v.into();
2959 self
2960 }
2961
2962 /// Sets the value of [filter][crate::model::ListMigrationSubtasksRequest::filter].
2963 ///
2964 /// # Example
2965 /// ```ignore,no_run
2966 /// # use google_cloud_bigquery_migration_v2::model::ListMigrationSubtasksRequest;
2967 /// let x = ListMigrationSubtasksRequest::new().set_filter("example");
2968 /// ```
2969 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2970 self.filter = v.into();
2971 self
2972 }
2973}
2974
2975impl wkt::message::Message for ListMigrationSubtasksRequest {
2976 fn typename() -> &'static str {
2977 "type.googleapis.com/google.cloud.bigquery.migration.v2.ListMigrationSubtasksRequest"
2978 }
2979}
2980
2981/// Response object for a `ListMigrationSubtasks` call.
2982#[derive(Clone, Default, PartialEq)]
2983#[non_exhaustive]
2984pub struct ListMigrationSubtasksResponse {
2985 /// The migration subtasks for the specified task.
2986 pub migration_subtasks: std::vec::Vec<crate::model::MigrationSubtask>,
2987
2988 /// A token, which can be sent as `page_token` to retrieve the next page.
2989 /// If this field is omitted, there are no subsequent pages.
2990 pub next_page_token: std::string::String,
2991
2992 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2993}
2994
2995impl ListMigrationSubtasksResponse {
2996 /// Creates a new default instance.
2997 pub fn new() -> Self {
2998 std::default::Default::default()
2999 }
3000
3001 /// Sets the value of [migration_subtasks][crate::model::ListMigrationSubtasksResponse::migration_subtasks].
3002 ///
3003 /// # Example
3004 /// ```ignore,no_run
3005 /// # use google_cloud_bigquery_migration_v2::model::ListMigrationSubtasksResponse;
3006 /// use google_cloud_bigquery_migration_v2::model::MigrationSubtask;
3007 /// let x = ListMigrationSubtasksResponse::new()
3008 /// .set_migration_subtasks([
3009 /// MigrationSubtask::default()/* use setters */,
3010 /// MigrationSubtask::default()/* use (different) setters */,
3011 /// ]);
3012 /// ```
3013 pub fn set_migration_subtasks<T, V>(mut self, v: T) -> Self
3014 where
3015 T: std::iter::IntoIterator<Item = V>,
3016 V: std::convert::Into<crate::model::MigrationSubtask>,
3017 {
3018 use std::iter::Iterator;
3019 self.migration_subtasks = v.into_iter().map(|i| i.into()).collect();
3020 self
3021 }
3022
3023 /// Sets the value of [next_page_token][crate::model::ListMigrationSubtasksResponse::next_page_token].
3024 ///
3025 /// # Example
3026 /// ```ignore,no_run
3027 /// # use google_cloud_bigquery_migration_v2::model::ListMigrationSubtasksResponse;
3028 /// let x = ListMigrationSubtasksResponse::new().set_next_page_token("example");
3029 /// ```
3030 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3031 self.next_page_token = v.into();
3032 self
3033 }
3034}
3035
3036impl wkt::message::Message for ListMigrationSubtasksResponse {
3037 fn typename() -> &'static str {
3038 "type.googleapis.com/google.cloud.bigquery.migration.v2.ListMigrationSubtasksResponse"
3039 }
3040}
3041
3042#[doc(hidden)]
3043impl google_cloud_gax::paginator::internal::PageableResponse for ListMigrationSubtasksResponse {
3044 type PageItem = crate::model::MigrationSubtask;
3045
3046 fn items(self) -> std::vec::Vec<Self::PageItem> {
3047 self.migration_subtasks
3048 }
3049
3050 fn next_page_token(&self) -> std::string::String {
3051 use std::clone::Clone;
3052 self.next_page_token.clone()
3053 }
3054}
3055
3056/// The translation config to capture necessary settings for a translation task
3057/// and subtask.
3058#[derive(Clone, Default, PartialEq)]
3059#[non_exhaustive]
3060pub struct TranslationConfigDetails {
3061 /// The dialect of the input files.
3062 pub source_dialect: std::option::Option<crate::model::Dialect>,
3063
3064 /// The target dialect for the engine to translate the input to.
3065 pub target_dialect: std::option::Option<crate::model::Dialect>,
3066
3067 /// The default source environment values for the translation.
3068 pub source_env: std::option::Option<crate::model::SourceEnv>,
3069
3070 /// The indicator to show translation request initiator.
3071 pub request_source: std::string::String,
3072
3073 /// The types of output to generate, e.g. sql, metadata etc. If not specified,
3074 /// a default set of targets will be generated. Some additional target types
3075 /// may be slower to generate. See the documentation for the set of available
3076 /// target types.
3077 pub target_types: std::vec::Vec<std::string::String>,
3078
3079 /// The chosen path where the source for input files will be found.
3080 pub source_location:
3081 std::option::Option<crate::model::translation_config_details::SourceLocation>,
3082
3083 /// The chosen path where the destination for output files will be found.
3084 pub target_location:
3085 std::option::Option<crate::model::translation_config_details::TargetLocation>,
3086
3087 /// The mapping of full SQL object names from their current state to the
3088 /// desired output.
3089 pub output_name_mapping:
3090 std::option::Option<crate::model::translation_config_details::OutputNameMapping>,
3091
3092 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3093}
3094
3095impl TranslationConfigDetails {
3096 /// Creates a new default instance.
3097 pub fn new() -> Self {
3098 std::default::Default::default()
3099 }
3100
3101 /// Sets the value of [source_dialect][crate::model::TranslationConfigDetails::source_dialect].
3102 ///
3103 /// # Example
3104 /// ```ignore,no_run
3105 /// # use google_cloud_bigquery_migration_v2::model::TranslationConfigDetails;
3106 /// use google_cloud_bigquery_migration_v2::model::Dialect;
3107 /// let x = TranslationConfigDetails::new().set_source_dialect(Dialect::default()/* use setters */);
3108 /// ```
3109 pub fn set_source_dialect<T>(mut self, v: T) -> Self
3110 where
3111 T: std::convert::Into<crate::model::Dialect>,
3112 {
3113 self.source_dialect = std::option::Option::Some(v.into());
3114 self
3115 }
3116
3117 /// Sets or clears the value of [source_dialect][crate::model::TranslationConfigDetails::source_dialect].
3118 ///
3119 /// # Example
3120 /// ```ignore,no_run
3121 /// # use google_cloud_bigquery_migration_v2::model::TranslationConfigDetails;
3122 /// use google_cloud_bigquery_migration_v2::model::Dialect;
3123 /// let x = TranslationConfigDetails::new().set_or_clear_source_dialect(Some(Dialect::default()/* use setters */));
3124 /// let x = TranslationConfigDetails::new().set_or_clear_source_dialect(None::<Dialect>);
3125 /// ```
3126 pub fn set_or_clear_source_dialect<T>(mut self, v: std::option::Option<T>) -> Self
3127 where
3128 T: std::convert::Into<crate::model::Dialect>,
3129 {
3130 self.source_dialect = v.map(|x| x.into());
3131 self
3132 }
3133
3134 /// Sets the value of [target_dialect][crate::model::TranslationConfigDetails::target_dialect].
3135 ///
3136 /// # Example
3137 /// ```ignore,no_run
3138 /// # use google_cloud_bigquery_migration_v2::model::TranslationConfigDetails;
3139 /// use google_cloud_bigquery_migration_v2::model::Dialect;
3140 /// let x = TranslationConfigDetails::new().set_target_dialect(Dialect::default()/* use setters */);
3141 /// ```
3142 pub fn set_target_dialect<T>(mut self, v: T) -> Self
3143 where
3144 T: std::convert::Into<crate::model::Dialect>,
3145 {
3146 self.target_dialect = std::option::Option::Some(v.into());
3147 self
3148 }
3149
3150 /// Sets or clears the value of [target_dialect][crate::model::TranslationConfigDetails::target_dialect].
3151 ///
3152 /// # Example
3153 /// ```ignore,no_run
3154 /// # use google_cloud_bigquery_migration_v2::model::TranslationConfigDetails;
3155 /// use google_cloud_bigquery_migration_v2::model::Dialect;
3156 /// let x = TranslationConfigDetails::new().set_or_clear_target_dialect(Some(Dialect::default()/* use setters */));
3157 /// let x = TranslationConfigDetails::new().set_or_clear_target_dialect(None::<Dialect>);
3158 /// ```
3159 pub fn set_or_clear_target_dialect<T>(mut self, v: std::option::Option<T>) -> Self
3160 where
3161 T: std::convert::Into<crate::model::Dialect>,
3162 {
3163 self.target_dialect = v.map(|x| x.into());
3164 self
3165 }
3166
3167 /// Sets the value of [source_env][crate::model::TranslationConfigDetails::source_env].
3168 ///
3169 /// # Example
3170 /// ```ignore,no_run
3171 /// # use google_cloud_bigquery_migration_v2::model::TranslationConfigDetails;
3172 /// use google_cloud_bigquery_migration_v2::model::SourceEnv;
3173 /// let x = TranslationConfigDetails::new().set_source_env(SourceEnv::default()/* use setters */);
3174 /// ```
3175 pub fn set_source_env<T>(mut self, v: T) -> Self
3176 where
3177 T: std::convert::Into<crate::model::SourceEnv>,
3178 {
3179 self.source_env = std::option::Option::Some(v.into());
3180 self
3181 }
3182
3183 /// Sets or clears the value of [source_env][crate::model::TranslationConfigDetails::source_env].
3184 ///
3185 /// # Example
3186 /// ```ignore,no_run
3187 /// # use google_cloud_bigquery_migration_v2::model::TranslationConfigDetails;
3188 /// use google_cloud_bigquery_migration_v2::model::SourceEnv;
3189 /// let x = TranslationConfigDetails::new().set_or_clear_source_env(Some(SourceEnv::default()/* use setters */));
3190 /// let x = TranslationConfigDetails::new().set_or_clear_source_env(None::<SourceEnv>);
3191 /// ```
3192 pub fn set_or_clear_source_env<T>(mut self, v: std::option::Option<T>) -> Self
3193 where
3194 T: std::convert::Into<crate::model::SourceEnv>,
3195 {
3196 self.source_env = v.map(|x| x.into());
3197 self
3198 }
3199
3200 /// Sets the value of [request_source][crate::model::TranslationConfigDetails::request_source].
3201 ///
3202 /// # Example
3203 /// ```ignore,no_run
3204 /// # use google_cloud_bigquery_migration_v2::model::TranslationConfigDetails;
3205 /// let x = TranslationConfigDetails::new().set_request_source("example");
3206 /// ```
3207 pub fn set_request_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3208 self.request_source = v.into();
3209 self
3210 }
3211
3212 /// Sets the value of [target_types][crate::model::TranslationConfigDetails::target_types].
3213 ///
3214 /// # Example
3215 /// ```ignore,no_run
3216 /// # use google_cloud_bigquery_migration_v2::model::TranslationConfigDetails;
3217 /// let x = TranslationConfigDetails::new().set_target_types(["a", "b", "c"]);
3218 /// ```
3219 pub fn set_target_types<T, V>(mut self, v: T) -> Self
3220 where
3221 T: std::iter::IntoIterator<Item = V>,
3222 V: std::convert::Into<std::string::String>,
3223 {
3224 use std::iter::Iterator;
3225 self.target_types = v.into_iter().map(|i| i.into()).collect();
3226 self
3227 }
3228
3229 /// Sets the value of [source_location][crate::model::TranslationConfigDetails::source_location].
3230 ///
3231 /// Note that all the setters affecting `source_location` are mutually
3232 /// exclusive.
3233 ///
3234 /// # Example
3235 /// ```ignore,no_run
3236 /// # use google_cloud_bigquery_migration_v2::model::TranslationConfigDetails;
3237 /// use google_cloud_bigquery_migration_v2::model::translation_config_details::SourceLocation;
3238 /// let x = TranslationConfigDetails::new().set_source_location(Some(SourceLocation::GcsSourcePath("example".to_string())));
3239 /// ```
3240 pub fn set_source_location<
3241 T: std::convert::Into<
3242 std::option::Option<crate::model::translation_config_details::SourceLocation>,
3243 >,
3244 >(
3245 mut self,
3246 v: T,
3247 ) -> Self {
3248 self.source_location = v.into();
3249 self
3250 }
3251
3252 /// The value of [source_location][crate::model::TranslationConfigDetails::source_location]
3253 /// if it holds a `GcsSourcePath`, `None` if the field is not set or
3254 /// holds a different branch.
3255 pub fn gcs_source_path(&self) -> std::option::Option<&std::string::String> {
3256 #[allow(unreachable_patterns)]
3257 self.source_location.as_ref().and_then(|v| match v {
3258 crate::model::translation_config_details::SourceLocation::GcsSourcePath(v) => {
3259 std::option::Option::Some(v)
3260 }
3261 _ => std::option::Option::None,
3262 })
3263 }
3264
3265 /// Sets the value of [source_location][crate::model::TranslationConfigDetails::source_location]
3266 /// to hold a `GcsSourcePath`.
3267 ///
3268 /// Note that all the setters affecting `source_location` are
3269 /// mutually exclusive.
3270 ///
3271 /// # Example
3272 /// ```ignore,no_run
3273 /// # use google_cloud_bigquery_migration_v2::model::TranslationConfigDetails;
3274 /// let x = TranslationConfigDetails::new().set_gcs_source_path("example");
3275 /// assert!(x.gcs_source_path().is_some());
3276 /// ```
3277 pub fn set_gcs_source_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3278 self.source_location = std::option::Option::Some(
3279 crate::model::translation_config_details::SourceLocation::GcsSourcePath(v.into()),
3280 );
3281 self
3282 }
3283
3284 /// Sets the value of [target_location][crate::model::TranslationConfigDetails::target_location].
3285 ///
3286 /// Note that all the setters affecting `target_location` are mutually
3287 /// exclusive.
3288 ///
3289 /// # Example
3290 /// ```ignore,no_run
3291 /// # use google_cloud_bigquery_migration_v2::model::TranslationConfigDetails;
3292 /// use google_cloud_bigquery_migration_v2::model::translation_config_details::TargetLocation;
3293 /// let x = TranslationConfigDetails::new().set_target_location(Some(TargetLocation::GcsTargetPath("example".to_string())));
3294 /// ```
3295 pub fn set_target_location<
3296 T: std::convert::Into<
3297 std::option::Option<crate::model::translation_config_details::TargetLocation>,
3298 >,
3299 >(
3300 mut self,
3301 v: T,
3302 ) -> Self {
3303 self.target_location = v.into();
3304 self
3305 }
3306
3307 /// The value of [target_location][crate::model::TranslationConfigDetails::target_location]
3308 /// if it holds a `GcsTargetPath`, `None` if the field is not set or
3309 /// holds a different branch.
3310 pub fn gcs_target_path(&self) -> std::option::Option<&std::string::String> {
3311 #[allow(unreachable_patterns)]
3312 self.target_location.as_ref().and_then(|v| match v {
3313 crate::model::translation_config_details::TargetLocation::GcsTargetPath(v) => {
3314 std::option::Option::Some(v)
3315 }
3316 _ => std::option::Option::None,
3317 })
3318 }
3319
3320 /// Sets the value of [target_location][crate::model::TranslationConfigDetails::target_location]
3321 /// to hold a `GcsTargetPath`.
3322 ///
3323 /// Note that all the setters affecting `target_location` are
3324 /// mutually exclusive.
3325 ///
3326 /// # Example
3327 /// ```ignore,no_run
3328 /// # use google_cloud_bigquery_migration_v2::model::TranslationConfigDetails;
3329 /// let x = TranslationConfigDetails::new().set_gcs_target_path("example");
3330 /// assert!(x.gcs_target_path().is_some());
3331 /// ```
3332 pub fn set_gcs_target_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3333 self.target_location = std::option::Option::Some(
3334 crate::model::translation_config_details::TargetLocation::GcsTargetPath(v.into()),
3335 );
3336 self
3337 }
3338
3339 /// Sets the value of [output_name_mapping][crate::model::TranslationConfigDetails::output_name_mapping].
3340 ///
3341 /// Note that all the setters affecting `output_name_mapping` are mutually
3342 /// exclusive.
3343 ///
3344 /// # Example
3345 /// ```ignore,no_run
3346 /// # use google_cloud_bigquery_migration_v2::model::TranslationConfigDetails;
3347 /// use google_cloud_bigquery_migration_v2::model::ObjectNameMappingList;
3348 /// let x = TranslationConfigDetails::new().set_output_name_mapping(Some(
3349 /// google_cloud_bigquery_migration_v2::model::translation_config_details::OutputNameMapping::NameMappingList(ObjectNameMappingList::default().into())));
3350 /// ```
3351 pub fn set_output_name_mapping<
3352 T: std::convert::Into<
3353 std::option::Option<crate::model::translation_config_details::OutputNameMapping>,
3354 >,
3355 >(
3356 mut self,
3357 v: T,
3358 ) -> Self {
3359 self.output_name_mapping = v.into();
3360 self
3361 }
3362
3363 /// The value of [output_name_mapping][crate::model::TranslationConfigDetails::output_name_mapping]
3364 /// if it holds a `NameMappingList`, `None` if the field is not set or
3365 /// holds a different branch.
3366 pub fn name_mapping_list(
3367 &self,
3368 ) -> std::option::Option<&std::boxed::Box<crate::model::ObjectNameMappingList>> {
3369 #[allow(unreachable_patterns)]
3370 self.output_name_mapping.as_ref().and_then(|v| match v {
3371 crate::model::translation_config_details::OutputNameMapping::NameMappingList(v) => {
3372 std::option::Option::Some(v)
3373 }
3374 _ => std::option::Option::None,
3375 })
3376 }
3377
3378 /// Sets the value of [output_name_mapping][crate::model::TranslationConfigDetails::output_name_mapping]
3379 /// to hold a `NameMappingList`.
3380 ///
3381 /// Note that all the setters affecting `output_name_mapping` are
3382 /// mutually exclusive.
3383 ///
3384 /// # Example
3385 /// ```ignore,no_run
3386 /// # use google_cloud_bigquery_migration_v2::model::TranslationConfigDetails;
3387 /// use google_cloud_bigquery_migration_v2::model::ObjectNameMappingList;
3388 /// let x = TranslationConfigDetails::new().set_name_mapping_list(ObjectNameMappingList::default()/* use setters */);
3389 /// assert!(x.name_mapping_list().is_some());
3390 /// ```
3391 pub fn set_name_mapping_list<
3392 T: std::convert::Into<std::boxed::Box<crate::model::ObjectNameMappingList>>,
3393 >(
3394 mut self,
3395 v: T,
3396 ) -> Self {
3397 self.output_name_mapping = std::option::Option::Some(
3398 crate::model::translation_config_details::OutputNameMapping::NameMappingList(v.into()),
3399 );
3400 self
3401 }
3402}
3403
3404impl wkt::message::Message for TranslationConfigDetails {
3405 fn typename() -> &'static str {
3406 "type.googleapis.com/google.cloud.bigquery.migration.v2.TranslationConfigDetails"
3407 }
3408}
3409
3410/// Defines additional types related to [TranslationConfigDetails].
3411pub mod translation_config_details {
3412 #[allow(unused_imports)]
3413 use super::*;
3414
3415 /// The chosen path where the source for input files will be found.
3416 #[derive(Clone, Debug, PartialEq)]
3417 #[non_exhaustive]
3418 pub enum SourceLocation {
3419 /// The Cloud Storage path for a directory of files to translate in a task.
3420 GcsSourcePath(std::string::String),
3421 }
3422
3423 /// The chosen path where the destination for output files will be found.
3424 #[derive(Clone, Debug, PartialEq)]
3425 #[non_exhaustive]
3426 pub enum TargetLocation {
3427 /// The Cloud Storage path to write back the corresponding input files to.
3428 GcsTargetPath(std::string::String),
3429 }
3430
3431 /// The mapping of full SQL object names from their current state to the
3432 /// desired output.
3433 #[derive(Clone, Debug, PartialEq)]
3434 #[non_exhaustive]
3435 pub enum OutputNameMapping {
3436 /// The mapping of objects to their desired output names in list form.
3437 NameMappingList(std::boxed::Box<crate::model::ObjectNameMappingList>),
3438 }
3439}
3440
3441/// The possible dialect options for translation.
3442#[derive(Clone, Default, PartialEq)]
3443#[non_exhaustive]
3444pub struct Dialect {
3445 /// The possible dialect options that this message represents.
3446 pub dialect_value: std::option::Option<crate::model::dialect::DialectValue>,
3447
3448 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3449}
3450
3451impl Dialect {
3452 /// Creates a new default instance.
3453 pub fn new() -> Self {
3454 std::default::Default::default()
3455 }
3456
3457 /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value].
3458 ///
3459 /// Note that all the setters affecting `dialect_value` are mutually
3460 /// exclusive.
3461 ///
3462 /// # Example
3463 /// ```ignore,no_run
3464 /// # use google_cloud_bigquery_migration_v2::model::Dialect;
3465 /// use google_cloud_bigquery_migration_v2::model::BigQueryDialect;
3466 /// let x = Dialect::new().set_dialect_value(Some(
3467 /// google_cloud_bigquery_migration_v2::model::dialect::DialectValue::BigqueryDialect(BigQueryDialect::default().into())));
3468 /// ```
3469 pub fn set_dialect_value<
3470 T: std::convert::Into<std::option::Option<crate::model::dialect::DialectValue>>,
3471 >(
3472 mut self,
3473 v: T,
3474 ) -> Self {
3475 self.dialect_value = v.into();
3476 self
3477 }
3478
3479 /// The value of [dialect_value][crate::model::Dialect::dialect_value]
3480 /// if it holds a `BigqueryDialect`, `None` if the field is not set or
3481 /// holds a different branch.
3482 pub fn bigquery_dialect(
3483 &self,
3484 ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryDialect>> {
3485 #[allow(unreachable_patterns)]
3486 self.dialect_value.as_ref().and_then(|v| match v {
3487 crate::model::dialect::DialectValue::BigqueryDialect(v) => std::option::Option::Some(v),
3488 _ => std::option::Option::None,
3489 })
3490 }
3491
3492 /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
3493 /// to hold a `BigqueryDialect`.
3494 ///
3495 /// Note that all the setters affecting `dialect_value` are
3496 /// mutually exclusive.
3497 ///
3498 /// # Example
3499 /// ```ignore,no_run
3500 /// # use google_cloud_bigquery_migration_v2::model::Dialect;
3501 /// use google_cloud_bigquery_migration_v2::model::BigQueryDialect;
3502 /// let x = Dialect::new().set_bigquery_dialect(BigQueryDialect::default()/* use setters */);
3503 /// assert!(x.bigquery_dialect().is_some());
3504 /// assert!(x.hiveql_dialect().is_none());
3505 /// assert!(x.redshift_dialect().is_none());
3506 /// assert!(x.teradata_dialect().is_none());
3507 /// assert!(x.oracle_dialect().is_none());
3508 /// assert!(x.sparksql_dialect().is_none());
3509 /// assert!(x.snowflake_dialect().is_none());
3510 /// assert!(x.netezza_dialect().is_none());
3511 /// assert!(x.azure_synapse_dialect().is_none());
3512 /// assert!(x.vertica_dialect().is_none());
3513 /// assert!(x.sql_server_dialect().is_none());
3514 /// assert!(x.postgresql_dialect().is_none());
3515 /// assert!(x.presto_dialect().is_none());
3516 /// assert!(x.mysql_dialect().is_none());
3517 /// assert!(x.db2_dialect().is_none());
3518 /// assert!(x.sqlite_dialect().is_none());
3519 /// assert!(x.greenplum_dialect().is_none());
3520 /// ```
3521 pub fn set_bigquery_dialect<
3522 T: std::convert::Into<std::boxed::Box<crate::model::BigQueryDialect>>,
3523 >(
3524 mut self,
3525 v: T,
3526 ) -> Self {
3527 self.dialect_value = std::option::Option::Some(
3528 crate::model::dialect::DialectValue::BigqueryDialect(v.into()),
3529 );
3530 self
3531 }
3532
3533 /// The value of [dialect_value][crate::model::Dialect::dialect_value]
3534 /// if it holds a `HiveqlDialect`, `None` if the field is not set or
3535 /// holds a different branch.
3536 pub fn hiveql_dialect(
3537 &self,
3538 ) -> std::option::Option<&std::boxed::Box<crate::model::HiveQLDialect>> {
3539 #[allow(unreachable_patterns)]
3540 self.dialect_value.as_ref().and_then(|v| match v {
3541 crate::model::dialect::DialectValue::HiveqlDialect(v) => std::option::Option::Some(v),
3542 _ => std::option::Option::None,
3543 })
3544 }
3545
3546 /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
3547 /// to hold a `HiveqlDialect`.
3548 ///
3549 /// Note that all the setters affecting `dialect_value` are
3550 /// mutually exclusive.
3551 ///
3552 /// # Example
3553 /// ```ignore,no_run
3554 /// # use google_cloud_bigquery_migration_v2::model::Dialect;
3555 /// use google_cloud_bigquery_migration_v2::model::HiveQLDialect;
3556 /// let x = Dialect::new().set_hiveql_dialect(HiveQLDialect::default()/* use setters */);
3557 /// assert!(x.hiveql_dialect().is_some());
3558 /// assert!(x.bigquery_dialect().is_none());
3559 /// assert!(x.redshift_dialect().is_none());
3560 /// assert!(x.teradata_dialect().is_none());
3561 /// assert!(x.oracle_dialect().is_none());
3562 /// assert!(x.sparksql_dialect().is_none());
3563 /// assert!(x.snowflake_dialect().is_none());
3564 /// assert!(x.netezza_dialect().is_none());
3565 /// assert!(x.azure_synapse_dialect().is_none());
3566 /// assert!(x.vertica_dialect().is_none());
3567 /// assert!(x.sql_server_dialect().is_none());
3568 /// assert!(x.postgresql_dialect().is_none());
3569 /// assert!(x.presto_dialect().is_none());
3570 /// assert!(x.mysql_dialect().is_none());
3571 /// assert!(x.db2_dialect().is_none());
3572 /// assert!(x.sqlite_dialect().is_none());
3573 /// assert!(x.greenplum_dialect().is_none());
3574 /// ```
3575 pub fn set_hiveql_dialect<
3576 T: std::convert::Into<std::boxed::Box<crate::model::HiveQLDialect>>,
3577 >(
3578 mut self,
3579 v: T,
3580 ) -> Self {
3581 self.dialect_value =
3582 std::option::Option::Some(crate::model::dialect::DialectValue::HiveqlDialect(v.into()));
3583 self
3584 }
3585
3586 /// The value of [dialect_value][crate::model::Dialect::dialect_value]
3587 /// if it holds a `RedshiftDialect`, `None` if the field is not set or
3588 /// holds a different branch.
3589 pub fn redshift_dialect(
3590 &self,
3591 ) -> std::option::Option<&std::boxed::Box<crate::model::RedshiftDialect>> {
3592 #[allow(unreachable_patterns)]
3593 self.dialect_value.as_ref().and_then(|v| match v {
3594 crate::model::dialect::DialectValue::RedshiftDialect(v) => std::option::Option::Some(v),
3595 _ => std::option::Option::None,
3596 })
3597 }
3598
3599 /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
3600 /// to hold a `RedshiftDialect`.
3601 ///
3602 /// Note that all the setters affecting `dialect_value` are
3603 /// mutually exclusive.
3604 ///
3605 /// # Example
3606 /// ```ignore,no_run
3607 /// # use google_cloud_bigquery_migration_v2::model::Dialect;
3608 /// use google_cloud_bigquery_migration_v2::model::RedshiftDialect;
3609 /// let x = Dialect::new().set_redshift_dialect(RedshiftDialect::default()/* use setters */);
3610 /// assert!(x.redshift_dialect().is_some());
3611 /// assert!(x.bigquery_dialect().is_none());
3612 /// assert!(x.hiveql_dialect().is_none());
3613 /// assert!(x.teradata_dialect().is_none());
3614 /// assert!(x.oracle_dialect().is_none());
3615 /// assert!(x.sparksql_dialect().is_none());
3616 /// assert!(x.snowflake_dialect().is_none());
3617 /// assert!(x.netezza_dialect().is_none());
3618 /// assert!(x.azure_synapse_dialect().is_none());
3619 /// assert!(x.vertica_dialect().is_none());
3620 /// assert!(x.sql_server_dialect().is_none());
3621 /// assert!(x.postgresql_dialect().is_none());
3622 /// assert!(x.presto_dialect().is_none());
3623 /// assert!(x.mysql_dialect().is_none());
3624 /// assert!(x.db2_dialect().is_none());
3625 /// assert!(x.sqlite_dialect().is_none());
3626 /// assert!(x.greenplum_dialect().is_none());
3627 /// ```
3628 pub fn set_redshift_dialect<
3629 T: std::convert::Into<std::boxed::Box<crate::model::RedshiftDialect>>,
3630 >(
3631 mut self,
3632 v: T,
3633 ) -> Self {
3634 self.dialect_value = std::option::Option::Some(
3635 crate::model::dialect::DialectValue::RedshiftDialect(v.into()),
3636 );
3637 self
3638 }
3639
3640 /// The value of [dialect_value][crate::model::Dialect::dialect_value]
3641 /// if it holds a `TeradataDialect`, `None` if the field is not set or
3642 /// holds a different branch.
3643 pub fn teradata_dialect(
3644 &self,
3645 ) -> std::option::Option<&std::boxed::Box<crate::model::TeradataDialect>> {
3646 #[allow(unreachable_patterns)]
3647 self.dialect_value.as_ref().and_then(|v| match v {
3648 crate::model::dialect::DialectValue::TeradataDialect(v) => std::option::Option::Some(v),
3649 _ => std::option::Option::None,
3650 })
3651 }
3652
3653 /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
3654 /// to hold a `TeradataDialect`.
3655 ///
3656 /// Note that all the setters affecting `dialect_value` are
3657 /// mutually exclusive.
3658 ///
3659 /// # Example
3660 /// ```ignore,no_run
3661 /// # use google_cloud_bigquery_migration_v2::model::Dialect;
3662 /// use google_cloud_bigquery_migration_v2::model::TeradataDialect;
3663 /// let x = Dialect::new().set_teradata_dialect(TeradataDialect::default()/* use setters */);
3664 /// assert!(x.teradata_dialect().is_some());
3665 /// assert!(x.bigquery_dialect().is_none());
3666 /// assert!(x.hiveql_dialect().is_none());
3667 /// assert!(x.redshift_dialect().is_none());
3668 /// assert!(x.oracle_dialect().is_none());
3669 /// assert!(x.sparksql_dialect().is_none());
3670 /// assert!(x.snowflake_dialect().is_none());
3671 /// assert!(x.netezza_dialect().is_none());
3672 /// assert!(x.azure_synapse_dialect().is_none());
3673 /// assert!(x.vertica_dialect().is_none());
3674 /// assert!(x.sql_server_dialect().is_none());
3675 /// assert!(x.postgresql_dialect().is_none());
3676 /// assert!(x.presto_dialect().is_none());
3677 /// assert!(x.mysql_dialect().is_none());
3678 /// assert!(x.db2_dialect().is_none());
3679 /// assert!(x.sqlite_dialect().is_none());
3680 /// assert!(x.greenplum_dialect().is_none());
3681 /// ```
3682 pub fn set_teradata_dialect<
3683 T: std::convert::Into<std::boxed::Box<crate::model::TeradataDialect>>,
3684 >(
3685 mut self,
3686 v: T,
3687 ) -> Self {
3688 self.dialect_value = std::option::Option::Some(
3689 crate::model::dialect::DialectValue::TeradataDialect(v.into()),
3690 );
3691 self
3692 }
3693
3694 /// The value of [dialect_value][crate::model::Dialect::dialect_value]
3695 /// if it holds a `OracleDialect`, `None` if the field is not set or
3696 /// holds a different branch.
3697 pub fn oracle_dialect(
3698 &self,
3699 ) -> std::option::Option<&std::boxed::Box<crate::model::OracleDialect>> {
3700 #[allow(unreachable_patterns)]
3701 self.dialect_value.as_ref().and_then(|v| match v {
3702 crate::model::dialect::DialectValue::OracleDialect(v) => std::option::Option::Some(v),
3703 _ => std::option::Option::None,
3704 })
3705 }
3706
3707 /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
3708 /// to hold a `OracleDialect`.
3709 ///
3710 /// Note that all the setters affecting `dialect_value` are
3711 /// mutually exclusive.
3712 ///
3713 /// # Example
3714 /// ```ignore,no_run
3715 /// # use google_cloud_bigquery_migration_v2::model::Dialect;
3716 /// use google_cloud_bigquery_migration_v2::model::OracleDialect;
3717 /// let x = Dialect::new().set_oracle_dialect(OracleDialect::default()/* use setters */);
3718 /// assert!(x.oracle_dialect().is_some());
3719 /// assert!(x.bigquery_dialect().is_none());
3720 /// assert!(x.hiveql_dialect().is_none());
3721 /// assert!(x.redshift_dialect().is_none());
3722 /// assert!(x.teradata_dialect().is_none());
3723 /// assert!(x.sparksql_dialect().is_none());
3724 /// assert!(x.snowflake_dialect().is_none());
3725 /// assert!(x.netezza_dialect().is_none());
3726 /// assert!(x.azure_synapse_dialect().is_none());
3727 /// assert!(x.vertica_dialect().is_none());
3728 /// assert!(x.sql_server_dialect().is_none());
3729 /// assert!(x.postgresql_dialect().is_none());
3730 /// assert!(x.presto_dialect().is_none());
3731 /// assert!(x.mysql_dialect().is_none());
3732 /// assert!(x.db2_dialect().is_none());
3733 /// assert!(x.sqlite_dialect().is_none());
3734 /// assert!(x.greenplum_dialect().is_none());
3735 /// ```
3736 pub fn set_oracle_dialect<
3737 T: std::convert::Into<std::boxed::Box<crate::model::OracleDialect>>,
3738 >(
3739 mut self,
3740 v: T,
3741 ) -> Self {
3742 self.dialect_value =
3743 std::option::Option::Some(crate::model::dialect::DialectValue::OracleDialect(v.into()));
3744 self
3745 }
3746
3747 /// The value of [dialect_value][crate::model::Dialect::dialect_value]
3748 /// if it holds a `SparksqlDialect`, `None` if the field is not set or
3749 /// holds a different branch.
3750 pub fn sparksql_dialect(
3751 &self,
3752 ) -> std::option::Option<&std::boxed::Box<crate::model::SparkSQLDialect>> {
3753 #[allow(unreachable_patterns)]
3754 self.dialect_value.as_ref().and_then(|v| match v {
3755 crate::model::dialect::DialectValue::SparksqlDialect(v) => std::option::Option::Some(v),
3756 _ => std::option::Option::None,
3757 })
3758 }
3759
3760 /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
3761 /// to hold a `SparksqlDialect`.
3762 ///
3763 /// Note that all the setters affecting `dialect_value` are
3764 /// mutually exclusive.
3765 ///
3766 /// # Example
3767 /// ```ignore,no_run
3768 /// # use google_cloud_bigquery_migration_v2::model::Dialect;
3769 /// use google_cloud_bigquery_migration_v2::model::SparkSQLDialect;
3770 /// let x = Dialect::new().set_sparksql_dialect(SparkSQLDialect::default()/* use setters */);
3771 /// assert!(x.sparksql_dialect().is_some());
3772 /// assert!(x.bigquery_dialect().is_none());
3773 /// assert!(x.hiveql_dialect().is_none());
3774 /// assert!(x.redshift_dialect().is_none());
3775 /// assert!(x.teradata_dialect().is_none());
3776 /// assert!(x.oracle_dialect().is_none());
3777 /// assert!(x.snowflake_dialect().is_none());
3778 /// assert!(x.netezza_dialect().is_none());
3779 /// assert!(x.azure_synapse_dialect().is_none());
3780 /// assert!(x.vertica_dialect().is_none());
3781 /// assert!(x.sql_server_dialect().is_none());
3782 /// assert!(x.postgresql_dialect().is_none());
3783 /// assert!(x.presto_dialect().is_none());
3784 /// assert!(x.mysql_dialect().is_none());
3785 /// assert!(x.db2_dialect().is_none());
3786 /// assert!(x.sqlite_dialect().is_none());
3787 /// assert!(x.greenplum_dialect().is_none());
3788 /// ```
3789 pub fn set_sparksql_dialect<
3790 T: std::convert::Into<std::boxed::Box<crate::model::SparkSQLDialect>>,
3791 >(
3792 mut self,
3793 v: T,
3794 ) -> Self {
3795 self.dialect_value = std::option::Option::Some(
3796 crate::model::dialect::DialectValue::SparksqlDialect(v.into()),
3797 );
3798 self
3799 }
3800
3801 /// The value of [dialect_value][crate::model::Dialect::dialect_value]
3802 /// if it holds a `SnowflakeDialect`, `None` if the field is not set or
3803 /// holds a different branch.
3804 pub fn snowflake_dialect(
3805 &self,
3806 ) -> std::option::Option<&std::boxed::Box<crate::model::SnowflakeDialect>> {
3807 #[allow(unreachable_patterns)]
3808 self.dialect_value.as_ref().and_then(|v| match v {
3809 crate::model::dialect::DialectValue::SnowflakeDialect(v) => {
3810 std::option::Option::Some(v)
3811 }
3812 _ => std::option::Option::None,
3813 })
3814 }
3815
3816 /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
3817 /// to hold a `SnowflakeDialect`.
3818 ///
3819 /// Note that all the setters affecting `dialect_value` are
3820 /// mutually exclusive.
3821 ///
3822 /// # Example
3823 /// ```ignore,no_run
3824 /// # use google_cloud_bigquery_migration_v2::model::Dialect;
3825 /// use google_cloud_bigquery_migration_v2::model::SnowflakeDialect;
3826 /// let x = Dialect::new().set_snowflake_dialect(SnowflakeDialect::default()/* use setters */);
3827 /// assert!(x.snowflake_dialect().is_some());
3828 /// assert!(x.bigquery_dialect().is_none());
3829 /// assert!(x.hiveql_dialect().is_none());
3830 /// assert!(x.redshift_dialect().is_none());
3831 /// assert!(x.teradata_dialect().is_none());
3832 /// assert!(x.oracle_dialect().is_none());
3833 /// assert!(x.sparksql_dialect().is_none());
3834 /// assert!(x.netezza_dialect().is_none());
3835 /// assert!(x.azure_synapse_dialect().is_none());
3836 /// assert!(x.vertica_dialect().is_none());
3837 /// assert!(x.sql_server_dialect().is_none());
3838 /// assert!(x.postgresql_dialect().is_none());
3839 /// assert!(x.presto_dialect().is_none());
3840 /// assert!(x.mysql_dialect().is_none());
3841 /// assert!(x.db2_dialect().is_none());
3842 /// assert!(x.sqlite_dialect().is_none());
3843 /// assert!(x.greenplum_dialect().is_none());
3844 /// ```
3845 pub fn set_snowflake_dialect<
3846 T: std::convert::Into<std::boxed::Box<crate::model::SnowflakeDialect>>,
3847 >(
3848 mut self,
3849 v: T,
3850 ) -> Self {
3851 self.dialect_value = std::option::Option::Some(
3852 crate::model::dialect::DialectValue::SnowflakeDialect(v.into()),
3853 );
3854 self
3855 }
3856
3857 /// The value of [dialect_value][crate::model::Dialect::dialect_value]
3858 /// if it holds a `NetezzaDialect`, `None` if the field is not set or
3859 /// holds a different branch.
3860 pub fn netezza_dialect(
3861 &self,
3862 ) -> std::option::Option<&std::boxed::Box<crate::model::NetezzaDialect>> {
3863 #[allow(unreachable_patterns)]
3864 self.dialect_value.as_ref().and_then(|v| match v {
3865 crate::model::dialect::DialectValue::NetezzaDialect(v) => std::option::Option::Some(v),
3866 _ => std::option::Option::None,
3867 })
3868 }
3869
3870 /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
3871 /// to hold a `NetezzaDialect`.
3872 ///
3873 /// Note that all the setters affecting `dialect_value` are
3874 /// mutually exclusive.
3875 ///
3876 /// # Example
3877 /// ```ignore,no_run
3878 /// # use google_cloud_bigquery_migration_v2::model::Dialect;
3879 /// use google_cloud_bigquery_migration_v2::model::NetezzaDialect;
3880 /// let x = Dialect::new().set_netezza_dialect(NetezzaDialect::default()/* use setters */);
3881 /// assert!(x.netezza_dialect().is_some());
3882 /// assert!(x.bigquery_dialect().is_none());
3883 /// assert!(x.hiveql_dialect().is_none());
3884 /// assert!(x.redshift_dialect().is_none());
3885 /// assert!(x.teradata_dialect().is_none());
3886 /// assert!(x.oracle_dialect().is_none());
3887 /// assert!(x.sparksql_dialect().is_none());
3888 /// assert!(x.snowflake_dialect().is_none());
3889 /// assert!(x.azure_synapse_dialect().is_none());
3890 /// assert!(x.vertica_dialect().is_none());
3891 /// assert!(x.sql_server_dialect().is_none());
3892 /// assert!(x.postgresql_dialect().is_none());
3893 /// assert!(x.presto_dialect().is_none());
3894 /// assert!(x.mysql_dialect().is_none());
3895 /// assert!(x.db2_dialect().is_none());
3896 /// assert!(x.sqlite_dialect().is_none());
3897 /// assert!(x.greenplum_dialect().is_none());
3898 /// ```
3899 pub fn set_netezza_dialect<
3900 T: std::convert::Into<std::boxed::Box<crate::model::NetezzaDialect>>,
3901 >(
3902 mut self,
3903 v: T,
3904 ) -> Self {
3905 self.dialect_value = std::option::Option::Some(
3906 crate::model::dialect::DialectValue::NetezzaDialect(v.into()),
3907 );
3908 self
3909 }
3910
3911 /// The value of [dialect_value][crate::model::Dialect::dialect_value]
3912 /// if it holds a `AzureSynapseDialect`, `None` if the field is not set or
3913 /// holds a different branch.
3914 pub fn azure_synapse_dialect(
3915 &self,
3916 ) -> std::option::Option<&std::boxed::Box<crate::model::AzureSynapseDialect>> {
3917 #[allow(unreachable_patterns)]
3918 self.dialect_value.as_ref().and_then(|v| match v {
3919 crate::model::dialect::DialectValue::AzureSynapseDialect(v) => {
3920 std::option::Option::Some(v)
3921 }
3922 _ => std::option::Option::None,
3923 })
3924 }
3925
3926 /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
3927 /// to hold a `AzureSynapseDialect`.
3928 ///
3929 /// Note that all the setters affecting `dialect_value` are
3930 /// mutually exclusive.
3931 ///
3932 /// # Example
3933 /// ```ignore,no_run
3934 /// # use google_cloud_bigquery_migration_v2::model::Dialect;
3935 /// use google_cloud_bigquery_migration_v2::model::AzureSynapseDialect;
3936 /// let x = Dialect::new().set_azure_synapse_dialect(AzureSynapseDialect::default()/* use setters */);
3937 /// assert!(x.azure_synapse_dialect().is_some());
3938 /// assert!(x.bigquery_dialect().is_none());
3939 /// assert!(x.hiveql_dialect().is_none());
3940 /// assert!(x.redshift_dialect().is_none());
3941 /// assert!(x.teradata_dialect().is_none());
3942 /// assert!(x.oracle_dialect().is_none());
3943 /// assert!(x.sparksql_dialect().is_none());
3944 /// assert!(x.snowflake_dialect().is_none());
3945 /// assert!(x.netezza_dialect().is_none());
3946 /// assert!(x.vertica_dialect().is_none());
3947 /// assert!(x.sql_server_dialect().is_none());
3948 /// assert!(x.postgresql_dialect().is_none());
3949 /// assert!(x.presto_dialect().is_none());
3950 /// assert!(x.mysql_dialect().is_none());
3951 /// assert!(x.db2_dialect().is_none());
3952 /// assert!(x.sqlite_dialect().is_none());
3953 /// assert!(x.greenplum_dialect().is_none());
3954 /// ```
3955 pub fn set_azure_synapse_dialect<
3956 T: std::convert::Into<std::boxed::Box<crate::model::AzureSynapseDialect>>,
3957 >(
3958 mut self,
3959 v: T,
3960 ) -> Self {
3961 self.dialect_value = std::option::Option::Some(
3962 crate::model::dialect::DialectValue::AzureSynapseDialect(v.into()),
3963 );
3964 self
3965 }
3966
3967 /// The value of [dialect_value][crate::model::Dialect::dialect_value]
3968 /// if it holds a `VerticaDialect`, `None` if the field is not set or
3969 /// holds a different branch.
3970 pub fn vertica_dialect(
3971 &self,
3972 ) -> std::option::Option<&std::boxed::Box<crate::model::VerticaDialect>> {
3973 #[allow(unreachable_patterns)]
3974 self.dialect_value.as_ref().and_then(|v| match v {
3975 crate::model::dialect::DialectValue::VerticaDialect(v) => std::option::Option::Some(v),
3976 _ => std::option::Option::None,
3977 })
3978 }
3979
3980 /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
3981 /// to hold a `VerticaDialect`.
3982 ///
3983 /// Note that all the setters affecting `dialect_value` are
3984 /// mutually exclusive.
3985 ///
3986 /// # Example
3987 /// ```ignore,no_run
3988 /// # use google_cloud_bigquery_migration_v2::model::Dialect;
3989 /// use google_cloud_bigquery_migration_v2::model::VerticaDialect;
3990 /// let x = Dialect::new().set_vertica_dialect(VerticaDialect::default()/* use setters */);
3991 /// assert!(x.vertica_dialect().is_some());
3992 /// assert!(x.bigquery_dialect().is_none());
3993 /// assert!(x.hiveql_dialect().is_none());
3994 /// assert!(x.redshift_dialect().is_none());
3995 /// assert!(x.teradata_dialect().is_none());
3996 /// assert!(x.oracle_dialect().is_none());
3997 /// assert!(x.sparksql_dialect().is_none());
3998 /// assert!(x.snowflake_dialect().is_none());
3999 /// assert!(x.netezza_dialect().is_none());
4000 /// assert!(x.azure_synapse_dialect().is_none());
4001 /// assert!(x.sql_server_dialect().is_none());
4002 /// assert!(x.postgresql_dialect().is_none());
4003 /// assert!(x.presto_dialect().is_none());
4004 /// assert!(x.mysql_dialect().is_none());
4005 /// assert!(x.db2_dialect().is_none());
4006 /// assert!(x.sqlite_dialect().is_none());
4007 /// assert!(x.greenplum_dialect().is_none());
4008 /// ```
4009 pub fn set_vertica_dialect<
4010 T: std::convert::Into<std::boxed::Box<crate::model::VerticaDialect>>,
4011 >(
4012 mut self,
4013 v: T,
4014 ) -> Self {
4015 self.dialect_value = std::option::Option::Some(
4016 crate::model::dialect::DialectValue::VerticaDialect(v.into()),
4017 );
4018 self
4019 }
4020
4021 /// The value of [dialect_value][crate::model::Dialect::dialect_value]
4022 /// if it holds a `SqlServerDialect`, `None` if the field is not set or
4023 /// holds a different branch.
4024 pub fn sql_server_dialect(
4025 &self,
4026 ) -> std::option::Option<&std::boxed::Box<crate::model::SQLServerDialect>> {
4027 #[allow(unreachable_patterns)]
4028 self.dialect_value.as_ref().and_then(|v| match v {
4029 crate::model::dialect::DialectValue::SqlServerDialect(v) => {
4030 std::option::Option::Some(v)
4031 }
4032 _ => std::option::Option::None,
4033 })
4034 }
4035
4036 /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
4037 /// to hold a `SqlServerDialect`.
4038 ///
4039 /// Note that all the setters affecting `dialect_value` are
4040 /// mutually exclusive.
4041 ///
4042 /// # Example
4043 /// ```ignore,no_run
4044 /// # use google_cloud_bigquery_migration_v2::model::Dialect;
4045 /// use google_cloud_bigquery_migration_v2::model::SQLServerDialect;
4046 /// let x = Dialect::new().set_sql_server_dialect(SQLServerDialect::default()/* use setters */);
4047 /// assert!(x.sql_server_dialect().is_some());
4048 /// assert!(x.bigquery_dialect().is_none());
4049 /// assert!(x.hiveql_dialect().is_none());
4050 /// assert!(x.redshift_dialect().is_none());
4051 /// assert!(x.teradata_dialect().is_none());
4052 /// assert!(x.oracle_dialect().is_none());
4053 /// assert!(x.sparksql_dialect().is_none());
4054 /// assert!(x.snowflake_dialect().is_none());
4055 /// assert!(x.netezza_dialect().is_none());
4056 /// assert!(x.azure_synapse_dialect().is_none());
4057 /// assert!(x.vertica_dialect().is_none());
4058 /// assert!(x.postgresql_dialect().is_none());
4059 /// assert!(x.presto_dialect().is_none());
4060 /// assert!(x.mysql_dialect().is_none());
4061 /// assert!(x.db2_dialect().is_none());
4062 /// assert!(x.sqlite_dialect().is_none());
4063 /// assert!(x.greenplum_dialect().is_none());
4064 /// ```
4065 pub fn set_sql_server_dialect<
4066 T: std::convert::Into<std::boxed::Box<crate::model::SQLServerDialect>>,
4067 >(
4068 mut self,
4069 v: T,
4070 ) -> Self {
4071 self.dialect_value = std::option::Option::Some(
4072 crate::model::dialect::DialectValue::SqlServerDialect(v.into()),
4073 );
4074 self
4075 }
4076
4077 /// The value of [dialect_value][crate::model::Dialect::dialect_value]
4078 /// if it holds a `PostgresqlDialect`, `None` if the field is not set or
4079 /// holds a different branch.
4080 pub fn postgresql_dialect(
4081 &self,
4082 ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlDialect>> {
4083 #[allow(unreachable_patterns)]
4084 self.dialect_value.as_ref().and_then(|v| match v {
4085 crate::model::dialect::DialectValue::PostgresqlDialect(v) => {
4086 std::option::Option::Some(v)
4087 }
4088 _ => std::option::Option::None,
4089 })
4090 }
4091
4092 /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
4093 /// to hold a `PostgresqlDialect`.
4094 ///
4095 /// Note that all the setters affecting `dialect_value` are
4096 /// mutually exclusive.
4097 ///
4098 /// # Example
4099 /// ```ignore,no_run
4100 /// # use google_cloud_bigquery_migration_v2::model::Dialect;
4101 /// use google_cloud_bigquery_migration_v2::model::PostgresqlDialect;
4102 /// let x = Dialect::new().set_postgresql_dialect(PostgresqlDialect::default()/* use setters */);
4103 /// assert!(x.postgresql_dialect().is_some());
4104 /// assert!(x.bigquery_dialect().is_none());
4105 /// assert!(x.hiveql_dialect().is_none());
4106 /// assert!(x.redshift_dialect().is_none());
4107 /// assert!(x.teradata_dialect().is_none());
4108 /// assert!(x.oracle_dialect().is_none());
4109 /// assert!(x.sparksql_dialect().is_none());
4110 /// assert!(x.snowflake_dialect().is_none());
4111 /// assert!(x.netezza_dialect().is_none());
4112 /// assert!(x.azure_synapse_dialect().is_none());
4113 /// assert!(x.vertica_dialect().is_none());
4114 /// assert!(x.sql_server_dialect().is_none());
4115 /// assert!(x.presto_dialect().is_none());
4116 /// assert!(x.mysql_dialect().is_none());
4117 /// assert!(x.db2_dialect().is_none());
4118 /// assert!(x.sqlite_dialect().is_none());
4119 /// assert!(x.greenplum_dialect().is_none());
4120 /// ```
4121 pub fn set_postgresql_dialect<
4122 T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlDialect>>,
4123 >(
4124 mut self,
4125 v: T,
4126 ) -> Self {
4127 self.dialect_value = std::option::Option::Some(
4128 crate::model::dialect::DialectValue::PostgresqlDialect(v.into()),
4129 );
4130 self
4131 }
4132
4133 /// The value of [dialect_value][crate::model::Dialect::dialect_value]
4134 /// if it holds a `PrestoDialect`, `None` if the field is not set or
4135 /// holds a different branch.
4136 pub fn presto_dialect(
4137 &self,
4138 ) -> std::option::Option<&std::boxed::Box<crate::model::PrestoDialect>> {
4139 #[allow(unreachable_patterns)]
4140 self.dialect_value.as_ref().and_then(|v| match v {
4141 crate::model::dialect::DialectValue::PrestoDialect(v) => std::option::Option::Some(v),
4142 _ => std::option::Option::None,
4143 })
4144 }
4145
4146 /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
4147 /// to hold a `PrestoDialect`.
4148 ///
4149 /// Note that all the setters affecting `dialect_value` are
4150 /// mutually exclusive.
4151 ///
4152 /// # Example
4153 /// ```ignore,no_run
4154 /// # use google_cloud_bigquery_migration_v2::model::Dialect;
4155 /// use google_cloud_bigquery_migration_v2::model::PrestoDialect;
4156 /// let x = Dialect::new().set_presto_dialect(PrestoDialect::default()/* use setters */);
4157 /// assert!(x.presto_dialect().is_some());
4158 /// assert!(x.bigquery_dialect().is_none());
4159 /// assert!(x.hiveql_dialect().is_none());
4160 /// assert!(x.redshift_dialect().is_none());
4161 /// assert!(x.teradata_dialect().is_none());
4162 /// assert!(x.oracle_dialect().is_none());
4163 /// assert!(x.sparksql_dialect().is_none());
4164 /// assert!(x.snowflake_dialect().is_none());
4165 /// assert!(x.netezza_dialect().is_none());
4166 /// assert!(x.azure_synapse_dialect().is_none());
4167 /// assert!(x.vertica_dialect().is_none());
4168 /// assert!(x.sql_server_dialect().is_none());
4169 /// assert!(x.postgresql_dialect().is_none());
4170 /// assert!(x.mysql_dialect().is_none());
4171 /// assert!(x.db2_dialect().is_none());
4172 /// assert!(x.sqlite_dialect().is_none());
4173 /// assert!(x.greenplum_dialect().is_none());
4174 /// ```
4175 pub fn set_presto_dialect<
4176 T: std::convert::Into<std::boxed::Box<crate::model::PrestoDialect>>,
4177 >(
4178 mut self,
4179 v: T,
4180 ) -> Self {
4181 self.dialect_value =
4182 std::option::Option::Some(crate::model::dialect::DialectValue::PrestoDialect(v.into()));
4183 self
4184 }
4185
4186 /// The value of [dialect_value][crate::model::Dialect::dialect_value]
4187 /// if it holds a `MysqlDialect`, `None` if the field is not set or
4188 /// holds a different branch.
4189 pub fn mysql_dialect(
4190 &self,
4191 ) -> std::option::Option<&std::boxed::Box<crate::model::MySQLDialect>> {
4192 #[allow(unreachable_patterns)]
4193 self.dialect_value.as_ref().and_then(|v| match v {
4194 crate::model::dialect::DialectValue::MysqlDialect(v) => std::option::Option::Some(v),
4195 _ => std::option::Option::None,
4196 })
4197 }
4198
4199 /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
4200 /// to hold a `MysqlDialect`.
4201 ///
4202 /// Note that all the setters affecting `dialect_value` are
4203 /// mutually exclusive.
4204 ///
4205 /// # Example
4206 /// ```ignore,no_run
4207 /// # use google_cloud_bigquery_migration_v2::model::Dialect;
4208 /// use google_cloud_bigquery_migration_v2::model::MySQLDialect;
4209 /// let x = Dialect::new().set_mysql_dialect(MySQLDialect::default()/* use setters */);
4210 /// assert!(x.mysql_dialect().is_some());
4211 /// assert!(x.bigquery_dialect().is_none());
4212 /// assert!(x.hiveql_dialect().is_none());
4213 /// assert!(x.redshift_dialect().is_none());
4214 /// assert!(x.teradata_dialect().is_none());
4215 /// assert!(x.oracle_dialect().is_none());
4216 /// assert!(x.sparksql_dialect().is_none());
4217 /// assert!(x.snowflake_dialect().is_none());
4218 /// assert!(x.netezza_dialect().is_none());
4219 /// assert!(x.azure_synapse_dialect().is_none());
4220 /// assert!(x.vertica_dialect().is_none());
4221 /// assert!(x.sql_server_dialect().is_none());
4222 /// assert!(x.postgresql_dialect().is_none());
4223 /// assert!(x.presto_dialect().is_none());
4224 /// assert!(x.db2_dialect().is_none());
4225 /// assert!(x.sqlite_dialect().is_none());
4226 /// assert!(x.greenplum_dialect().is_none());
4227 /// ```
4228 pub fn set_mysql_dialect<T: std::convert::Into<std::boxed::Box<crate::model::MySQLDialect>>>(
4229 mut self,
4230 v: T,
4231 ) -> Self {
4232 self.dialect_value =
4233 std::option::Option::Some(crate::model::dialect::DialectValue::MysqlDialect(v.into()));
4234 self
4235 }
4236
4237 /// The value of [dialect_value][crate::model::Dialect::dialect_value]
4238 /// if it holds a `Db2Dialect`, `None` if the field is not set or
4239 /// holds a different branch.
4240 pub fn db2_dialect(&self) -> std::option::Option<&std::boxed::Box<crate::model::DB2Dialect>> {
4241 #[allow(unreachable_patterns)]
4242 self.dialect_value.as_ref().and_then(|v| match v {
4243 crate::model::dialect::DialectValue::Db2Dialect(v) => std::option::Option::Some(v),
4244 _ => std::option::Option::None,
4245 })
4246 }
4247
4248 /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
4249 /// to hold a `Db2Dialect`.
4250 ///
4251 /// Note that all the setters affecting `dialect_value` are
4252 /// mutually exclusive.
4253 ///
4254 /// # Example
4255 /// ```ignore,no_run
4256 /// # use google_cloud_bigquery_migration_v2::model::Dialect;
4257 /// use google_cloud_bigquery_migration_v2::model::DB2Dialect;
4258 /// let x = Dialect::new().set_db2_dialect(DB2Dialect::default()/* use setters */);
4259 /// assert!(x.db2_dialect().is_some());
4260 /// assert!(x.bigquery_dialect().is_none());
4261 /// assert!(x.hiveql_dialect().is_none());
4262 /// assert!(x.redshift_dialect().is_none());
4263 /// assert!(x.teradata_dialect().is_none());
4264 /// assert!(x.oracle_dialect().is_none());
4265 /// assert!(x.sparksql_dialect().is_none());
4266 /// assert!(x.snowflake_dialect().is_none());
4267 /// assert!(x.netezza_dialect().is_none());
4268 /// assert!(x.azure_synapse_dialect().is_none());
4269 /// assert!(x.vertica_dialect().is_none());
4270 /// assert!(x.sql_server_dialect().is_none());
4271 /// assert!(x.postgresql_dialect().is_none());
4272 /// assert!(x.presto_dialect().is_none());
4273 /// assert!(x.mysql_dialect().is_none());
4274 /// assert!(x.sqlite_dialect().is_none());
4275 /// assert!(x.greenplum_dialect().is_none());
4276 /// ```
4277 pub fn set_db2_dialect<T: std::convert::Into<std::boxed::Box<crate::model::DB2Dialect>>>(
4278 mut self,
4279 v: T,
4280 ) -> Self {
4281 self.dialect_value =
4282 std::option::Option::Some(crate::model::dialect::DialectValue::Db2Dialect(v.into()));
4283 self
4284 }
4285
4286 /// The value of [dialect_value][crate::model::Dialect::dialect_value]
4287 /// if it holds a `SqliteDialect`, `None` if the field is not set or
4288 /// holds a different branch.
4289 pub fn sqlite_dialect(
4290 &self,
4291 ) -> std::option::Option<&std::boxed::Box<crate::model::SQLiteDialect>> {
4292 #[allow(unreachable_patterns)]
4293 self.dialect_value.as_ref().and_then(|v| match v {
4294 crate::model::dialect::DialectValue::SqliteDialect(v) => std::option::Option::Some(v),
4295 _ => std::option::Option::None,
4296 })
4297 }
4298
4299 /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
4300 /// to hold a `SqliteDialect`.
4301 ///
4302 /// Note that all the setters affecting `dialect_value` are
4303 /// mutually exclusive.
4304 ///
4305 /// # Example
4306 /// ```ignore,no_run
4307 /// # use google_cloud_bigquery_migration_v2::model::Dialect;
4308 /// use google_cloud_bigquery_migration_v2::model::SQLiteDialect;
4309 /// let x = Dialect::new().set_sqlite_dialect(SQLiteDialect::default()/* use setters */);
4310 /// assert!(x.sqlite_dialect().is_some());
4311 /// assert!(x.bigquery_dialect().is_none());
4312 /// assert!(x.hiveql_dialect().is_none());
4313 /// assert!(x.redshift_dialect().is_none());
4314 /// assert!(x.teradata_dialect().is_none());
4315 /// assert!(x.oracle_dialect().is_none());
4316 /// assert!(x.sparksql_dialect().is_none());
4317 /// assert!(x.snowflake_dialect().is_none());
4318 /// assert!(x.netezza_dialect().is_none());
4319 /// assert!(x.azure_synapse_dialect().is_none());
4320 /// assert!(x.vertica_dialect().is_none());
4321 /// assert!(x.sql_server_dialect().is_none());
4322 /// assert!(x.postgresql_dialect().is_none());
4323 /// assert!(x.presto_dialect().is_none());
4324 /// assert!(x.mysql_dialect().is_none());
4325 /// assert!(x.db2_dialect().is_none());
4326 /// assert!(x.greenplum_dialect().is_none());
4327 /// ```
4328 pub fn set_sqlite_dialect<
4329 T: std::convert::Into<std::boxed::Box<crate::model::SQLiteDialect>>,
4330 >(
4331 mut self,
4332 v: T,
4333 ) -> Self {
4334 self.dialect_value =
4335 std::option::Option::Some(crate::model::dialect::DialectValue::SqliteDialect(v.into()));
4336 self
4337 }
4338
4339 /// The value of [dialect_value][crate::model::Dialect::dialect_value]
4340 /// if it holds a `GreenplumDialect`, `None` if the field is not set or
4341 /// holds a different branch.
4342 pub fn greenplum_dialect(
4343 &self,
4344 ) -> std::option::Option<&std::boxed::Box<crate::model::GreenplumDialect>> {
4345 #[allow(unreachable_patterns)]
4346 self.dialect_value.as_ref().and_then(|v| match v {
4347 crate::model::dialect::DialectValue::GreenplumDialect(v) => {
4348 std::option::Option::Some(v)
4349 }
4350 _ => std::option::Option::None,
4351 })
4352 }
4353
4354 /// Sets the value of [dialect_value][crate::model::Dialect::dialect_value]
4355 /// to hold a `GreenplumDialect`.
4356 ///
4357 /// Note that all the setters affecting `dialect_value` are
4358 /// mutually exclusive.
4359 ///
4360 /// # Example
4361 /// ```ignore,no_run
4362 /// # use google_cloud_bigquery_migration_v2::model::Dialect;
4363 /// use google_cloud_bigquery_migration_v2::model::GreenplumDialect;
4364 /// let x = Dialect::new().set_greenplum_dialect(GreenplumDialect::default()/* use setters */);
4365 /// assert!(x.greenplum_dialect().is_some());
4366 /// assert!(x.bigquery_dialect().is_none());
4367 /// assert!(x.hiveql_dialect().is_none());
4368 /// assert!(x.redshift_dialect().is_none());
4369 /// assert!(x.teradata_dialect().is_none());
4370 /// assert!(x.oracle_dialect().is_none());
4371 /// assert!(x.sparksql_dialect().is_none());
4372 /// assert!(x.snowflake_dialect().is_none());
4373 /// assert!(x.netezza_dialect().is_none());
4374 /// assert!(x.azure_synapse_dialect().is_none());
4375 /// assert!(x.vertica_dialect().is_none());
4376 /// assert!(x.sql_server_dialect().is_none());
4377 /// assert!(x.postgresql_dialect().is_none());
4378 /// assert!(x.presto_dialect().is_none());
4379 /// assert!(x.mysql_dialect().is_none());
4380 /// assert!(x.db2_dialect().is_none());
4381 /// assert!(x.sqlite_dialect().is_none());
4382 /// ```
4383 pub fn set_greenplum_dialect<
4384 T: std::convert::Into<std::boxed::Box<crate::model::GreenplumDialect>>,
4385 >(
4386 mut self,
4387 v: T,
4388 ) -> Self {
4389 self.dialect_value = std::option::Option::Some(
4390 crate::model::dialect::DialectValue::GreenplumDialect(v.into()),
4391 );
4392 self
4393 }
4394}
4395
4396impl wkt::message::Message for Dialect {
4397 fn typename() -> &'static str {
4398 "type.googleapis.com/google.cloud.bigquery.migration.v2.Dialect"
4399 }
4400}
4401
4402/// Defines additional types related to [Dialect].
4403pub mod dialect {
4404 #[allow(unused_imports)]
4405 use super::*;
4406
4407 /// The possible dialect options that this message represents.
4408 #[derive(Clone, Debug, PartialEq)]
4409 #[non_exhaustive]
4410 pub enum DialectValue {
4411 /// The BigQuery dialect
4412 BigqueryDialect(std::boxed::Box<crate::model::BigQueryDialect>),
4413 /// The HiveQL dialect
4414 HiveqlDialect(std::boxed::Box<crate::model::HiveQLDialect>),
4415 /// The Redshift dialect
4416 RedshiftDialect(std::boxed::Box<crate::model::RedshiftDialect>),
4417 /// The Teradata dialect
4418 TeradataDialect(std::boxed::Box<crate::model::TeradataDialect>),
4419 /// The Oracle dialect
4420 OracleDialect(std::boxed::Box<crate::model::OracleDialect>),
4421 /// The SparkSQL dialect
4422 SparksqlDialect(std::boxed::Box<crate::model::SparkSQLDialect>),
4423 /// The Snowflake dialect
4424 SnowflakeDialect(std::boxed::Box<crate::model::SnowflakeDialect>),
4425 /// The Netezza dialect
4426 NetezzaDialect(std::boxed::Box<crate::model::NetezzaDialect>),
4427 /// The Azure Synapse dialect
4428 AzureSynapseDialect(std::boxed::Box<crate::model::AzureSynapseDialect>),
4429 /// The Vertica dialect
4430 VerticaDialect(std::boxed::Box<crate::model::VerticaDialect>),
4431 /// The SQL Server dialect
4432 SqlServerDialect(std::boxed::Box<crate::model::SQLServerDialect>),
4433 /// The Postgresql dialect
4434 PostgresqlDialect(std::boxed::Box<crate::model::PostgresqlDialect>),
4435 /// The Presto dialect
4436 PrestoDialect(std::boxed::Box<crate::model::PrestoDialect>),
4437 /// The MySQL dialect
4438 MysqlDialect(std::boxed::Box<crate::model::MySQLDialect>),
4439 /// DB2 dialect
4440 Db2Dialect(std::boxed::Box<crate::model::DB2Dialect>),
4441 /// SQLite dialect
4442 SqliteDialect(std::boxed::Box<crate::model::SQLiteDialect>),
4443 /// Greenplum dialect
4444 GreenplumDialect(std::boxed::Box<crate::model::GreenplumDialect>),
4445 }
4446}
4447
4448/// The dialect definition for BigQuery.
4449#[derive(Clone, Default, PartialEq)]
4450#[non_exhaustive]
4451pub struct BigQueryDialect {
4452 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4453}
4454
4455impl BigQueryDialect {
4456 /// Creates a new default instance.
4457 pub fn new() -> Self {
4458 std::default::Default::default()
4459 }
4460}
4461
4462impl wkt::message::Message for BigQueryDialect {
4463 fn typename() -> &'static str {
4464 "type.googleapis.com/google.cloud.bigquery.migration.v2.BigQueryDialect"
4465 }
4466}
4467
4468/// The dialect definition for HiveQL.
4469#[derive(Clone, Default, PartialEq)]
4470#[non_exhaustive]
4471pub struct HiveQLDialect {
4472 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4473}
4474
4475impl HiveQLDialect {
4476 /// Creates a new default instance.
4477 pub fn new() -> Self {
4478 std::default::Default::default()
4479 }
4480}
4481
4482impl wkt::message::Message for HiveQLDialect {
4483 fn typename() -> &'static str {
4484 "type.googleapis.com/google.cloud.bigquery.migration.v2.HiveQLDialect"
4485 }
4486}
4487
4488/// The dialect definition for Redshift.
4489#[derive(Clone, Default, PartialEq)]
4490#[non_exhaustive]
4491pub struct RedshiftDialect {
4492 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4493}
4494
4495impl RedshiftDialect {
4496 /// Creates a new default instance.
4497 pub fn new() -> Self {
4498 std::default::Default::default()
4499 }
4500}
4501
4502impl wkt::message::Message for RedshiftDialect {
4503 fn typename() -> &'static str {
4504 "type.googleapis.com/google.cloud.bigquery.migration.v2.RedshiftDialect"
4505 }
4506}
4507
4508/// The dialect definition for Teradata.
4509#[derive(Clone, Default, PartialEq)]
4510#[non_exhaustive]
4511pub struct TeradataDialect {
4512 /// Which Teradata sub-dialect mode the user specifies.
4513 pub mode: crate::model::teradata_dialect::Mode,
4514
4515 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4516}
4517
4518impl TeradataDialect {
4519 /// Creates a new default instance.
4520 pub fn new() -> Self {
4521 std::default::Default::default()
4522 }
4523
4524 /// Sets the value of [mode][crate::model::TeradataDialect::mode].
4525 ///
4526 /// # Example
4527 /// ```ignore,no_run
4528 /// # use google_cloud_bigquery_migration_v2::model::TeradataDialect;
4529 /// use google_cloud_bigquery_migration_v2::model::teradata_dialect::Mode;
4530 /// let x0 = TeradataDialect::new().set_mode(Mode::Sql);
4531 /// let x1 = TeradataDialect::new().set_mode(Mode::Bteq);
4532 /// ```
4533 pub fn set_mode<T: std::convert::Into<crate::model::teradata_dialect::Mode>>(
4534 mut self,
4535 v: T,
4536 ) -> Self {
4537 self.mode = v.into();
4538 self
4539 }
4540}
4541
4542impl wkt::message::Message for TeradataDialect {
4543 fn typename() -> &'static str {
4544 "type.googleapis.com/google.cloud.bigquery.migration.v2.TeradataDialect"
4545 }
4546}
4547
4548/// Defines additional types related to [TeradataDialect].
4549pub mod teradata_dialect {
4550 #[allow(unused_imports)]
4551 use super::*;
4552
4553 /// The sub-dialect options for Teradata.
4554 ///
4555 /// # Working with unknown values
4556 ///
4557 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4558 /// additional enum variants at any time. Adding new variants is not considered
4559 /// a breaking change. Applications should write their code in anticipation of:
4560 ///
4561 /// - New values appearing in future releases of the client library, **and**
4562 /// - New values received dynamically, without application changes.
4563 ///
4564 /// Please consult the [Working with enums] section in the user guide for some
4565 /// guidelines.
4566 ///
4567 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4568 #[derive(Clone, Debug, PartialEq)]
4569 #[non_exhaustive]
4570 pub enum Mode {
4571 /// Unspecified mode.
4572 Unspecified,
4573 /// Teradata SQL mode.
4574 Sql,
4575 /// BTEQ mode (which includes SQL).
4576 Bteq,
4577 /// If set, the enum was initialized with an unknown value.
4578 ///
4579 /// Applications can examine the value using [Mode::value] or
4580 /// [Mode::name].
4581 UnknownValue(mode::UnknownValue),
4582 }
4583
4584 #[doc(hidden)]
4585 pub mod mode {
4586 #[allow(unused_imports)]
4587 use super::*;
4588 #[derive(Clone, Debug, PartialEq)]
4589 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4590 }
4591
4592 impl Mode {
4593 /// Gets the enum value.
4594 ///
4595 /// Returns `None` if the enum contains an unknown value deserialized from
4596 /// the string representation of enums.
4597 pub fn value(&self) -> std::option::Option<i32> {
4598 match self {
4599 Self::Unspecified => std::option::Option::Some(0),
4600 Self::Sql => std::option::Option::Some(1),
4601 Self::Bteq => std::option::Option::Some(2),
4602 Self::UnknownValue(u) => u.0.value(),
4603 }
4604 }
4605
4606 /// Gets the enum value as a string.
4607 ///
4608 /// Returns `None` if the enum contains an unknown value deserialized from
4609 /// the integer representation of enums.
4610 pub fn name(&self) -> std::option::Option<&str> {
4611 match self {
4612 Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
4613 Self::Sql => std::option::Option::Some("SQL"),
4614 Self::Bteq => std::option::Option::Some("BTEQ"),
4615 Self::UnknownValue(u) => u.0.name(),
4616 }
4617 }
4618 }
4619
4620 impl std::default::Default for Mode {
4621 fn default() -> Self {
4622 use std::convert::From;
4623 Self::from(0)
4624 }
4625 }
4626
4627 impl std::fmt::Display for Mode {
4628 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4629 wkt::internal::display_enum(f, self.name(), self.value())
4630 }
4631 }
4632
4633 impl std::convert::From<i32> for Mode {
4634 fn from(value: i32) -> Self {
4635 match value {
4636 0 => Self::Unspecified,
4637 1 => Self::Sql,
4638 2 => Self::Bteq,
4639 _ => Self::UnknownValue(mode::UnknownValue(
4640 wkt::internal::UnknownEnumValue::Integer(value),
4641 )),
4642 }
4643 }
4644 }
4645
4646 impl std::convert::From<&str> for Mode {
4647 fn from(value: &str) -> Self {
4648 use std::string::ToString;
4649 match value {
4650 "MODE_UNSPECIFIED" => Self::Unspecified,
4651 "SQL" => Self::Sql,
4652 "BTEQ" => Self::Bteq,
4653 _ => Self::UnknownValue(mode::UnknownValue(
4654 wkt::internal::UnknownEnumValue::String(value.to_string()),
4655 )),
4656 }
4657 }
4658 }
4659
4660 impl serde::ser::Serialize for Mode {
4661 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4662 where
4663 S: serde::Serializer,
4664 {
4665 match self {
4666 Self::Unspecified => serializer.serialize_i32(0),
4667 Self::Sql => serializer.serialize_i32(1),
4668 Self::Bteq => serializer.serialize_i32(2),
4669 Self::UnknownValue(u) => u.0.serialize(serializer),
4670 }
4671 }
4672 }
4673
4674 impl<'de> serde::de::Deserialize<'de> for Mode {
4675 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4676 where
4677 D: serde::Deserializer<'de>,
4678 {
4679 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
4680 ".google.cloud.bigquery.migration.v2.TeradataDialect.Mode",
4681 ))
4682 }
4683 }
4684}
4685
4686/// The dialect definition for Oracle.
4687#[derive(Clone, Default, PartialEq)]
4688#[non_exhaustive]
4689pub struct OracleDialect {
4690 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4691}
4692
4693impl OracleDialect {
4694 /// Creates a new default instance.
4695 pub fn new() -> Self {
4696 std::default::Default::default()
4697 }
4698}
4699
4700impl wkt::message::Message for OracleDialect {
4701 fn typename() -> &'static str {
4702 "type.googleapis.com/google.cloud.bigquery.migration.v2.OracleDialect"
4703 }
4704}
4705
4706/// The dialect definition for SparkSQL.
4707#[derive(Clone, Default, PartialEq)]
4708#[non_exhaustive]
4709pub struct SparkSQLDialect {
4710 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4711}
4712
4713impl SparkSQLDialect {
4714 /// Creates a new default instance.
4715 pub fn new() -> Self {
4716 std::default::Default::default()
4717 }
4718}
4719
4720impl wkt::message::Message for SparkSQLDialect {
4721 fn typename() -> &'static str {
4722 "type.googleapis.com/google.cloud.bigquery.migration.v2.SparkSQLDialect"
4723 }
4724}
4725
4726/// The dialect definition for Snowflake.
4727#[derive(Clone, Default, PartialEq)]
4728#[non_exhaustive]
4729pub struct SnowflakeDialect {
4730 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4731}
4732
4733impl SnowflakeDialect {
4734 /// Creates a new default instance.
4735 pub fn new() -> Self {
4736 std::default::Default::default()
4737 }
4738}
4739
4740impl wkt::message::Message for SnowflakeDialect {
4741 fn typename() -> &'static str {
4742 "type.googleapis.com/google.cloud.bigquery.migration.v2.SnowflakeDialect"
4743 }
4744}
4745
4746/// The dialect definition for Netezza.
4747#[derive(Clone, Default, PartialEq)]
4748#[non_exhaustive]
4749pub struct NetezzaDialect {
4750 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4751}
4752
4753impl NetezzaDialect {
4754 /// Creates a new default instance.
4755 pub fn new() -> Self {
4756 std::default::Default::default()
4757 }
4758}
4759
4760impl wkt::message::Message for NetezzaDialect {
4761 fn typename() -> &'static str {
4762 "type.googleapis.com/google.cloud.bigquery.migration.v2.NetezzaDialect"
4763 }
4764}
4765
4766/// The dialect definition for Azure Synapse.
4767#[derive(Clone, Default, PartialEq)]
4768#[non_exhaustive]
4769pub struct AzureSynapseDialect {
4770 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4771}
4772
4773impl AzureSynapseDialect {
4774 /// Creates a new default instance.
4775 pub fn new() -> Self {
4776 std::default::Default::default()
4777 }
4778}
4779
4780impl wkt::message::Message for AzureSynapseDialect {
4781 fn typename() -> &'static str {
4782 "type.googleapis.com/google.cloud.bigquery.migration.v2.AzureSynapseDialect"
4783 }
4784}
4785
4786/// The dialect definition for Vertica.
4787#[derive(Clone, Default, PartialEq)]
4788#[non_exhaustive]
4789pub struct VerticaDialect {
4790 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4791}
4792
4793impl VerticaDialect {
4794 /// Creates a new default instance.
4795 pub fn new() -> Self {
4796 std::default::Default::default()
4797 }
4798}
4799
4800impl wkt::message::Message for VerticaDialect {
4801 fn typename() -> &'static str {
4802 "type.googleapis.com/google.cloud.bigquery.migration.v2.VerticaDialect"
4803 }
4804}
4805
4806/// The dialect definition for SQL Server.
4807#[derive(Clone, Default, PartialEq)]
4808#[non_exhaustive]
4809pub struct SQLServerDialect {
4810 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4811}
4812
4813impl SQLServerDialect {
4814 /// Creates a new default instance.
4815 pub fn new() -> Self {
4816 std::default::Default::default()
4817 }
4818}
4819
4820impl wkt::message::Message for SQLServerDialect {
4821 fn typename() -> &'static str {
4822 "type.googleapis.com/google.cloud.bigquery.migration.v2.SQLServerDialect"
4823 }
4824}
4825
4826/// The dialect definition for Postgresql.
4827#[derive(Clone, Default, PartialEq)]
4828#[non_exhaustive]
4829pub struct PostgresqlDialect {
4830 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4831}
4832
4833impl PostgresqlDialect {
4834 /// Creates a new default instance.
4835 pub fn new() -> Self {
4836 std::default::Default::default()
4837 }
4838}
4839
4840impl wkt::message::Message for PostgresqlDialect {
4841 fn typename() -> &'static str {
4842 "type.googleapis.com/google.cloud.bigquery.migration.v2.PostgresqlDialect"
4843 }
4844}
4845
4846/// The dialect definition for Presto.
4847#[derive(Clone, Default, PartialEq)]
4848#[non_exhaustive]
4849pub struct PrestoDialect {
4850 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4851}
4852
4853impl PrestoDialect {
4854 /// Creates a new default instance.
4855 pub fn new() -> Self {
4856 std::default::Default::default()
4857 }
4858}
4859
4860impl wkt::message::Message for PrestoDialect {
4861 fn typename() -> &'static str {
4862 "type.googleapis.com/google.cloud.bigquery.migration.v2.PrestoDialect"
4863 }
4864}
4865
4866/// The dialect definition for MySQL.
4867#[derive(Clone, Default, PartialEq)]
4868#[non_exhaustive]
4869pub struct MySQLDialect {
4870 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4871}
4872
4873impl MySQLDialect {
4874 /// Creates a new default instance.
4875 pub fn new() -> Self {
4876 std::default::Default::default()
4877 }
4878}
4879
4880impl wkt::message::Message for MySQLDialect {
4881 fn typename() -> &'static str {
4882 "type.googleapis.com/google.cloud.bigquery.migration.v2.MySQLDialect"
4883 }
4884}
4885
4886/// The dialect definition for DB2.
4887#[derive(Clone, Default, PartialEq)]
4888#[non_exhaustive]
4889pub struct DB2Dialect {
4890 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4891}
4892
4893impl DB2Dialect {
4894 /// Creates a new default instance.
4895 pub fn new() -> Self {
4896 std::default::Default::default()
4897 }
4898}
4899
4900impl wkt::message::Message for DB2Dialect {
4901 fn typename() -> &'static str {
4902 "type.googleapis.com/google.cloud.bigquery.migration.v2.DB2Dialect"
4903 }
4904}
4905
4906/// The dialect definition for SQLite.
4907#[derive(Clone, Default, PartialEq)]
4908#[non_exhaustive]
4909pub struct SQLiteDialect {
4910 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4911}
4912
4913impl SQLiteDialect {
4914 /// Creates a new default instance.
4915 pub fn new() -> Self {
4916 std::default::Default::default()
4917 }
4918}
4919
4920impl wkt::message::Message for SQLiteDialect {
4921 fn typename() -> &'static str {
4922 "type.googleapis.com/google.cloud.bigquery.migration.v2.SQLiteDialect"
4923 }
4924}
4925
4926/// The dialect definition for Greenplum.
4927#[derive(Clone, Default, PartialEq)]
4928#[non_exhaustive]
4929pub struct GreenplumDialect {
4930 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4931}
4932
4933impl GreenplumDialect {
4934 /// Creates a new default instance.
4935 pub fn new() -> Self {
4936 std::default::Default::default()
4937 }
4938}
4939
4940impl wkt::message::Message for GreenplumDialect {
4941 fn typename() -> &'static str {
4942 "type.googleapis.com/google.cloud.bigquery.migration.v2.GreenplumDialect"
4943 }
4944}
4945
4946/// Represents a map of name mappings using a list of key:value proto messages of
4947/// existing name to desired output name.
4948#[derive(Clone, Default, PartialEq)]
4949#[non_exhaustive]
4950pub struct ObjectNameMappingList {
4951 /// The elements of the object name map.
4952 pub name_map: std::vec::Vec<crate::model::ObjectNameMapping>,
4953
4954 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4955}
4956
4957impl ObjectNameMappingList {
4958 /// Creates a new default instance.
4959 pub fn new() -> Self {
4960 std::default::Default::default()
4961 }
4962
4963 /// Sets the value of [name_map][crate::model::ObjectNameMappingList::name_map].
4964 ///
4965 /// # Example
4966 /// ```ignore,no_run
4967 /// # use google_cloud_bigquery_migration_v2::model::ObjectNameMappingList;
4968 /// use google_cloud_bigquery_migration_v2::model::ObjectNameMapping;
4969 /// let x = ObjectNameMappingList::new()
4970 /// .set_name_map([
4971 /// ObjectNameMapping::default()/* use setters */,
4972 /// ObjectNameMapping::default()/* use (different) setters */,
4973 /// ]);
4974 /// ```
4975 pub fn set_name_map<T, V>(mut self, v: T) -> Self
4976 where
4977 T: std::iter::IntoIterator<Item = V>,
4978 V: std::convert::Into<crate::model::ObjectNameMapping>,
4979 {
4980 use std::iter::Iterator;
4981 self.name_map = v.into_iter().map(|i| i.into()).collect();
4982 self
4983 }
4984}
4985
4986impl wkt::message::Message for ObjectNameMappingList {
4987 fn typename() -> &'static str {
4988 "type.googleapis.com/google.cloud.bigquery.migration.v2.ObjectNameMappingList"
4989 }
4990}
4991
4992/// Represents a key-value pair of NameMappingKey to NameMappingValue to
4993/// represent the mapping of SQL names from the input value to desired output.
4994#[derive(Clone, Default, PartialEq)]
4995#[non_exhaustive]
4996pub struct ObjectNameMapping {
4997 /// The name of the object in source that is being mapped.
4998 pub source: std::option::Option<crate::model::NameMappingKey>,
4999
5000 /// The desired target name of the object that is being mapped.
5001 pub target: std::option::Option<crate::model::NameMappingValue>,
5002
5003 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5004}
5005
5006impl ObjectNameMapping {
5007 /// Creates a new default instance.
5008 pub fn new() -> Self {
5009 std::default::Default::default()
5010 }
5011
5012 /// Sets the value of [source][crate::model::ObjectNameMapping::source].
5013 ///
5014 /// # Example
5015 /// ```ignore,no_run
5016 /// # use google_cloud_bigquery_migration_v2::model::ObjectNameMapping;
5017 /// use google_cloud_bigquery_migration_v2::model::NameMappingKey;
5018 /// let x = ObjectNameMapping::new().set_source(NameMappingKey::default()/* use setters */);
5019 /// ```
5020 pub fn set_source<T>(mut self, v: T) -> Self
5021 where
5022 T: std::convert::Into<crate::model::NameMappingKey>,
5023 {
5024 self.source = std::option::Option::Some(v.into());
5025 self
5026 }
5027
5028 /// Sets or clears the value of [source][crate::model::ObjectNameMapping::source].
5029 ///
5030 /// # Example
5031 /// ```ignore,no_run
5032 /// # use google_cloud_bigquery_migration_v2::model::ObjectNameMapping;
5033 /// use google_cloud_bigquery_migration_v2::model::NameMappingKey;
5034 /// let x = ObjectNameMapping::new().set_or_clear_source(Some(NameMappingKey::default()/* use setters */));
5035 /// let x = ObjectNameMapping::new().set_or_clear_source(None::<NameMappingKey>);
5036 /// ```
5037 pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
5038 where
5039 T: std::convert::Into<crate::model::NameMappingKey>,
5040 {
5041 self.source = v.map(|x| x.into());
5042 self
5043 }
5044
5045 /// Sets the value of [target][crate::model::ObjectNameMapping::target].
5046 ///
5047 /// # Example
5048 /// ```ignore,no_run
5049 /// # use google_cloud_bigquery_migration_v2::model::ObjectNameMapping;
5050 /// use google_cloud_bigquery_migration_v2::model::NameMappingValue;
5051 /// let x = ObjectNameMapping::new().set_target(NameMappingValue::default()/* use setters */);
5052 /// ```
5053 pub fn set_target<T>(mut self, v: T) -> Self
5054 where
5055 T: std::convert::Into<crate::model::NameMappingValue>,
5056 {
5057 self.target = std::option::Option::Some(v.into());
5058 self
5059 }
5060
5061 /// Sets or clears the value of [target][crate::model::ObjectNameMapping::target].
5062 ///
5063 /// # Example
5064 /// ```ignore,no_run
5065 /// # use google_cloud_bigquery_migration_v2::model::ObjectNameMapping;
5066 /// use google_cloud_bigquery_migration_v2::model::NameMappingValue;
5067 /// let x = ObjectNameMapping::new().set_or_clear_target(Some(NameMappingValue::default()/* use setters */));
5068 /// let x = ObjectNameMapping::new().set_or_clear_target(None::<NameMappingValue>);
5069 /// ```
5070 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
5071 where
5072 T: std::convert::Into<crate::model::NameMappingValue>,
5073 {
5074 self.target = v.map(|x| x.into());
5075 self
5076 }
5077}
5078
5079impl wkt::message::Message for ObjectNameMapping {
5080 fn typename() -> &'static str {
5081 "type.googleapis.com/google.cloud.bigquery.migration.v2.ObjectNameMapping"
5082 }
5083}
5084
5085/// The potential components of a full name mapping that will be mapped
5086/// during translation in the source data warehouse.
5087#[derive(Clone, Default, PartialEq)]
5088#[non_exhaustive]
5089pub struct NameMappingKey {
5090 /// The type of object that is being mapped.
5091 pub r#type: crate::model::name_mapping_key::Type,
5092
5093 /// The database name (BigQuery project ID equivalent in the source data
5094 /// warehouse).
5095 pub database: std::string::String,
5096
5097 /// The schema name (BigQuery dataset equivalent in the source data warehouse).
5098 pub schema: std::string::String,
5099
5100 /// The relation name (BigQuery table or view equivalent in the source data
5101 /// warehouse).
5102 pub relation: std::string::String,
5103
5104 /// The attribute name (BigQuery column equivalent in the source data
5105 /// warehouse).
5106 pub attribute: std::string::String,
5107
5108 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5109}
5110
5111impl NameMappingKey {
5112 /// Creates a new default instance.
5113 pub fn new() -> Self {
5114 std::default::Default::default()
5115 }
5116
5117 /// Sets the value of [r#type][crate::model::NameMappingKey::type].
5118 ///
5119 /// # Example
5120 /// ```ignore,no_run
5121 /// # use google_cloud_bigquery_migration_v2::model::NameMappingKey;
5122 /// use google_cloud_bigquery_migration_v2::model::name_mapping_key::Type;
5123 /// let x0 = NameMappingKey::new().set_type(Type::Database);
5124 /// let x1 = NameMappingKey::new().set_type(Type::Schema);
5125 /// let x2 = NameMappingKey::new().set_type(Type::Relation);
5126 /// ```
5127 pub fn set_type<T: std::convert::Into<crate::model::name_mapping_key::Type>>(
5128 mut self,
5129 v: T,
5130 ) -> Self {
5131 self.r#type = v.into();
5132 self
5133 }
5134
5135 /// Sets the value of [database][crate::model::NameMappingKey::database].
5136 ///
5137 /// # Example
5138 /// ```ignore,no_run
5139 /// # use google_cloud_bigquery_migration_v2::model::NameMappingKey;
5140 /// let x = NameMappingKey::new().set_database("example");
5141 /// ```
5142 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5143 self.database = v.into();
5144 self
5145 }
5146
5147 /// Sets the value of [schema][crate::model::NameMappingKey::schema].
5148 ///
5149 /// # Example
5150 /// ```ignore,no_run
5151 /// # use google_cloud_bigquery_migration_v2::model::NameMappingKey;
5152 /// let x = NameMappingKey::new().set_schema("example");
5153 /// ```
5154 pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5155 self.schema = v.into();
5156 self
5157 }
5158
5159 /// Sets the value of [relation][crate::model::NameMappingKey::relation].
5160 ///
5161 /// # Example
5162 /// ```ignore,no_run
5163 /// # use google_cloud_bigquery_migration_v2::model::NameMappingKey;
5164 /// let x = NameMappingKey::new().set_relation("example");
5165 /// ```
5166 pub fn set_relation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5167 self.relation = v.into();
5168 self
5169 }
5170
5171 /// Sets the value of [attribute][crate::model::NameMappingKey::attribute].
5172 ///
5173 /// # Example
5174 /// ```ignore,no_run
5175 /// # use google_cloud_bigquery_migration_v2::model::NameMappingKey;
5176 /// let x = NameMappingKey::new().set_attribute("example");
5177 /// ```
5178 pub fn set_attribute<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5179 self.attribute = v.into();
5180 self
5181 }
5182}
5183
5184impl wkt::message::Message for NameMappingKey {
5185 fn typename() -> &'static str {
5186 "type.googleapis.com/google.cloud.bigquery.migration.v2.NameMappingKey"
5187 }
5188}
5189
5190/// Defines additional types related to [NameMappingKey].
5191pub mod name_mapping_key {
5192 #[allow(unused_imports)]
5193 use super::*;
5194
5195 /// The type of the object that is being mapped.
5196 ///
5197 /// # Working with unknown values
5198 ///
5199 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5200 /// additional enum variants at any time. Adding new variants is not considered
5201 /// a breaking change. Applications should write their code in anticipation of:
5202 ///
5203 /// - New values appearing in future releases of the client library, **and**
5204 /// - New values received dynamically, without application changes.
5205 ///
5206 /// Please consult the [Working with enums] section in the user guide for some
5207 /// guidelines.
5208 ///
5209 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5210 #[derive(Clone, Debug, PartialEq)]
5211 #[non_exhaustive]
5212 pub enum Type {
5213 /// Unspecified name mapping type.
5214 Unspecified,
5215 /// The object being mapped is a database.
5216 Database,
5217 /// The object being mapped is a schema.
5218 Schema,
5219 /// The object being mapped is a relation.
5220 Relation,
5221 /// The object being mapped is an attribute.
5222 Attribute,
5223 /// The object being mapped is a relation alias.
5224 RelationAlias,
5225 /// The object being mapped is a an attribute alias.
5226 AttributeAlias,
5227 /// The object being mapped is a function.
5228 Function,
5229 /// If set, the enum was initialized with an unknown value.
5230 ///
5231 /// Applications can examine the value using [Type::value] or
5232 /// [Type::name].
5233 UnknownValue(r#type::UnknownValue),
5234 }
5235
5236 #[doc(hidden)]
5237 pub mod r#type {
5238 #[allow(unused_imports)]
5239 use super::*;
5240 #[derive(Clone, Debug, PartialEq)]
5241 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5242 }
5243
5244 impl Type {
5245 /// Gets the enum value.
5246 ///
5247 /// Returns `None` if the enum contains an unknown value deserialized from
5248 /// the string representation of enums.
5249 pub fn value(&self) -> std::option::Option<i32> {
5250 match self {
5251 Self::Unspecified => std::option::Option::Some(0),
5252 Self::Database => std::option::Option::Some(1),
5253 Self::Schema => std::option::Option::Some(2),
5254 Self::Relation => std::option::Option::Some(3),
5255 Self::Attribute => std::option::Option::Some(4),
5256 Self::RelationAlias => std::option::Option::Some(5),
5257 Self::AttributeAlias => std::option::Option::Some(6),
5258 Self::Function => std::option::Option::Some(7),
5259 Self::UnknownValue(u) => u.0.value(),
5260 }
5261 }
5262
5263 /// Gets the enum value as a string.
5264 ///
5265 /// Returns `None` if the enum contains an unknown value deserialized from
5266 /// the integer representation of enums.
5267 pub fn name(&self) -> std::option::Option<&str> {
5268 match self {
5269 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
5270 Self::Database => std::option::Option::Some("DATABASE"),
5271 Self::Schema => std::option::Option::Some("SCHEMA"),
5272 Self::Relation => std::option::Option::Some("RELATION"),
5273 Self::Attribute => std::option::Option::Some("ATTRIBUTE"),
5274 Self::RelationAlias => std::option::Option::Some("RELATION_ALIAS"),
5275 Self::AttributeAlias => std::option::Option::Some("ATTRIBUTE_ALIAS"),
5276 Self::Function => std::option::Option::Some("FUNCTION"),
5277 Self::UnknownValue(u) => u.0.name(),
5278 }
5279 }
5280 }
5281
5282 impl std::default::Default for Type {
5283 fn default() -> Self {
5284 use std::convert::From;
5285 Self::from(0)
5286 }
5287 }
5288
5289 impl std::fmt::Display for Type {
5290 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5291 wkt::internal::display_enum(f, self.name(), self.value())
5292 }
5293 }
5294
5295 impl std::convert::From<i32> for Type {
5296 fn from(value: i32) -> Self {
5297 match value {
5298 0 => Self::Unspecified,
5299 1 => Self::Database,
5300 2 => Self::Schema,
5301 3 => Self::Relation,
5302 4 => Self::Attribute,
5303 5 => Self::RelationAlias,
5304 6 => Self::AttributeAlias,
5305 7 => Self::Function,
5306 _ => Self::UnknownValue(r#type::UnknownValue(
5307 wkt::internal::UnknownEnumValue::Integer(value),
5308 )),
5309 }
5310 }
5311 }
5312
5313 impl std::convert::From<&str> for Type {
5314 fn from(value: &str) -> Self {
5315 use std::string::ToString;
5316 match value {
5317 "TYPE_UNSPECIFIED" => Self::Unspecified,
5318 "DATABASE" => Self::Database,
5319 "SCHEMA" => Self::Schema,
5320 "RELATION" => Self::Relation,
5321 "ATTRIBUTE" => Self::Attribute,
5322 "RELATION_ALIAS" => Self::RelationAlias,
5323 "ATTRIBUTE_ALIAS" => Self::AttributeAlias,
5324 "FUNCTION" => Self::Function,
5325 _ => Self::UnknownValue(r#type::UnknownValue(
5326 wkt::internal::UnknownEnumValue::String(value.to_string()),
5327 )),
5328 }
5329 }
5330 }
5331
5332 impl serde::ser::Serialize for Type {
5333 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5334 where
5335 S: serde::Serializer,
5336 {
5337 match self {
5338 Self::Unspecified => serializer.serialize_i32(0),
5339 Self::Database => serializer.serialize_i32(1),
5340 Self::Schema => serializer.serialize_i32(2),
5341 Self::Relation => serializer.serialize_i32(3),
5342 Self::Attribute => serializer.serialize_i32(4),
5343 Self::RelationAlias => serializer.serialize_i32(5),
5344 Self::AttributeAlias => serializer.serialize_i32(6),
5345 Self::Function => serializer.serialize_i32(7),
5346 Self::UnknownValue(u) => u.0.serialize(serializer),
5347 }
5348 }
5349 }
5350
5351 impl<'de> serde::de::Deserialize<'de> for Type {
5352 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5353 where
5354 D: serde::Deserializer<'de>,
5355 {
5356 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
5357 ".google.cloud.bigquery.migration.v2.NameMappingKey.Type",
5358 ))
5359 }
5360 }
5361}
5362
5363/// The potential components of a full name mapping that will be mapped
5364/// during translation in the target data warehouse.
5365#[derive(Clone, Default, PartialEq)]
5366#[non_exhaustive]
5367pub struct NameMappingValue {
5368 /// The database name (BigQuery project ID equivalent in the target data
5369 /// warehouse).
5370 pub database: std::string::String,
5371
5372 /// The schema name (BigQuery dataset equivalent in the target data warehouse).
5373 pub schema: std::string::String,
5374
5375 /// The relation name (BigQuery table or view equivalent in the target data
5376 /// warehouse).
5377 pub relation: std::string::String,
5378
5379 /// The attribute name (BigQuery column equivalent in the target data
5380 /// warehouse).
5381 pub attribute: std::string::String,
5382
5383 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5384}
5385
5386impl NameMappingValue {
5387 /// Creates a new default instance.
5388 pub fn new() -> Self {
5389 std::default::Default::default()
5390 }
5391
5392 /// Sets the value of [database][crate::model::NameMappingValue::database].
5393 ///
5394 /// # Example
5395 /// ```ignore,no_run
5396 /// # use google_cloud_bigquery_migration_v2::model::NameMappingValue;
5397 /// let x = NameMappingValue::new().set_database("example");
5398 /// ```
5399 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5400 self.database = v.into();
5401 self
5402 }
5403
5404 /// Sets the value of [schema][crate::model::NameMappingValue::schema].
5405 ///
5406 /// # Example
5407 /// ```ignore,no_run
5408 /// # use google_cloud_bigquery_migration_v2::model::NameMappingValue;
5409 /// let x = NameMappingValue::new().set_schema("example");
5410 /// ```
5411 pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5412 self.schema = v.into();
5413 self
5414 }
5415
5416 /// Sets the value of [relation][crate::model::NameMappingValue::relation].
5417 ///
5418 /// # Example
5419 /// ```ignore,no_run
5420 /// # use google_cloud_bigquery_migration_v2::model::NameMappingValue;
5421 /// let x = NameMappingValue::new().set_relation("example");
5422 /// ```
5423 pub fn set_relation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5424 self.relation = v.into();
5425 self
5426 }
5427
5428 /// Sets the value of [attribute][crate::model::NameMappingValue::attribute].
5429 ///
5430 /// # Example
5431 /// ```ignore,no_run
5432 /// # use google_cloud_bigquery_migration_v2::model::NameMappingValue;
5433 /// let x = NameMappingValue::new().set_attribute("example");
5434 /// ```
5435 pub fn set_attribute<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5436 self.attribute = v.into();
5437 self
5438 }
5439}
5440
5441impl wkt::message::Message for NameMappingValue {
5442 fn typename() -> &'static str {
5443 "type.googleapis.com/google.cloud.bigquery.migration.v2.NameMappingValue"
5444 }
5445}
5446
5447/// Represents the default source environment values for the translation.
5448#[derive(Clone, Default, PartialEq)]
5449#[non_exhaustive]
5450pub struct SourceEnv {
5451 /// The default database name to fully qualify SQL objects when their database
5452 /// name is missing.
5453 pub default_database: std::string::String,
5454
5455 /// The schema search path. When SQL objects are missing schema name,
5456 /// translation engine will search through this list to find the value.
5457 pub schema_search_path: std::vec::Vec<std::string::String>,
5458
5459 /// Optional. Expects a valid BigQuery dataset ID that exists, e.g.,
5460 /// project-123.metadata_store_123. If specified, translation will search and
5461 /// read the required schema information from a metadata store in this dataset.
5462 /// If metadata store doesn't exist, translation will parse the metadata file
5463 /// and upload the schema info to a temp table in the dataset to speed up
5464 /// future translation jobs.
5465 pub metadata_store_dataset: std::string::String,
5466
5467 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5468}
5469
5470impl SourceEnv {
5471 /// Creates a new default instance.
5472 pub fn new() -> Self {
5473 std::default::Default::default()
5474 }
5475
5476 /// Sets the value of [default_database][crate::model::SourceEnv::default_database].
5477 ///
5478 /// # Example
5479 /// ```ignore,no_run
5480 /// # use google_cloud_bigquery_migration_v2::model::SourceEnv;
5481 /// let x = SourceEnv::new().set_default_database("example");
5482 /// ```
5483 pub fn set_default_database<T: std::convert::Into<std::string::String>>(
5484 mut self,
5485 v: T,
5486 ) -> Self {
5487 self.default_database = v.into();
5488 self
5489 }
5490
5491 /// Sets the value of [schema_search_path][crate::model::SourceEnv::schema_search_path].
5492 ///
5493 /// # Example
5494 /// ```ignore,no_run
5495 /// # use google_cloud_bigquery_migration_v2::model::SourceEnv;
5496 /// let x = SourceEnv::new().set_schema_search_path(["a", "b", "c"]);
5497 /// ```
5498 pub fn set_schema_search_path<T, V>(mut self, v: T) -> Self
5499 where
5500 T: std::iter::IntoIterator<Item = V>,
5501 V: std::convert::Into<std::string::String>,
5502 {
5503 use std::iter::Iterator;
5504 self.schema_search_path = v.into_iter().map(|i| i.into()).collect();
5505 self
5506 }
5507
5508 /// Sets the value of [metadata_store_dataset][crate::model::SourceEnv::metadata_store_dataset].
5509 ///
5510 /// # Example
5511 /// ```ignore,no_run
5512 /// # use google_cloud_bigquery_migration_v2::model::SourceEnv;
5513 /// let x = SourceEnv::new().set_metadata_store_dataset("example");
5514 /// ```
5515 pub fn set_metadata_store_dataset<T: std::convert::Into<std::string::String>>(
5516 mut self,
5517 v: T,
5518 ) -> Self {
5519 self.metadata_store_dataset = v.into();
5520 self
5521 }
5522}
5523
5524impl wkt::message::Message for SourceEnv {
5525 fn typename() -> &'static str {
5526 "type.googleapis.com/google.cloud.bigquery.migration.v2.SourceEnv"
5527 }
5528}
5529
5530/// The translation details to capture the necessary settings for a translation
5531/// job.
5532#[derive(Clone, Default, PartialEq)]
5533#[non_exhaustive]
5534pub struct TranslationDetails {
5535 /// The mapping from source to target SQL.
5536 pub source_target_mapping: std::vec::Vec<crate::model::SourceTargetMapping>,
5537
5538 /// The base URI for all writes to persistent storage.
5539 pub target_base_uri: std::string::String,
5540
5541 /// The default source environment values for the translation.
5542 pub source_environment: std::option::Option<crate::model::SourceEnvironment>,
5543
5544 /// The list of literal targets that will be directly returned to the response.
5545 /// Each entry consists of the constructed path, EXCLUDING the base path. Not
5546 /// providing a target_base_uri will prevent writing to persistent storage.
5547 pub target_return_literals: std::vec::Vec<std::string::String>,
5548
5549 /// The types of output to generate, e.g. sql, metadata,
5550 /// lineage_from_sql_scripts, etc. If not specified, a default set of
5551 /// targets will be generated. Some additional target types may be slower to
5552 /// generate. See the documentation for the set of available target types.
5553 pub target_types: std::vec::Vec<std::string::String>,
5554
5555 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5556}
5557
5558impl TranslationDetails {
5559 /// Creates a new default instance.
5560 pub fn new() -> Self {
5561 std::default::Default::default()
5562 }
5563
5564 /// Sets the value of [source_target_mapping][crate::model::TranslationDetails::source_target_mapping].
5565 ///
5566 /// # Example
5567 /// ```ignore,no_run
5568 /// # use google_cloud_bigquery_migration_v2::model::TranslationDetails;
5569 /// use google_cloud_bigquery_migration_v2::model::SourceTargetMapping;
5570 /// let x = TranslationDetails::new()
5571 /// .set_source_target_mapping([
5572 /// SourceTargetMapping::default()/* use setters */,
5573 /// SourceTargetMapping::default()/* use (different) setters */,
5574 /// ]);
5575 /// ```
5576 pub fn set_source_target_mapping<T, V>(mut self, v: T) -> Self
5577 where
5578 T: std::iter::IntoIterator<Item = V>,
5579 V: std::convert::Into<crate::model::SourceTargetMapping>,
5580 {
5581 use std::iter::Iterator;
5582 self.source_target_mapping = v.into_iter().map(|i| i.into()).collect();
5583 self
5584 }
5585
5586 /// Sets the value of [target_base_uri][crate::model::TranslationDetails::target_base_uri].
5587 ///
5588 /// # Example
5589 /// ```ignore,no_run
5590 /// # use google_cloud_bigquery_migration_v2::model::TranslationDetails;
5591 /// let x = TranslationDetails::new().set_target_base_uri("example");
5592 /// ```
5593 pub fn set_target_base_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5594 self.target_base_uri = v.into();
5595 self
5596 }
5597
5598 /// Sets the value of [source_environment][crate::model::TranslationDetails::source_environment].
5599 ///
5600 /// # Example
5601 /// ```ignore,no_run
5602 /// # use google_cloud_bigquery_migration_v2::model::TranslationDetails;
5603 /// use google_cloud_bigquery_migration_v2::model::SourceEnvironment;
5604 /// let x = TranslationDetails::new().set_source_environment(SourceEnvironment::default()/* use setters */);
5605 /// ```
5606 pub fn set_source_environment<T>(mut self, v: T) -> Self
5607 where
5608 T: std::convert::Into<crate::model::SourceEnvironment>,
5609 {
5610 self.source_environment = std::option::Option::Some(v.into());
5611 self
5612 }
5613
5614 /// Sets or clears the value of [source_environment][crate::model::TranslationDetails::source_environment].
5615 ///
5616 /// # Example
5617 /// ```ignore,no_run
5618 /// # use google_cloud_bigquery_migration_v2::model::TranslationDetails;
5619 /// use google_cloud_bigquery_migration_v2::model::SourceEnvironment;
5620 /// let x = TranslationDetails::new().set_or_clear_source_environment(Some(SourceEnvironment::default()/* use setters */));
5621 /// let x = TranslationDetails::new().set_or_clear_source_environment(None::<SourceEnvironment>);
5622 /// ```
5623 pub fn set_or_clear_source_environment<T>(mut self, v: std::option::Option<T>) -> Self
5624 where
5625 T: std::convert::Into<crate::model::SourceEnvironment>,
5626 {
5627 self.source_environment = v.map(|x| x.into());
5628 self
5629 }
5630
5631 /// Sets the value of [target_return_literals][crate::model::TranslationDetails::target_return_literals].
5632 ///
5633 /// # Example
5634 /// ```ignore,no_run
5635 /// # use google_cloud_bigquery_migration_v2::model::TranslationDetails;
5636 /// let x = TranslationDetails::new().set_target_return_literals(["a", "b", "c"]);
5637 /// ```
5638 pub fn set_target_return_literals<T, V>(mut self, v: T) -> Self
5639 where
5640 T: std::iter::IntoIterator<Item = V>,
5641 V: std::convert::Into<std::string::String>,
5642 {
5643 use std::iter::Iterator;
5644 self.target_return_literals = v.into_iter().map(|i| i.into()).collect();
5645 self
5646 }
5647
5648 /// Sets the value of [target_types][crate::model::TranslationDetails::target_types].
5649 ///
5650 /// # Example
5651 /// ```ignore,no_run
5652 /// # use google_cloud_bigquery_migration_v2::model::TranslationDetails;
5653 /// let x = TranslationDetails::new().set_target_types(["a", "b", "c"]);
5654 /// ```
5655 pub fn set_target_types<T, V>(mut self, v: T) -> Self
5656 where
5657 T: std::iter::IntoIterator<Item = V>,
5658 V: std::convert::Into<std::string::String>,
5659 {
5660 use std::iter::Iterator;
5661 self.target_types = v.into_iter().map(|i| i.into()).collect();
5662 self
5663 }
5664}
5665
5666impl wkt::message::Message for TranslationDetails {
5667 fn typename() -> &'static str {
5668 "type.googleapis.com/google.cloud.bigquery.migration.v2.TranslationDetails"
5669 }
5670}
5671
5672/// Represents one mapping from a source SQL to a target SQL.
5673#[derive(Clone, Default, PartialEq)]
5674#[non_exhaustive]
5675pub struct SourceTargetMapping {
5676 /// The source SQL or the path to it.
5677 pub source_spec: std::option::Option<crate::model::SourceSpec>,
5678
5679 /// The target SQL or the path for it.
5680 pub target_spec: std::option::Option<crate::model::TargetSpec>,
5681
5682 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5683}
5684
5685impl SourceTargetMapping {
5686 /// Creates a new default instance.
5687 pub fn new() -> Self {
5688 std::default::Default::default()
5689 }
5690
5691 /// Sets the value of [source_spec][crate::model::SourceTargetMapping::source_spec].
5692 ///
5693 /// # Example
5694 /// ```ignore,no_run
5695 /// # use google_cloud_bigquery_migration_v2::model::SourceTargetMapping;
5696 /// use google_cloud_bigquery_migration_v2::model::SourceSpec;
5697 /// let x = SourceTargetMapping::new().set_source_spec(SourceSpec::default()/* use setters */);
5698 /// ```
5699 pub fn set_source_spec<T>(mut self, v: T) -> Self
5700 where
5701 T: std::convert::Into<crate::model::SourceSpec>,
5702 {
5703 self.source_spec = std::option::Option::Some(v.into());
5704 self
5705 }
5706
5707 /// Sets or clears the value of [source_spec][crate::model::SourceTargetMapping::source_spec].
5708 ///
5709 /// # Example
5710 /// ```ignore,no_run
5711 /// # use google_cloud_bigquery_migration_v2::model::SourceTargetMapping;
5712 /// use google_cloud_bigquery_migration_v2::model::SourceSpec;
5713 /// let x = SourceTargetMapping::new().set_or_clear_source_spec(Some(SourceSpec::default()/* use setters */));
5714 /// let x = SourceTargetMapping::new().set_or_clear_source_spec(None::<SourceSpec>);
5715 /// ```
5716 pub fn set_or_clear_source_spec<T>(mut self, v: std::option::Option<T>) -> Self
5717 where
5718 T: std::convert::Into<crate::model::SourceSpec>,
5719 {
5720 self.source_spec = v.map(|x| x.into());
5721 self
5722 }
5723
5724 /// Sets the value of [target_spec][crate::model::SourceTargetMapping::target_spec].
5725 ///
5726 /// # Example
5727 /// ```ignore,no_run
5728 /// # use google_cloud_bigquery_migration_v2::model::SourceTargetMapping;
5729 /// use google_cloud_bigquery_migration_v2::model::TargetSpec;
5730 /// let x = SourceTargetMapping::new().set_target_spec(TargetSpec::default()/* use setters */);
5731 /// ```
5732 pub fn set_target_spec<T>(mut self, v: T) -> Self
5733 where
5734 T: std::convert::Into<crate::model::TargetSpec>,
5735 {
5736 self.target_spec = std::option::Option::Some(v.into());
5737 self
5738 }
5739
5740 /// Sets or clears the value of [target_spec][crate::model::SourceTargetMapping::target_spec].
5741 ///
5742 /// # Example
5743 /// ```ignore,no_run
5744 /// # use google_cloud_bigquery_migration_v2::model::SourceTargetMapping;
5745 /// use google_cloud_bigquery_migration_v2::model::TargetSpec;
5746 /// let x = SourceTargetMapping::new().set_or_clear_target_spec(Some(TargetSpec::default()/* use setters */));
5747 /// let x = SourceTargetMapping::new().set_or_clear_target_spec(None::<TargetSpec>);
5748 /// ```
5749 pub fn set_or_clear_target_spec<T>(mut self, v: std::option::Option<T>) -> Self
5750 where
5751 T: std::convert::Into<crate::model::TargetSpec>,
5752 {
5753 self.target_spec = v.map(|x| x.into());
5754 self
5755 }
5756}
5757
5758impl wkt::message::Message for SourceTargetMapping {
5759 fn typename() -> &'static str {
5760 "type.googleapis.com/google.cloud.bigquery.migration.v2.SourceTargetMapping"
5761 }
5762}
5763
5764/// Represents one path to the location that holds source data.
5765#[derive(Clone, Default, PartialEq)]
5766#[non_exhaustive]
5767pub struct SourceSpec {
5768 /// Optional. The optional field to specify the encoding of the sql bytes.
5769 pub encoding: std::string::String,
5770
5771 /// The specific source SQL.
5772 pub source: std::option::Option<crate::model::source_spec::Source>,
5773
5774 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5775}
5776
5777impl SourceSpec {
5778 /// Creates a new default instance.
5779 pub fn new() -> Self {
5780 std::default::Default::default()
5781 }
5782
5783 /// Sets the value of [encoding][crate::model::SourceSpec::encoding].
5784 ///
5785 /// # Example
5786 /// ```ignore,no_run
5787 /// # use google_cloud_bigquery_migration_v2::model::SourceSpec;
5788 /// let x = SourceSpec::new().set_encoding("example");
5789 /// ```
5790 pub fn set_encoding<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5791 self.encoding = v.into();
5792 self
5793 }
5794
5795 /// Sets the value of [source][crate::model::SourceSpec::source].
5796 ///
5797 /// Note that all the setters affecting `source` are mutually
5798 /// exclusive.
5799 ///
5800 /// # Example
5801 /// ```ignore,no_run
5802 /// # use google_cloud_bigquery_migration_v2::model::SourceSpec;
5803 /// use google_cloud_bigquery_migration_v2::model::source_spec::Source;
5804 /// let x = SourceSpec::new().set_source(Some(Source::BaseUri("example".to_string())));
5805 /// ```
5806 pub fn set_source<
5807 T: std::convert::Into<std::option::Option<crate::model::source_spec::Source>>,
5808 >(
5809 mut self,
5810 v: T,
5811 ) -> Self {
5812 self.source = v.into();
5813 self
5814 }
5815
5816 /// The value of [source][crate::model::SourceSpec::source]
5817 /// if it holds a `BaseUri`, `None` if the field is not set or
5818 /// holds a different branch.
5819 pub fn base_uri(&self) -> std::option::Option<&std::string::String> {
5820 #[allow(unreachable_patterns)]
5821 self.source.as_ref().and_then(|v| match v {
5822 crate::model::source_spec::Source::BaseUri(v) => std::option::Option::Some(v),
5823 _ => std::option::Option::None,
5824 })
5825 }
5826
5827 /// Sets the value of [source][crate::model::SourceSpec::source]
5828 /// to hold a `BaseUri`.
5829 ///
5830 /// Note that all the setters affecting `source` are
5831 /// mutually exclusive.
5832 ///
5833 /// # Example
5834 /// ```ignore,no_run
5835 /// # use google_cloud_bigquery_migration_v2::model::SourceSpec;
5836 /// let x = SourceSpec::new().set_base_uri("example");
5837 /// assert!(x.base_uri().is_some());
5838 /// assert!(x.literal().is_none());
5839 /// ```
5840 pub fn set_base_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5841 self.source =
5842 std::option::Option::Some(crate::model::source_spec::Source::BaseUri(v.into()));
5843 self
5844 }
5845
5846 /// The value of [source][crate::model::SourceSpec::source]
5847 /// if it holds a `Literal`, `None` if the field is not set or
5848 /// holds a different branch.
5849 pub fn literal(&self) -> std::option::Option<&std::boxed::Box<crate::model::Literal>> {
5850 #[allow(unreachable_patterns)]
5851 self.source.as_ref().and_then(|v| match v {
5852 crate::model::source_spec::Source::Literal(v) => std::option::Option::Some(v),
5853 _ => std::option::Option::None,
5854 })
5855 }
5856
5857 /// Sets the value of [source][crate::model::SourceSpec::source]
5858 /// to hold a `Literal`.
5859 ///
5860 /// Note that all the setters affecting `source` are
5861 /// mutually exclusive.
5862 ///
5863 /// # Example
5864 /// ```ignore,no_run
5865 /// # use google_cloud_bigquery_migration_v2::model::SourceSpec;
5866 /// use google_cloud_bigquery_migration_v2::model::Literal;
5867 /// let x = SourceSpec::new().set_literal(Literal::default()/* use setters */);
5868 /// assert!(x.literal().is_some());
5869 /// assert!(x.base_uri().is_none());
5870 /// ```
5871 pub fn set_literal<T: std::convert::Into<std::boxed::Box<crate::model::Literal>>>(
5872 mut self,
5873 v: T,
5874 ) -> Self {
5875 self.source =
5876 std::option::Option::Some(crate::model::source_spec::Source::Literal(v.into()));
5877 self
5878 }
5879}
5880
5881impl wkt::message::Message for SourceSpec {
5882 fn typename() -> &'static str {
5883 "type.googleapis.com/google.cloud.bigquery.migration.v2.SourceSpec"
5884 }
5885}
5886
5887/// Defines additional types related to [SourceSpec].
5888pub mod source_spec {
5889 #[allow(unused_imports)]
5890 use super::*;
5891
5892 /// The specific source SQL.
5893 #[derive(Clone, Debug, PartialEq)]
5894 #[non_exhaustive]
5895 pub enum Source {
5896 /// The base URI for all files to be read in as sources for translation.
5897 BaseUri(std::string::String),
5898 /// Source literal.
5899 Literal(std::boxed::Box<crate::model::Literal>),
5900 }
5901}
5902
5903/// Represents one path to the location that holds target data.
5904#[derive(Clone, Default, PartialEq)]
5905#[non_exhaustive]
5906pub struct TargetSpec {
5907 /// The relative path for the target data. Given source file
5908 /// `base_uri/input/sql`, the output would be
5909 /// `target_base_uri/sql/relative_path/input.sql`.
5910 pub relative_path: std::string::String,
5911
5912 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5913}
5914
5915impl TargetSpec {
5916 /// Creates a new default instance.
5917 pub fn new() -> Self {
5918 std::default::Default::default()
5919 }
5920
5921 /// Sets the value of [relative_path][crate::model::TargetSpec::relative_path].
5922 ///
5923 /// # Example
5924 /// ```ignore,no_run
5925 /// # use google_cloud_bigquery_migration_v2::model::TargetSpec;
5926 /// let x = TargetSpec::new().set_relative_path("example");
5927 /// ```
5928 pub fn set_relative_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5929 self.relative_path = v.into();
5930 self
5931 }
5932}
5933
5934impl wkt::message::Message for TargetSpec {
5935 fn typename() -> &'static str {
5936 "type.googleapis.com/google.cloud.bigquery.migration.v2.TargetSpec"
5937 }
5938}
5939
5940/// Literal data.
5941#[derive(Clone, Default, PartialEq)]
5942#[non_exhaustive]
5943pub struct Literal {
5944 /// Required. The identifier of the literal entry.
5945 pub relative_path: std::string::String,
5946
5947 /// The literal SQL contents.
5948 pub literal_data: std::option::Option<crate::model::literal::LiteralData>,
5949
5950 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5951}
5952
5953impl Literal {
5954 /// Creates a new default instance.
5955 pub fn new() -> Self {
5956 std::default::Default::default()
5957 }
5958
5959 /// Sets the value of [relative_path][crate::model::Literal::relative_path].
5960 ///
5961 /// # Example
5962 /// ```ignore,no_run
5963 /// # use google_cloud_bigquery_migration_v2::model::Literal;
5964 /// let x = Literal::new().set_relative_path("example");
5965 /// ```
5966 pub fn set_relative_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5967 self.relative_path = v.into();
5968 self
5969 }
5970
5971 /// Sets the value of [literal_data][crate::model::Literal::literal_data].
5972 ///
5973 /// Note that all the setters affecting `literal_data` are mutually
5974 /// exclusive.
5975 ///
5976 /// # Example
5977 /// ```ignore,no_run
5978 /// # use google_cloud_bigquery_migration_v2::model::Literal;
5979 /// use google_cloud_bigquery_migration_v2::model::literal::LiteralData;
5980 /// let x = Literal::new().set_literal_data(Some(LiteralData::LiteralString("example".to_string())));
5981 /// ```
5982 pub fn set_literal_data<
5983 T: std::convert::Into<std::option::Option<crate::model::literal::LiteralData>>,
5984 >(
5985 mut self,
5986 v: T,
5987 ) -> Self {
5988 self.literal_data = v.into();
5989 self
5990 }
5991
5992 /// The value of [literal_data][crate::model::Literal::literal_data]
5993 /// if it holds a `LiteralString`, `None` if the field is not set or
5994 /// holds a different branch.
5995 pub fn literal_string(&self) -> std::option::Option<&std::string::String> {
5996 #[allow(unreachable_patterns)]
5997 self.literal_data.as_ref().and_then(|v| match v {
5998 crate::model::literal::LiteralData::LiteralString(v) => std::option::Option::Some(v),
5999 _ => std::option::Option::None,
6000 })
6001 }
6002
6003 /// Sets the value of [literal_data][crate::model::Literal::literal_data]
6004 /// to hold a `LiteralString`.
6005 ///
6006 /// Note that all the setters affecting `literal_data` are
6007 /// mutually exclusive.
6008 ///
6009 /// # Example
6010 /// ```ignore,no_run
6011 /// # use google_cloud_bigquery_migration_v2::model::Literal;
6012 /// let x = Literal::new().set_literal_string("example");
6013 /// assert!(x.literal_string().is_some());
6014 /// assert!(x.literal_bytes().is_none());
6015 /// ```
6016 pub fn set_literal_string<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6017 self.literal_data =
6018 std::option::Option::Some(crate::model::literal::LiteralData::LiteralString(v.into()));
6019 self
6020 }
6021
6022 /// The value of [literal_data][crate::model::Literal::literal_data]
6023 /// if it holds a `LiteralBytes`, `None` if the field is not set or
6024 /// holds a different branch.
6025 pub fn literal_bytes(&self) -> std::option::Option<&::bytes::Bytes> {
6026 #[allow(unreachable_patterns)]
6027 self.literal_data.as_ref().and_then(|v| match v {
6028 crate::model::literal::LiteralData::LiteralBytes(v) => std::option::Option::Some(v),
6029 _ => std::option::Option::None,
6030 })
6031 }
6032
6033 /// Sets the value of [literal_data][crate::model::Literal::literal_data]
6034 /// to hold a `LiteralBytes`.
6035 ///
6036 /// Note that all the setters affecting `literal_data` are
6037 /// mutually exclusive.
6038 ///
6039 /// # Example
6040 /// ```ignore,no_run
6041 /// # use google_cloud_bigquery_migration_v2::model::Literal;
6042 /// let x = Literal::new().set_literal_bytes(bytes::Bytes::from_static(b"example"));
6043 /// assert!(x.literal_bytes().is_some());
6044 /// assert!(x.literal_string().is_none());
6045 /// ```
6046 pub fn set_literal_bytes<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6047 self.literal_data =
6048 std::option::Option::Some(crate::model::literal::LiteralData::LiteralBytes(v.into()));
6049 self
6050 }
6051}
6052
6053impl wkt::message::Message for Literal {
6054 fn typename() -> &'static str {
6055 "type.googleapis.com/google.cloud.bigquery.migration.v2.Literal"
6056 }
6057}
6058
6059/// Defines additional types related to [Literal].
6060pub mod literal {
6061 #[allow(unused_imports)]
6062 use super::*;
6063
6064 /// The literal SQL contents.
6065 #[derive(Clone, Debug, PartialEq)]
6066 #[non_exhaustive]
6067 pub enum LiteralData {
6068 /// Literal string data.
6069 LiteralString(std::string::String),
6070 /// Literal byte data.
6071 LiteralBytes(::bytes::Bytes),
6072 }
6073}
6074
6075/// Represents the default source environment values for the translation.
6076#[derive(Clone, Default, PartialEq)]
6077#[non_exhaustive]
6078pub struct SourceEnvironment {
6079 /// The default database name to fully qualify SQL objects when their database
6080 /// name is missing.
6081 pub default_database: std::string::String,
6082
6083 /// The schema search path. When SQL objects are missing schema name,
6084 /// translation engine will search through this list to find the value.
6085 pub schema_search_path: std::vec::Vec<std::string::String>,
6086
6087 /// Optional. Expects a validQ BigQuery dataset ID that exists, e.g.,
6088 /// project-123.metadata_store_123. If specified, translation will search and
6089 /// read the required schema information from a metadata store in this dataset.
6090 /// If metadata store doesn't exist, translation will parse the metadata file
6091 /// and upload the schema info to a temp table in the dataset to speed up
6092 /// future translation jobs.
6093 pub metadata_store_dataset: std::string::String,
6094
6095 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6096}
6097
6098impl SourceEnvironment {
6099 /// Creates a new default instance.
6100 pub fn new() -> Self {
6101 std::default::Default::default()
6102 }
6103
6104 /// Sets the value of [default_database][crate::model::SourceEnvironment::default_database].
6105 ///
6106 /// # Example
6107 /// ```ignore,no_run
6108 /// # use google_cloud_bigquery_migration_v2::model::SourceEnvironment;
6109 /// let x = SourceEnvironment::new().set_default_database("example");
6110 /// ```
6111 pub fn set_default_database<T: std::convert::Into<std::string::String>>(
6112 mut self,
6113 v: T,
6114 ) -> Self {
6115 self.default_database = v.into();
6116 self
6117 }
6118
6119 /// Sets the value of [schema_search_path][crate::model::SourceEnvironment::schema_search_path].
6120 ///
6121 /// # Example
6122 /// ```ignore,no_run
6123 /// # use google_cloud_bigquery_migration_v2::model::SourceEnvironment;
6124 /// let x = SourceEnvironment::new().set_schema_search_path(["a", "b", "c"]);
6125 /// ```
6126 pub fn set_schema_search_path<T, V>(mut self, v: T) -> Self
6127 where
6128 T: std::iter::IntoIterator<Item = V>,
6129 V: std::convert::Into<std::string::String>,
6130 {
6131 use std::iter::Iterator;
6132 self.schema_search_path = v.into_iter().map(|i| i.into()).collect();
6133 self
6134 }
6135
6136 /// Sets the value of [metadata_store_dataset][crate::model::SourceEnvironment::metadata_store_dataset].
6137 ///
6138 /// # Example
6139 /// ```ignore,no_run
6140 /// # use google_cloud_bigquery_migration_v2::model::SourceEnvironment;
6141 /// let x = SourceEnvironment::new().set_metadata_store_dataset("example");
6142 /// ```
6143 pub fn set_metadata_store_dataset<T: std::convert::Into<std::string::String>>(
6144 mut self,
6145 v: T,
6146 ) -> Self {
6147 self.metadata_store_dataset = v.into();
6148 self
6149 }
6150}
6151
6152impl wkt::message::Message for SourceEnvironment {
6153 fn typename() -> &'static str {
6154 "type.googleapis.com/google.cloud.bigquery.migration.v2.SourceEnvironment"
6155 }
6156}
6157
6158/// Details about a record.
6159#[derive(Clone, Default, PartialEq)]
6160#[non_exhaustive]
6161pub struct TranslationReportRecord {
6162 /// Severity of the translation record.
6163 pub severity: crate::model::translation_report_record::Severity,
6164
6165 /// Specifies the row from the source text where the error occurred (0 based).
6166 /// Example: 2
6167 pub script_line: i32,
6168
6169 /// Specifies the column from the source texts where the error occurred. (0
6170 /// based) example: 6
6171 pub script_column: i32,
6172
6173 /// Category of the error/warning. Example: SyntaxError
6174 pub category: std::string::String,
6175
6176 /// Detailed message of the record.
6177 pub message: std::string::String,
6178
6179 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6180}
6181
6182impl TranslationReportRecord {
6183 /// Creates a new default instance.
6184 pub fn new() -> Self {
6185 std::default::Default::default()
6186 }
6187
6188 /// Sets the value of [severity][crate::model::TranslationReportRecord::severity].
6189 ///
6190 /// # Example
6191 /// ```ignore,no_run
6192 /// # use google_cloud_bigquery_migration_v2::model::TranslationReportRecord;
6193 /// use google_cloud_bigquery_migration_v2::model::translation_report_record::Severity;
6194 /// let x0 = TranslationReportRecord::new().set_severity(Severity::Info);
6195 /// let x1 = TranslationReportRecord::new().set_severity(Severity::Warning);
6196 /// let x2 = TranslationReportRecord::new().set_severity(Severity::Error);
6197 /// ```
6198 pub fn set_severity<
6199 T: std::convert::Into<crate::model::translation_report_record::Severity>,
6200 >(
6201 mut self,
6202 v: T,
6203 ) -> Self {
6204 self.severity = v.into();
6205 self
6206 }
6207
6208 /// Sets the value of [script_line][crate::model::TranslationReportRecord::script_line].
6209 ///
6210 /// # Example
6211 /// ```ignore,no_run
6212 /// # use google_cloud_bigquery_migration_v2::model::TranslationReportRecord;
6213 /// let x = TranslationReportRecord::new().set_script_line(42);
6214 /// ```
6215 pub fn set_script_line<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6216 self.script_line = v.into();
6217 self
6218 }
6219
6220 /// Sets the value of [script_column][crate::model::TranslationReportRecord::script_column].
6221 ///
6222 /// # Example
6223 /// ```ignore,no_run
6224 /// # use google_cloud_bigquery_migration_v2::model::TranslationReportRecord;
6225 /// let x = TranslationReportRecord::new().set_script_column(42);
6226 /// ```
6227 pub fn set_script_column<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6228 self.script_column = v.into();
6229 self
6230 }
6231
6232 /// Sets the value of [category][crate::model::TranslationReportRecord::category].
6233 ///
6234 /// # Example
6235 /// ```ignore,no_run
6236 /// # use google_cloud_bigquery_migration_v2::model::TranslationReportRecord;
6237 /// let x = TranslationReportRecord::new().set_category("example");
6238 /// ```
6239 pub fn set_category<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6240 self.category = v.into();
6241 self
6242 }
6243
6244 /// Sets the value of [message][crate::model::TranslationReportRecord::message].
6245 ///
6246 /// # Example
6247 /// ```ignore,no_run
6248 /// # use google_cloud_bigquery_migration_v2::model::TranslationReportRecord;
6249 /// let x = TranslationReportRecord::new().set_message("example");
6250 /// ```
6251 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6252 self.message = v.into();
6253 self
6254 }
6255}
6256
6257impl wkt::message::Message for TranslationReportRecord {
6258 fn typename() -> &'static str {
6259 "type.googleapis.com/google.cloud.bigquery.migration.v2.TranslationReportRecord"
6260 }
6261}
6262
6263/// Defines additional types related to [TranslationReportRecord].
6264pub mod translation_report_record {
6265 #[allow(unused_imports)]
6266 use super::*;
6267
6268 /// The severity type of the record.
6269 ///
6270 /// # Working with unknown values
6271 ///
6272 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6273 /// additional enum variants at any time. Adding new variants is not considered
6274 /// a breaking change. Applications should write their code in anticipation of:
6275 ///
6276 /// - New values appearing in future releases of the client library, **and**
6277 /// - New values received dynamically, without application changes.
6278 ///
6279 /// Please consult the [Working with enums] section in the user guide for some
6280 /// guidelines.
6281 ///
6282 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6283 #[derive(Clone, Debug, PartialEq)]
6284 #[non_exhaustive]
6285 pub enum Severity {
6286 /// SeverityType not specified.
6287 Unspecified,
6288 /// INFO type.
6289 Info,
6290 /// WARNING type. The translated query may still provide useful information
6291 /// if all the report records are WARNING.
6292 Warning,
6293 /// ERROR type. Translation failed.
6294 Error,
6295 /// If set, the enum was initialized with an unknown value.
6296 ///
6297 /// Applications can examine the value using [Severity::value] or
6298 /// [Severity::name].
6299 UnknownValue(severity::UnknownValue),
6300 }
6301
6302 #[doc(hidden)]
6303 pub mod severity {
6304 #[allow(unused_imports)]
6305 use super::*;
6306 #[derive(Clone, Debug, PartialEq)]
6307 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6308 }
6309
6310 impl Severity {
6311 /// Gets the enum value.
6312 ///
6313 /// Returns `None` if the enum contains an unknown value deserialized from
6314 /// the string representation of enums.
6315 pub fn value(&self) -> std::option::Option<i32> {
6316 match self {
6317 Self::Unspecified => std::option::Option::Some(0),
6318 Self::Info => std::option::Option::Some(1),
6319 Self::Warning => std::option::Option::Some(2),
6320 Self::Error => std::option::Option::Some(3),
6321 Self::UnknownValue(u) => u.0.value(),
6322 }
6323 }
6324
6325 /// Gets the enum value as a string.
6326 ///
6327 /// Returns `None` if the enum contains an unknown value deserialized from
6328 /// the integer representation of enums.
6329 pub fn name(&self) -> std::option::Option<&str> {
6330 match self {
6331 Self::Unspecified => std::option::Option::Some("SEVERITY_UNSPECIFIED"),
6332 Self::Info => std::option::Option::Some("INFO"),
6333 Self::Warning => std::option::Option::Some("WARNING"),
6334 Self::Error => std::option::Option::Some("ERROR"),
6335 Self::UnknownValue(u) => u.0.name(),
6336 }
6337 }
6338 }
6339
6340 impl std::default::Default for Severity {
6341 fn default() -> Self {
6342 use std::convert::From;
6343 Self::from(0)
6344 }
6345 }
6346
6347 impl std::fmt::Display for Severity {
6348 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6349 wkt::internal::display_enum(f, self.name(), self.value())
6350 }
6351 }
6352
6353 impl std::convert::From<i32> for Severity {
6354 fn from(value: i32) -> Self {
6355 match value {
6356 0 => Self::Unspecified,
6357 1 => Self::Info,
6358 2 => Self::Warning,
6359 3 => Self::Error,
6360 _ => Self::UnknownValue(severity::UnknownValue(
6361 wkt::internal::UnknownEnumValue::Integer(value),
6362 )),
6363 }
6364 }
6365 }
6366
6367 impl std::convert::From<&str> for Severity {
6368 fn from(value: &str) -> Self {
6369 use std::string::ToString;
6370 match value {
6371 "SEVERITY_UNSPECIFIED" => Self::Unspecified,
6372 "INFO" => Self::Info,
6373 "WARNING" => Self::Warning,
6374 "ERROR" => Self::Error,
6375 _ => Self::UnknownValue(severity::UnknownValue(
6376 wkt::internal::UnknownEnumValue::String(value.to_string()),
6377 )),
6378 }
6379 }
6380 }
6381
6382 impl serde::ser::Serialize for Severity {
6383 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6384 where
6385 S: serde::Serializer,
6386 {
6387 match self {
6388 Self::Unspecified => serializer.serialize_i32(0),
6389 Self::Info => serializer.serialize_i32(1),
6390 Self::Warning => serializer.serialize_i32(2),
6391 Self::Error => serializer.serialize_i32(3),
6392 Self::UnknownValue(u) => u.0.serialize(serializer),
6393 }
6394 }
6395 }
6396
6397 impl<'de> serde::de::Deserialize<'de> for Severity {
6398 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6399 where
6400 D: serde::Deserializer<'de>,
6401 {
6402 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
6403 ".google.cloud.bigquery.migration.v2.TranslationReportRecord.Severity",
6404 ))
6405 }
6406 }
6407}
6408
6409/// A record in the aggregate CSV report for a migration workflow
6410#[derive(Clone, Default, PartialEq)]
6411#[non_exhaustive]
6412pub struct GcsReportLogMessage {
6413 /// Severity of the translation record.
6414 pub severity: std::string::String,
6415
6416 /// Category of the error/warning. Example: SyntaxError
6417 pub category: std::string::String,
6418
6419 /// The file path in which the error occurred
6420 pub file_path: std::string::String,
6421
6422 /// The file name in which the error occurred
6423 pub filename: std::string::String,
6424
6425 /// Specifies the row from the source text where the error occurred (0 based,
6426 /// -1 for messages without line location). Example: 2
6427 pub source_script_line: i32,
6428
6429 /// Specifies the column from the source texts where the error occurred. (0
6430 /// based, -1 for messages without column location) example: 6
6431 pub source_script_column: i32,
6432
6433 /// Detailed message of the record.
6434 pub message: std::string::String,
6435
6436 /// The script context (obfuscated) in which the error occurred
6437 pub script_context: std::string::String,
6438
6439 /// Category of the error/warning. Example: SyntaxError
6440 pub action: std::string::String,
6441
6442 /// Effect of the error/warning. Example: COMPATIBILITY
6443 pub effect: std::string::String,
6444
6445 /// Name of the affected object in the log message.
6446 pub object_name: std::string::String,
6447
6448 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6449}
6450
6451impl GcsReportLogMessage {
6452 /// Creates a new default instance.
6453 pub fn new() -> Self {
6454 std::default::Default::default()
6455 }
6456
6457 /// Sets the value of [severity][crate::model::GcsReportLogMessage::severity].
6458 ///
6459 /// # Example
6460 /// ```ignore,no_run
6461 /// # use google_cloud_bigquery_migration_v2::model::GcsReportLogMessage;
6462 /// let x = GcsReportLogMessage::new().set_severity("example");
6463 /// ```
6464 pub fn set_severity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6465 self.severity = v.into();
6466 self
6467 }
6468
6469 /// Sets the value of [category][crate::model::GcsReportLogMessage::category].
6470 ///
6471 /// # Example
6472 /// ```ignore,no_run
6473 /// # use google_cloud_bigquery_migration_v2::model::GcsReportLogMessage;
6474 /// let x = GcsReportLogMessage::new().set_category("example");
6475 /// ```
6476 pub fn set_category<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6477 self.category = v.into();
6478 self
6479 }
6480
6481 /// Sets the value of [file_path][crate::model::GcsReportLogMessage::file_path].
6482 ///
6483 /// # Example
6484 /// ```ignore,no_run
6485 /// # use google_cloud_bigquery_migration_v2::model::GcsReportLogMessage;
6486 /// let x = GcsReportLogMessage::new().set_file_path("example");
6487 /// ```
6488 pub fn set_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6489 self.file_path = v.into();
6490 self
6491 }
6492
6493 /// Sets the value of [filename][crate::model::GcsReportLogMessage::filename].
6494 ///
6495 /// # Example
6496 /// ```ignore,no_run
6497 /// # use google_cloud_bigquery_migration_v2::model::GcsReportLogMessage;
6498 /// let x = GcsReportLogMessage::new().set_filename("example");
6499 /// ```
6500 pub fn set_filename<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6501 self.filename = v.into();
6502 self
6503 }
6504
6505 /// Sets the value of [source_script_line][crate::model::GcsReportLogMessage::source_script_line].
6506 ///
6507 /// # Example
6508 /// ```ignore,no_run
6509 /// # use google_cloud_bigquery_migration_v2::model::GcsReportLogMessage;
6510 /// let x = GcsReportLogMessage::new().set_source_script_line(42);
6511 /// ```
6512 pub fn set_source_script_line<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6513 self.source_script_line = v.into();
6514 self
6515 }
6516
6517 /// Sets the value of [source_script_column][crate::model::GcsReportLogMessage::source_script_column].
6518 ///
6519 /// # Example
6520 /// ```ignore,no_run
6521 /// # use google_cloud_bigquery_migration_v2::model::GcsReportLogMessage;
6522 /// let x = GcsReportLogMessage::new().set_source_script_column(42);
6523 /// ```
6524 pub fn set_source_script_column<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6525 self.source_script_column = v.into();
6526 self
6527 }
6528
6529 /// Sets the value of [message][crate::model::GcsReportLogMessage::message].
6530 ///
6531 /// # Example
6532 /// ```ignore,no_run
6533 /// # use google_cloud_bigquery_migration_v2::model::GcsReportLogMessage;
6534 /// let x = GcsReportLogMessage::new().set_message("example");
6535 /// ```
6536 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6537 self.message = v.into();
6538 self
6539 }
6540
6541 /// Sets the value of [script_context][crate::model::GcsReportLogMessage::script_context].
6542 ///
6543 /// # Example
6544 /// ```ignore,no_run
6545 /// # use google_cloud_bigquery_migration_v2::model::GcsReportLogMessage;
6546 /// let x = GcsReportLogMessage::new().set_script_context("example");
6547 /// ```
6548 pub fn set_script_context<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6549 self.script_context = v.into();
6550 self
6551 }
6552
6553 /// Sets the value of [action][crate::model::GcsReportLogMessage::action].
6554 ///
6555 /// # Example
6556 /// ```ignore,no_run
6557 /// # use google_cloud_bigquery_migration_v2::model::GcsReportLogMessage;
6558 /// let x = GcsReportLogMessage::new().set_action("example");
6559 /// ```
6560 pub fn set_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6561 self.action = v.into();
6562 self
6563 }
6564
6565 /// Sets the value of [effect][crate::model::GcsReportLogMessage::effect].
6566 ///
6567 /// # Example
6568 /// ```ignore,no_run
6569 /// # use google_cloud_bigquery_migration_v2::model::GcsReportLogMessage;
6570 /// let x = GcsReportLogMessage::new().set_effect("example");
6571 /// ```
6572 pub fn set_effect<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6573 self.effect = v.into();
6574 self
6575 }
6576
6577 /// Sets the value of [object_name][crate::model::GcsReportLogMessage::object_name].
6578 ///
6579 /// # Example
6580 /// ```ignore,no_run
6581 /// # use google_cloud_bigquery_migration_v2::model::GcsReportLogMessage;
6582 /// let x = GcsReportLogMessage::new().set_object_name("example");
6583 /// ```
6584 pub fn set_object_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6585 self.object_name = v.into();
6586 self
6587 }
6588}
6589
6590impl wkt::message::Message for GcsReportLogMessage {
6591 fn typename() -> &'static str {
6592 "type.googleapis.com/google.cloud.bigquery.migration.v2.GcsReportLogMessage"
6593 }
6594}