Skip to main content

google_cloud_clouddms_v1/
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_gax;
24extern crate google_cloud_iam_v1;
25extern crate google_cloud_location;
26extern crate google_cloud_longrunning;
27extern crate google_cloud_lro;
28extern crate google_cloud_rpc;
29extern crate lazy_static;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37mod debug;
38mod deserialize;
39mod serialize;
40
41/// Retrieves a list of all migration jobs in a given project and location.
42#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct ListMigrationJobsRequest {
45    /// Required. The parent which owns this collection of migrationJobs.
46    pub parent: std::string::String,
47
48    /// The maximum number of migration jobs to return. The service may return
49    /// fewer than this value. If unspecified, at most 50 migration jobs will be
50    /// returned. The maximum value is 1000; values above 1000 are coerced to
51    /// 1000.
52    pub page_size: i32,
53
54    /// The nextPageToken value received in the previous call to
55    /// migrationJobs.list, used in the subsequent request to retrieve the next
56    /// page of results. On first call this should be left blank. When paginating,
57    /// all other parameters provided to migrationJobs.list must match the call
58    /// that provided the page token.
59    pub page_token: std::string::String,
60
61    /// A filter expression that filters migration jobs listed in the response.
62    /// The expression must specify the field name, a comparison operator, and the
63    /// value that you want to use for filtering. The value must be a string,
64    /// a number, or a boolean. The comparison operator must be
65    /// either =, !=, >, or <. For example, list migration jobs created this year
66    /// by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.**
67    /// You can also filter nested fields. For example, you could specify
68    /// **reverseSshConnectivity.vmIp = "1.2.3.4"** to select all migration
69    /// jobs connecting through the specific SSH tunnel bastion.
70    pub filter: std::string::String,
71
72    /// Sort the results based on the migration job name.
73    /// Valid values are: "name", "name asc", and "name desc".
74    pub order_by: std::string::String,
75
76    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
77}
78
79impl ListMigrationJobsRequest {
80    pub fn new() -> Self {
81        std::default::Default::default()
82    }
83
84    /// Sets the value of [parent][crate::model::ListMigrationJobsRequest::parent].
85    ///
86    /// # Example
87    /// ```ignore,no_run
88    /// # use google_cloud_clouddms_v1::model::ListMigrationJobsRequest;
89    /// let x = ListMigrationJobsRequest::new().set_parent("example");
90    /// ```
91    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
92        self.parent = v.into();
93        self
94    }
95
96    /// Sets the value of [page_size][crate::model::ListMigrationJobsRequest::page_size].
97    ///
98    /// # Example
99    /// ```ignore,no_run
100    /// # use google_cloud_clouddms_v1::model::ListMigrationJobsRequest;
101    /// let x = ListMigrationJobsRequest::new().set_page_size(42);
102    /// ```
103    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
104        self.page_size = v.into();
105        self
106    }
107
108    /// Sets the value of [page_token][crate::model::ListMigrationJobsRequest::page_token].
109    ///
110    /// # Example
111    /// ```ignore,no_run
112    /// # use google_cloud_clouddms_v1::model::ListMigrationJobsRequest;
113    /// let x = ListMigrationJobsRequest::new().set_page_token("example");
114    /// ```
115    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
116        self.page_token = v.into();
117        self
118    }
119
120    /// Sets the value of [filter][crate::model::ListMigrationJobsRequest::filter].
121    ///
122    /// # Example
123    /// ```ignore,no_run
124    /// # use google_cloud_clouddms_v1::model::ListMigrationJobsRequest;
125    /// let x = ListMigrationJobsRequest::new().set_filter("example");
126    /// ```
127    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
128        self.filter = v.into();
129        self
130    }
131
132    /// Sets the value of [order_by][crate::model::ListMigrationJobsRequest::order_by].
133    ///
134    /// # Example
135    /// ```ignore,no_run
136    /// # use google_cloud_clouddms_v1::model::ListMigrationJobsRequest;
137    /// let x = ListMigrationJobsRequest::new().set_order_by("example");
138    /// ```
139    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
140        self.order_by = v.into();
141        self
142    }
143}
144
145impl wkt::message::Message for ListMigrationJobsRequest {
146    fn typename() -> &'static str {
147        "type.googleapis.com/google.cloud.clouddms.v1.ListMigrationJobsRequest"
148    }
149}
150
151/// Response message for 'ListMigrationJobs' request.
152#[derive(Clone, Default, PartialEq)]
153#[non_exhaustive]
154pub struct ListMigrationJobsResponse {
155    /// The list of migration jobs objects.
156    pub migration_jobs: std::vec::Vec<crate::model::MigrationJob>,
157
158    /// A token which can be sent as `page_token` to retrieve the next page.
159    /// If this field is omitted, there are no subsequent pages.
160    pub next_page_token: std::string::String,
161
162    /// Locations that could not be reached.
163    pub unreachable: std::vec::Vec<std::string::String>,
164
165    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
166}
167
168impl ListMigrationJobsResponse {
169    pub fn new() -> Self {
170        std::default::Default::default()
171    }
172
173    /// Sets the value of [migration_jobs][crate::model::ListMigrationJobsResponse::migration_jobs].
174    ///
175    /// # Example
176    /// ```ignore,no_run
177    /// # use google_cloud_clouddms_v1::model::ListMigrationJobsResponse;
178    /// use google_cloud_clouddms_v1::model::MigrationJob;
179    /// let x = ListMigrationJobsResponse::new()
180    ///     .set_migration_jobs([
181    ///         MigrationJob::default()/* use setters */,
182    ///         MigrationJob::default()/* use (different) setters */,
183    ///     ]);
184    /// ```
185    pub fn set_migration_jobs<T, V>(mut self, v: T) -> Self
186    where
187        T: std::iter::IntoIterator<Item = V>,
188        V: std::convert::Into<crate::model::MigrationJob>,
189    {
190        use std::iter::Iterator;
191        self.migration_jobs = v.into_iter().map(|i| i.into()).collect();
192        self
193    }
194
195    /// Sets the value of [next_page_token][crate::model::ListMigrationJobsResponse::next_page_token].
196    ///
197    /// # Example
198    /// ```ignore,no_run
199    /// # use google_cloud_clouddms_v1::model::ListMigrationJobsResponse;
200    /// let x = ListMigrationJobsResponse::new().set_next_page_token("example");
201    /// ```
202    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
203        self.next_page_token = v.into();
204        self
205    }
206
207    /// Sets the value of [unreachable][crate::model::ListMigrationJobsResponse::unreachable].
208    ///
209    /// # Example
210    /// ```ignore,no_run
211    /// # use google_cloud_clouddms_v1::model::ListMigrationJobsResponse;
212    /// let x = ListMigrationJobsResponse::new().set_unreachable(["a", "b", "c"]);
213    /// ```
214    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
215    where
216        T: std::iter::IntoIterator<Item = V>,
217        V: std::convert::Into<std::string::String>,
218    {
219        use std::iter::Iterator;
220        self.unreachable = v.into_iter().map(|i| i.into()).collect();
221        self
222    }
223}
224
225impl wkt::message::Message for ListMigrationJobsResponse {
226    fn typename() -> &'static str {
227        "type.googleapis.com/google.cloud.clouddms.v1.ListMigrationJobsResponse"
228    }
229}
230
231#[doc(hidden)]
232impl google_cloud_gax::paginator::internal::PageableResponse for ListMigrationJobsResponse {
233    type PageItem = crate::model::MigrationJob;
234
235    fn items(self) -> std::vec::Vec<Self::PageItem> {
236        self.migration_jobs
237    }
238
239    fn next_page_token(&self) -> std::string::String {
240        use std::clone::Clone;
241        self.next_page_token.clone()
242    }
243}
244
245/// Request message for 'GetMigrationJob' request.
246#[derive(Clone, Default, PartialEq)]
247#[non_exhaustive]
248pub struct GetMigrationJobRequest {
249    /// Required. Name of the migration job resource to get.
250    pub name: std::string::String,
251
252    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
253}
254
255impl GetMigrationJobRequest {
256    pub fn new() -> Self {
257        std::default::Default::default()
258    }
259
260    /// Sets the value of [name][crate::model::GetMigrationJobRequest::name].
261    ///
262    /// # Example
263    /// ```ignore,no_run
264    /// # use google_cloud_clouddms_v1::model::GetMigrationJobRequest;
265    /// let x = GetMigrationJobRequest::new().set_name("example");
266    /// ```
267    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
268        self.name = v.into();
269        self
270    }
271}
272
273impl wkt::message::Message for GetMigrationJobRequest {
274    fn typename() -> &'static str {
275        "type.googleapis.com/google.cloud.clouddms.v1.GetMigrationJobRequest"
276    }
277}
278
279/// Request message to create a new Database Migration Service migration job
280/// in the specified project and region.
281#[derive(Clone, Default, PartialEq)]
282#[non_exhaustive]
283pub struct CreateMigrationJobRequest {
284    /// Required. The parent which owns this collection of migration jobs.
285    pub parent: std::string::String,
286
287    /// Required. The ID of the instance to create.
288    pub migration_job_id: std::string::String,
289
290    /// Required. Represents a [migration
291    /// job](https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.migrationJobs)
292    /// object.
293    pub migration_job: std::option::Option<crate::model::MigrationJob>,
294
295    /// Optional. A unique ID used to identify the request. If the server receives
296    /// two requests with the same ID, then the second request is ignored.
297    ///
298    /// It is recommended to always set this value to a UUID.
299    ///
300    /// The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
301    /// (_), and hyphens (-). The maximum length is 40 characters.
302    pub request_id: std::string::String,
303
304    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
305}
306
307impl CreateMigrationJobRequest {
308    pub fn new() -> Self {
309        std::default::Default::default()
310    }
311
312    /// Sets the value of [parent][crate::model::CreateMigrationJobRequest::parent].
313    ///
314    /// # Example
315    /// ```ignore,no_run
316    /// # use google_cloud_clouddms_v1::model::CreateMigrationJobRequest;
317    /// let x = CreateMigrationJobRequest::new().set_parent("example");
318    /// ```
319    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
320        self.parent = v.into();
321        self
322    }
323
324    /// Sets the value of [migration_job_id][crate::model::CreateMigrationJobRequest::migration_job_id].
325    ///
326    /// # Example
327    /// ```ignore,no_run
328    /// # use google_cloud_clouddms_v1::model::CreateMigrationJobRequest;
329    /// let x = CreateMigrationJobRequest::new().set_migration_job_id("example");
330    /// ```
331    pub fn set_migration_job_id<T: std::convert::Into<std::string::String>>(
332        mut self,
333        v: T,
334    ) -> Self {
335        self.migration_job_id = v.into();
336        self
337    }
338
339    /// Sets the value of [migration_job][crate::model::CreateMigrationJobRequest::migration_job].
340    ///
341    /// # Example
342    /// ```ignore,no_run
343    /// # use google_cloud_clouddms_v1::model::CreateMigrationJobRequest;
344    /// use google_cloud_clouddms_v1::model::MigrationJob;
345    /// let x = CreateMigrationJobRequest::new().set_migration_job(MigrationJob::default()/* use setters */);
346    /// ```
347    pub fn set_migration_job<T>(mut self, v: T) -> Self
348    where
349        T: std::convert::Into<crate::model::MigrationJob>,
350    {
351        self.migration_job = std::option::Option::Some(v.into());
352        self
353    }
354
355    /// Sets or clears the value of [migration_job][crate::model::CreateMigrationJobRequest::migration_job].
356    ///
357    /// # Example
358    /// ```ignore,no_run
359    /// # use google_cloud_clouddms_v1::model::CreateMigrationJobRequest;
360    /// use google_cloud_clouddms_v1::model::MigrationJob;
361    /// let x = CreateMigrationJobRequest::new().set_or_clear_migration_job(Some(MigrationJob::default()/* use setters */));
362    /// let x = CreateMigrationJobRequest::new().set_or_clear_migration_job(None::<MigrationJob>);
363    /// ```
364    pub fn set_or_clear_migration_job<T>(mut self, v: std::option::Option<T>) -> Self
365    where
366        T: std::convert::Into<crate::model::MigrationJob>,
367    {
368        self.migration_job = v.map(|x| x.into());
369        self
370    }
371
372    /// Sets the value of [request_id][crate::model::CreateMigrationJobRequest::request_id].
373    ///
374    /// # Example
375    /// ```ignore,no_run
376    /// # use google_cloud_clouddms_v1::model::CreateMigrationJobRequest;
377    /// let x = CreateMigrationJobRequest::new().set_request_id("example");
378    /// ```
379    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
380        self.request_id = v.into();
381        self
382    }
383}
384
385impl wkt::message::Message for CreateMigrationJobRequest {
386    fn typename() -> &'static str {
387        "type.googleapis.com/google.cloud.clouddms.v1.CreateMigrationJobRequest"
388    }
389}
390
391/// Request message for 'UpdateMigrationJob' request.
392#[derive(Clone, Default, PartialEq)]
393#[non_exhaustive]
394pub struct UpdateMigrationJobRequest {
395    /// Required. Field mask is used to specify the fields to be overwritten by the
396    /// update in the conversion workspace resource.
397    pub update_mask: std::option::Option<wkt::FieldMask>,
398
399    /// Required. The migration job parameters to update.
400    pub migration_job: std::option::Option<crate::model::MigrationJob>,
401
402    /// A unique ID used to identify the request. If the server receives two
403    /// requests with the same ID, then the second request is ignored.
404    ///
405    /// It is recommended to always set this value to a UUID.
406    ///
407    /// The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
408    /// (_), and hyphens (-). The maximum length is 40 characters.
409    pub request_id: std::string::String,
410
411    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
412}
413
414impl UpdateMigrationJobRequest {
415    pub fn new() -> Self {
416        std::default::Default::default()
417    }
418
419    /// Sets the value of [update_mask][crate::model::UpdateMigrationJobRequest::update_mask].
420    ///
421    /// # Example
422    /// ```ignore,no_run
423    /// # use google_cloud_clouddms_v1::model::UpdateMigrationJobRequest;
424    /// use wkt::FieldMask;
425    /// let x = UpdateMigrationJobRequest::new().set_update_mask(FieldMask::default()/* use setters */);
426    /// ```
427    pub fn set_update_mask<T>(mut self, v: T) -> Self
428    where
429        T: std::convert::Into<wkt::FieldMask>,
430    {
431        self.update_mask = std::option::Option::Some(v.into());
432        self
433    }
434
435    /// Sets or clears the value of [update_mask][crate::model::UpdateMigrationJobRequest::update_mask].
436    ///
437    /// # Example
438    /// ```ignore,no_run
439    /// # use google_cloud_clouddms_v1::model::UpdateMigrationJobRequest;
440    /// use wkt::FieldMask;
441    /// let x = UpdateMigrationJobRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
442    /// let x = UpdateMigrationJobRequest::new().set_or_clear_update_mask(None::<FieldMask>);
443    /// ```
444    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
445    where
446        T: std::convert::Into<wkt::FieldMask>,
447    {
448        self.update_mask = v.map(|x| x.into());
449        self
450    }
451
452    /// Sets the value of [migration_job][crate::model::UpdateMigrationJobRequest::migration_job].
453    ///
454    /// # Example
455    /// ```ignore,no_run
456    /// # use google_cloud_clouddms_v1::model::UpdateMigrationJobRequest;
457    /// use google_cloud_clouddms_v1::model::MigrationJob;
458    /// let x = UpdateMigrationJobRequest::new().set_migration_job(MigrationJob::default()/* use setters */);
459    /// ```
460    pub fn set_migration_job<T>(mut self, v: T) -> Self
461    where
462        T: std::convert::Into<crate::model::MigrationJob>,
463    {
464        self.migration_job = std::option::Option::Some(v.into());
465        self
466    }
467
468    /// Sets or clears the value of [migration_job][crate::model::UpdateMigrationJobRequest::migration_job].
469    ///
470    /// # Example
471    /// ```ignore,no_run
472    /// # use google_cloud_clouddms_v1::model::UpdateMigrationJobRequest;
473    /// use google_cloud_clouddms_v1::model::MigrationJob;
474    /// let x = UpdateMigrationJobRequest::new().set_or_clear_migration_job(Some(MigrationJob::default()/* use setters */));
475    /// let x = UpdateMigrationJobRequest::new().set_or_clear_migration_job(None::<MigrationJob>);
476    /// ```
477    pub fn set_or_clear_migration_job<T>(mut self, v: std::option::Option<T>) -> Self
478    where
479        T: std::convert::Into<crate::model::MigrationJob>,
480    {
481        self.migration_job = v.map(|x| x.into());
482        self
483    }
484
485    /// Sets the value of [request_id][crate::model::UpdateMigrationJobRequest::request_id].
486    ///
487    /// # Example
488    /// ```ignore,no_run
489    /// # use google_cloud_clouddms_v1::model::UpdateMigrationJobRequest;
490    /// let x = UpdateMigrationJobRequest::new().set_request_id("example");
491    /// ```
492    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
493        self.request_id = v.into();
494        self
495    }
496}
497
498impl wkt::message::Message for UpdateMigrationJobRequest {
499    fn typename() -> &'static str {
500        "type.googleapis.com/google.cloud.clouddms.v1.UpdateMigrationJobRequest"
501    }
502}
503
504/// Request message for 'DeleteMigrationJob' request.
505#[derive(Clone, Default, PartialEq)]
506#[non_exhaustive]
507pub struct DeleteMigrationJobRequest {
508    /// Required. Name of the migration job resource to delete.
509    pub name: std::string::String,
510
511    /// A unique ID used to identify the request. If the server receives two
512    /// requests with the same ID, then the second request is ignored.
513    ///
514    /// It is recommended to always set this value to a UUID.
515    ///
516    /// The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
517    /// (_), and hyphens (-). The maximum length is 40 characters.
518    pub request_id: std::string::String,
519
520    /// The destination CloudSQL connection profile is always deleted with the
521    /// migration job. In case of force delete, the destination CloudSQL replica
522    /// database is also deleted.
523    pub force: bool,
524
525    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
526}
527
528impl DeleteMigrationJobRequest {
529    pub fn new() -> Self {
530        std::default::Default::default()
531    }
532
533    /// Sets the value of [name][crate::model::DeleteMigrationJobRequest::name].
534    ///
535    /// # Example
536    /// ```ignore,no_run
537    /// # use google_cloud_clouddms_v1::model::DeleteMigrationJobRequest;
538    /// let x = DeleteMigrationJobRequest::new().set_name("example");
539    /// ```
540    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
541        self.name = v.into();
542        self
543    }
544
545    /// Sets the value of [request_id][crate::model::DeleteMigrationJobRequest::request_id].
546    ///
547    /// # Example
548    /// ```ignore,no_run
549    /// # use google_cloud_clouddms_v1::model::DeleteMigrationJobRequest;
550    /// let x = DeleteMigrationJobRequest::new().set_request_id("example");
551    /// ```
552    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
553        self.request_id = v.into();
554        self
555    }
556
557    /// Sets the value of [force][crate::model::DeleteMigrationJobRequest::force].
558    ///
559    /// # Example
560    /// ```ignore,no_run
561    /// # use google_cloud_clouddms_v1::model::DeleteMigrationJobRequest;
562    /// let x = DeleteMigrationJobRequest::new().set_force(true);
563    /// ```
564    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
565        self.force = v.into();
566        self
567    }
568}
569
570impl wkt::message::Message for DeleteMigrationJobRequest {
571    fn typename() -> &'static str {
572        "type.googleapis.com/google.cloud.clouddms.v1.DeleteMigrationJobRequest"
573    }
574}
575
576/// Request message for 'StartMigrationJob' request.
577#[derive(Clone, Default, PartialEq)]
578#[non_exhaustive]
579pub struct StartMigrationJobRequest {
580    /// Name of the migration job resource to start.
581    pub name: std::string::String,
582
583    /// Optional. Start the migration job without running prior configuration
584    /// verification. Defaults to `false`.
585    pub skip_validation: bool,
586
587    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
588}
589
590impl StartMigrationJobRequest {
591    pub fn new() -> Self {
592        std::default::Default::default()
593    }
594
595    /// Sets the value of [name][crate::model::StartMigrationJobRequest::name].
596    ///
597    /// # Example
598    /// ```ignore,no_run
599    /// # use google_cloud_clouddms_v1::model::StartMigrationJobRequest;
600    /// let x = StartMigrationJobRequest::new().set_name("example");
601    /// ```
602    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
603        self.name = v.into();
604        self
605    }
606
607    /// Sets the value of [skip_validation][crate::model::StartMigrationJobRequest::skip_validation].
608    ///
609    /// # Example
610    /// ```ignore,no_run
611    /// # use google_cloud_clouddms_v1::model::StartMigrationJobRequest;
612    /// let x = StartMigrationJobRequest::new().set_skip_validation(true);
613    /// ```
614    pub fn set_skip_validation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
615        self.skip_validation = v.into();
616        self
617    }
618}
619
620impl wkt::message::Message for StartMigrationJobRequest {
621    fn typename() -> &'static str {
622        "type.googleapis.com/google.cloud.clouddms.v1.StartMigrationJobRequest"
623    }
624}
625
626/// Request message for 'StopMigrationJob' request.
627#[derive(Clone, Default, PartialEq)]
628#[non_exhaustive]
629pub struct StopMigrationJobRequest {
630    /// Name of the migration job resource to stop.
631    pub name: std::string::String,
632
633    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
634}
635
636impl StopMigrationJobRequest {
637    pub fn new() -> Self {
638        std::default::Default::default()
639    }
640
641    /// Sets the value of [name][crate::model::StopMigrationJobRequest::name].
642    ///
643    /// # Example
644    /// ```ignore,no_run
645    /// # use google_cloud_clouddms_v1::model::StopMigrationJobRequest;
646    /// let x = StopMigrationJobRequest::new().set_name("example");
647    /// ```
648    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
649        self.name = v.into();
650        self
651    }
652}
653
654impl wkt::message::Message for StopMigrationJobRequest {
655    fn typename() -> &'static str {
656        "type.googleapis.com/google.cloud.clouddms.v1.StopMigrationJobRequest"
657    }
658}
659
660/// Request message for 'ResumeMigrationJob' request.
661#[derive(Clone, Default, PartialEq)]
662#[non_exhaustive]
663pub struct ResumeMigrationJobRequest {
664    /// Name of the migration job resource to resume.
665    pub name: std::string::String,
666
667    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
668}
669
670impl ResumeMigrationJobRequest {
671    pub fn new() -> Self {
672        std::default::Default::default()
673    }
674
675    /// Sets the value of [name][crate::model::ResumeMigrationJobRequest::name].
676    ///
677    /// # Example
678    /// ```ignore,no_run
679    /// # use google_cloud_clouddms_v1::model::ResumeMigrationJobRequest;
680    /// let x = ResumeMigrationJobRequest::new().set_name("example");
681    /// ```
682    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
683        self.name = v.into();
684        self
685    }
686}
687
688impl wkt::message::Message for ResumeMigrationJobRequest {
689    fn typename() -> &'static str {
690        "type.googleapis.com/google.cloud.clouddms.v1.ResumeMigrationJobRequest"
691    }
692}
693
694/// Request message for 'PromoteMigrationJob' request.
695#[derive(Clone, Default, PartialEq)]
696#[non_exhaustive]
697pub struct PromoteMigrationJobRequest {
698    /// Name of the migration job resource to promote.
699    pub name: std::string::String,
700
701    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
702}
703
704impl PromoteMigrationJobRequest {
705    pub fn new() -> Self {
706        std::default::Default::default()
707    }
708
709    /// Sets the value of [name][crate::model::PromoteMigrationJobRequest::name].
710    ///
711    /// # Example
712    /// ```ignore,no_run
713    /// # use google_cloud_clouddms_v1::model::PromoteMigrationJobRequest;
714    /// let x = PromoteMigrationJobRequest::new().set_name("example");
715    /// ```
716    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
717        self.name = v.into();
718        self
719    }
720}
721
722impl wkt::message::Message for PromoteMigrationJobRequest {
723    fn typename() -> &'static str {
724        "type.googleapis.com/google.cloud.clouddms.v1.PromoteMigrationJobRequest"
725    }
726}
727
728/// Request message for 'VerifyMigrationJob' request.
729#[derive(Clone, Default, PartialEq)]
730#[non_exhaustive]
731pub struct VerifyMigrationJobRequest {
732    /// Name of the migration job resource to verify.
733    pub name: std::string::String,
734
735    /// Optional. Field mask is used to specify the changed fields to be verified.
736    /// It will not update the migration job.
737    pub update_mask: std::option::Option<wkt::FieldMask>,
738
739    /// Optional. The changed migration job parameters to verify.
740    /// It will not update the migration job.
741    pub migration_job: std::option::Option<crate::model::MigrationJob>,
742
743    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
744}
745
746impl VerifyMigrationJobRequest {
747    pub fn new() -> Self {
748        std::default::Default::default()
749    }
750
751    /// Sets the value of [name][crate::model::VerifyMigrationJobRequest::name].
752    ///
753    /// # Example
754    /// ```ignore,no_run
755    /// # use google_cloud_clouddms_v1::model::VerifyMigrationJobRequest;
756    /// let x = VerifyMigrationJobRequest::new().set_name("example");
757    /// ```
758    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
759        self.name = v.into();
760        self
761    }
762
763    /// Sets the value of [update_mask][crate::model::VerifyMigrationJobRequest::update_mask].
764    ///
765    /// # Example
766    /// ```ignore,no_run
767    /// # use google_cloud_clouddms_v1::model::VerifyMigrationJobRequest;
768    /// use wkt::FieldMask;
769    /// let x = VerifyMigrationJobRequest::new().set_update_mask(FieldMask::default()/* use setters */);
770    /// ```
771    pub fn set_update_mask<T>(mut self, v: T) -> Self
772    where
773        T: std::convert::Into<wkt::FieldMask>,
774    {
775        self.update_mask = std::option::Option::Some(v.into());
776        self
777    }
778
779    /// Sets or clears the value of [update_mask][crate::model::VerifyMigrationJobRequest::update_mask].
780    ///
781    /// # Example
782    /// ```ignore,no_run
783    /// # use google_cloud_clouddms_v1::model::VerifyMigrationJobRequest;
784    /// use wkt::FieldMask;
785    /// let x = VerifyMigrationJobRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
786    /// let x = VerifyMigrationJobRequest::new().set_or_clear_update_mask(None::<FieldMask>);
787    /// ```
788    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
789    where
790        T: std::convert::Into<wkt::FieldMask>,
791    {
792        self.update_mask = v.map(|x| x.into());
793        self
794    }
795
796    /// Sets the value of [migration_job][crate::model::VerifyMigrationJobRequest::migration_job].
797    ///
798    /// # Example
799    /// ```ignore,no_run
800    /// # use google_cloud_clouddms_v1::model::VerifyMigrationJobRequest;
801    /// use google_cloud_clouddms_v1::model::MigrationJob;
802    /// let x = VerifyMigrationJobRequest::new().set_migration_job(MigrationJob::default()/* use setters */);
803    /// ```
804    pub fn set_migration_job<T>(mut self, v: T) -> Self
805    where
806        T: std::convert::Into<crate::model::MigrationJob>,
807    {
808        self.migration_job = std::option::Option::Some(v.into());
809        self
810    }
811
812    /// Sets or clears the value of [migration_job][crate::model::VerifyMigrationJobRequest::migration_job].
813    ///
814    /// # Example
815    /// ```ignore,no_run
816    /// # use google_cloud_clouddms_v1::model::VerifyMigrationJobRequest;
817    /// use google_cloud_clouddms_v1::model::MigrationJob;
818    /// let x = VerifyMigrationJobRequest::new().set_or_clear_migration_job(Some(MigrationJob::default()/* use setters */));
819    /// let x = VerifyMigrationJobRequest::new().set_or_clear_migration_job(None::<MigrationJob>);
820    /// ```
821    pub fn set_or_clear_migration_job<T>(mut self, v: std::option::Option<T>) -> Self
822    where
823        T: std::convert::Into<crate::model::MigrationJob>,
824    {
825        self.migration_job = v.map(|x| x.into());
826        self
827    }
828}
829
830impl wkt::message::Message for VerifyMigrationJobRequest {
831    fn typename() -> &'static str {
832        "type.googleapis.com/google.cloud.clouddms.v1.VerifyMigrationJobRequest"
833    }
834}
835
836/// Request message for 'RestartMigrationJob' request.
837#[derive(Clone, Default, PartialEq)]
838#[non_exhaustive]
839pub struct RestartMigrationJobRequest {
840    /// Name of the migration job resource to restart.
841    pub name: std::string::String,
842
843    /// Optional. Restart the migration job without running prior configuration
844    /// verification. Defaults to `false`.
845    pub skip_validation: bool,
846
847    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
848}
849
850impl RestartMigrationJobRequest {
851    pub fn new() -> Self {
852        std::default::Default::default()
853    }
854
855    /// Sets the value of [name][crate::model::RestartMigrationJobRequest::name].
856    ///
857    /// # Example
858    /// ```ignore,no_run
859    /// # use google_cloud_clouddms_v1::model::RestartMigrationJobRequest;
860    /// let x = RestartMigrationJobRequest::new().set_name("example");
861    /// ```
862    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
863        self.name = v.into();
864        self
865    }
866
867    /// Sets the value of [skip_validation][crate::model::RestartMigrationJobRequest::skip_validation].
868    ///
869    /// # Example
870    /// ```ignore,no_run
871    /// # use google_cloud_clouddms_v1::model::RestartMigrationJobRequest;
872    /// let x = RestartMigrationJobRequest::new().set_skip_validation(true);
873    /// ```
874    pub fn set_skip_validation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
875        self.skip_validation = v.into();
876        self
877    }
878}
879
880impl wkt::message::Message for RestartMigrationJobRequest {
881    fn typename() -> &'static str {
882        "type.googleapis.com/google.cloud.clouddms.v1.RestartMigrationJobRequest"
883    }
884}
885
886/// Request message for 'GenerateSshScript' request.
887#[derive(Clone, Default, PartialEq)]
888#[non_exhaustive]
889pub struct GenerateSshScriptRequest {
890    /// Name of the migration job resource to generate the SSH script.
891    pub migration_job: std::string::String,
892
893    /// Required. Bastion VM Instance name to use or to create.
894    pub vm: std::string::String,
895
896    /// The port that will be open on the bastion host.
897    pub vm_port: i32,
898
899    /// The VM configuration
900    pub vm_config: std::option::Option<crate::model::generate_ssh_script_request::VmConfig>,
901
902    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
903}
904
905impl GenerateSshScriptRequest {
906    pub fn new() -> Self {
907        std::default::Default::default()
908    }
909
910    /// Sets the value of [migration_job][crate::model::GenerateSshScriptRequest::migration_job].
911    ///
912    /// # Example
913    /// ```ignore,no_run
914    /// # use google_cloud_clouddms_v1::model::GenerateSshScriptRequest;
915    /// let x = GenerateSshScriptRequest::new().set_migration_job("example");
916    /// ```
917    pub fn set_migration_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
918        self.migration_job = v.into();
919        self
920    }
921
922    /// Sets the value of [vm][crate::model::GenerateSshScriptRequest::vm].
923    ///
924    /// # Example
925    /// ```ignore,no_run
926    /// # use google_cloud_clouddms_v1::model::GenerateSshScriptRequest;
927    /// let x = GenerateSshScriptRequest::new().set_vm("example");
928    /// ```
929    pub fn set_vm<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
930        self.vm = v.into();
931        self
932    }
933
934    /// Sets the value of [vm_port][crate::model::GenerateSshScriptRequest::vm_port].
935    ///
936    /// # Example
937    /// ```ignore,no_run
938    /// # use google_cloud_clouddms_v1::model::GenerateSshScriptRequest;
939    /// let x = GenerateSshScriptRequest::new().set_vm_port(42);
940    /// ```
941    pub fn set_vm_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
942        self.vm_port = v.into();
943        self
944    }
945
946    /// Sets the value of [vm_config][crate::model::GenerateSshScriptRequest::vm_config].
947    ///
948    /// Note that all the setters affecting `vm_config` are mutually
949    /// exclusive.
950    ///
951    /// # Example
952    /// ```ignore,no_run
953    /// # use google_cloud_clouddms_v1::model::GenerateSshScriptRequest;
954    /// use google_cloud_clouddms_v1::model::VmCreationConfig;
955    /// let x = GenerateSshScriptRequest::new().set_vm_config(Some(
956    ///     google_cloud_clouddms_v1::model::generate_ssh_script_request::VmConfig::VmCreationConfig(VmCreationConfig::default().into())));
957    /// ```
958    pub fn set_vm_config<
959        T: std::convert::Into<
960                std::option::Option<crate::model::generate_ssh_script_request::VmConfig>,
961            >,
962    >(
963        mut self,
964        v: T,
965    ) -> Self {
966        self.vm_config = v.into();
967        self
968    }
969
970    /// The value of [vm_config][crate::model::GenerateSshScriptRequest::vm_config]
971    /// if it holds a `VmCreationConfig`, `None` if the field is not set or
972    /// holds a different branch.
973    pub fn vm_creation_config(
974        &self,
975    ) -> std::option::Option<&std::boxed::Box<crate::model::VmCreationConfig>> {
976        #[allow(unreachable_patterns)]
977        self.vm_config.as_ref().and_then(|v| match v {
978            crate::model::generate_ssh_script_request::VmConfig::VmCreationConfig(v) => {
979                std::option::Option::Some(v)
980            }
981            _ => std::option::Option::None,
982        })
983    }
984
985    /// Sets the value of [vm_config][crate::model::GenerateSshScriptRequest::vm_config]
986    /// to hold a `VmCreationConfig`.
987    ///
988    /// Note that all the setters affecting `vm_config` are
989    /// mutually exclusive.
990    ///
991    /// # Example
992    /// ```ignore,no_run
993    /// # use google_cloud_clouddms_v1::model::GenerateSshScriptRequest;
994    /// use google_cloud_clouddms_v1::model::VmCreationConfig;
995    /// let x = GenerateSshScriptRequest::new().set_vm_creation_config(VmCreationConfig::default()/* use setters */);
996    /// assert!(x.vm_creation_config().is_some());
997    /// assert!(x.vm_selection_config().is_none());
998    /// ```
999    pub fn set_vm_creation_config<
1000        T: std::convert::Into<std::boxed::Box<crate::model::VmCreationConfig>>,
1001    >(
1002        mut self,
1003        v: T,
1004    ) -> Self {
1005        self.vm_config = std::option::Option::Some(
1006            crate::model::generate_ssh_script_request::VmConfig::VmCreationConfig(v.into()),
1007        );
1008        self
1009    }
1010
1011    /// The value of [vm_config][crate::model::GenerateSshScriptRequest::vm_config]
1012    /// if it holds a `VmSelectionConfig`, `None` if the field is not set or
1013    /// holds a different branch.
1014    pub fn vm_selection_config(
1015        &self,
1016    ) -> std::option::Option<&std::boxed::Box<crate::model::VmSelectionConfig>> {
1017        #[allow(unreachable_patterns)]
1018        self.vm_config.as_ref().and_then(|v| match v {
1019            crate::model::generate_ssh_script_request::VmConfig::VmSelectionConfig(v) => {
1020                std::option::Option::Some(v)
1021            }
1022            _ => std::option::Option::None,
1023        })
1024    }
1025
1026    /// Sets the value of [vm_config][crate::model::GenerateSshScriptRequest::vm_config]
1027    /// to hold a `VmSelectionConfig`.
1028    ///
1029    /// Note that all the setters affecting `vm_config` are
1030    /// mutually exclusive.
1031    ///
1032    /// # Example
1033    /// ```ignore,no_run
1034    /// # use google_cloud_clouddms_v1::model::GenerateSshScriptRequest;
1035    /// use google_cloud_clouddms_v1::model::VmSelectionConfig;
1036    /// let x = GenerateSshScriptRequest::new().set_vm_selection_config(VmSelectionConfig::default()/* use setters */);
1037    /// assert!(x.vm_selection_config().is_some());
1038    /// assert!(x.vm_creation_config().is_none());
1039    /// ```
1040    pub fn set_vm_selection_config<
1041        T: std::convert::Into<std::boxed::Box<crate::model::VmSelectionConfig>>,
1042    >(
1043        mut self,
1044        v: T,
1045    ) -> Self {
1046        self.vm_config = std::option::Option::Some(
1047            crate::model::generate_ssh_script_request::VmConfig::VmSelectionConfig(v.into()),
1048        );
1049        self
1050    }
1051}
1052
1053impl wkt::message::Message for GenerateSshScriptRequest {
1054    fn typename() -> &'static str {
1055        "type.googleapis.com/google.cloud.clouddms.v1.GenerateSshScriptRequest"
1056    }
1057}
1058
1059/// Defines additional types related to [GenerateSshScriptRequest].
1060pub mod generate_ssh_script_request {
1061    #[allow(unused_imports)]
1062    use super::*;
1063
1064    /// The VM configuration
1065    #[derive(Clone, Debug, PartialEq)]
1066    #[non_exhaustive]
1067    pub enum VmConfig {
1068        /// The VM creation configuration
1069        VmCreationConfig(std::boxed::Box<crate::model::VmCreationConfig>),
1070        /// The VM selection configuration
1071        VmSelectionConfig(std::boxed::Box<crate::model::VmSelectionConfig>),
1072    }
1073}
1074
1075/// VM creation configuration message
1076#[derive(Clone, Default, PartialEq)]
1077#[non_exhaustive]
1078pub struct VmCreationConfig {
1079    /// Required. VM instance machine type to create.
1080    pub vm_machine_type: std::string::String,
1081
1082    /// The Google Cloud Platform zone to create the VM in.
1083    pub vm_zone: std::string::String,
1084
1085    /// The subnet name the vm needs to be created in.
1086    pub subnet: std::string::String,
1087
1088    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1089}
1090
1091impl VmCreationConfig {
1092    pub fn new() -> Self {
1093        std::default::Default::default()
1094    }
1095
1096    /// Sets the value of [vm_machine_type][crate::model::VmCreationConfig::vm_machine_type].
1097    ///
1098    /// # Example
1099    /// ```ignore,no_run
1100    /// # use google_cloud_clouddms_v1::model::VmCreationConfig;
1101    /// let x = VmCreationConfig::new().set_vm_machine_type("example");
1102    /// ```
1103    pub fn set_vm_machine_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1104        self.vm_machine_type = v.into();
1105        self
1106    }
1107
1108    /// Sets the value of [vm_zone][crate::model::VmCreationConfig::vm_zone].
1109    ///
1110    /// # Example
1111    /// ```ignore,no_run
1112    /// # use google_cloud_clouddms_v1::model::VmCreationConfig;
1113    /// let x = VmCreationConfig::new().set_vm_zone("example");
1114    /// ```
1115    pub fn set_vm_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1116        self.vm_zone = v.into();
1117        self
1118    }
1119
1120    /// Sets the value of [subnet][crate::model::VmCreationConfig::subnet].
1121    ///
1122    /// # Example
1123    /// ```ignore,no_run
1124    /// # use google_cloud_clouddms_v1::model::VmCreationConfig;
1125    /// let x = VmCreationConfig::new().set_subnet("example");
1126    /// ```
1127    pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1128        self.subnet = v.into();
1129        self
1130    }
1131}
1132
1133impl wkt::message::Message for VmCreationConfig {
1134    fn typename() -> &'static str {
1135        "type.googleapis.com/google.cloud.clouddms.v1.VmCreationConfig"
1136    }
1137}
1138
1139/// VM selection configuration message
1140#[derive(Clone, Default, PartialEq)]
1141#[non_exhaustive]
1142pub struct VmSelectionConfig {
1143    /// Required. The Google Cloud Platform zone the VM is located.
1144    pub vm_zone: std::string::String,
1145
1146    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1147}
1148
1149impl VmSelectionConfig {
1150    pub fn new() -> Self {
1151        std::default::Default::default()
1152    }
1153
1154    /// Sets the value of [vm_zone][crate::model::VmSelectionConfig::vm_zone].
1155    ///
1156    /// # Example
1157    /// ```ignore,no_run
1158    /// # use google_cloud_clouddms_v1::model::VmSelectionConfig;
1159    /// let x = VmSelectionConfig::new().set_vm_zone("example");
1160    /// ```
1161    pub fn set_vm_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1162        self.vm_zone = v.into();
1163        self
1164    }
1165}
1166
1167impl wkt::message::Message for VmSelectionConfig {
1168    fn typename() -> &'static str {
1169        "type.googleapis.com/google.cloud.clouddms.v1.VmSelectionConfig"
1170    }
1171}
1172
1173/// Response message for 'GenerateSshScript' request.
1174#[derive(Clone, Default, PartialEq)]
1175#[non_exhaustive]
1176pub struct SshScript {
1177    /// The ssh configuration script.
1178    pub script: std::string::String,
1179
1180    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1181}
1182
1183impl SshScript {
1184    pub fn new() -> Self {
1185        std::default::Default::default()
1186    }
1187
1188    /// Sets the value of [script][crate::model::SshScript::script].
1189    ///
1190    /// # Example
1191    /// ```ignore,no_run
1192    /// # use google_cloud_clouddms_v1::model::SshScript;
1193    /// let x = SshScript::new().set_script("example");
1194    /// ```
1195    pub fn set_script<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1196        self.script = v.into();
1197        self
1198    }
1199}
1200
1201impl wkt::message::Message for SshScript {
1202    fn typename() -> &'static str {
1203        "type.googleapis.com/google.cloud.clouddms.v1.SshScript"
1204    }
1205}
1206
1207/// Request message for 'GenerateTcpProxyScript' request.
1208#[derive(Clone, Default, PartialEq)]
1209#[non_exhaustive]
1210pub struct GenerateTcpProxyScriptRequest {
1211    /// Name of the migration job resource to generate the TCP Proxy script.
1212    pub migration_job: std::string::String,
1213
1214    /// Required. The name of the Compute instance that will host the proxy.
1215    pub vm_name: std::string::String,
1216
1217    /// Required. The type of the Compute instance that will host the proxy.
1218    pub vm_machine_type: std::string::String,
1219
1220    /// Optional. The Google Cloud Platform zone to create the VM in. The fully
1221    /// qualified name of the zone must be specified, including the region name,
1222    /// for example "us-central1-b". If not specified, uses the "-b" zone of the
1223    /// destination Connection Profile's region.
1224    pub vm_zone: std::string::String,
1225
1226    /// Required. The name of the subnet the Compute instance will use for private
1227    /// connectivity. Must be supplied in the form of
1228    /// projects/{project}/regions/{region}/subnetworks/{subnetwork}.
1229    /// Note: the region for the subnet must match the Compute instance region.
1230    pub vm_subnet: std::string::String,
1231
1232    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1233}
1234
1235impl GenerateTcpProxyScriptRequest {
1236    pub fn new() -> Self {
1237        std::default::Default::default()
1238    }
1239
1240    /// Sets the value of [migration_job][crate::model::GenerateTcpProxyScriptRequest::migration_job].
1241    ///
1242    /// # Example
1243    /// ```ignore,no_run
1244    /// # use google_cloud_clouddms_v1::model::GenerateTcpProxyScriptRequest;
1245    /// let x = GenerateTcpProxyScriptRequest::new().set_migration_job("example");
1246    /// ```
1247    pub fn set_migration_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1248        self.migration_job = v.into();
1249        self
1250    }
1251
1252    /// Sets the value of [vm_name][crate::model::GenerateTcpProxyScriptRequest::vm_name].
1253    ///
1254    /// # Example
1255    /// ```ignore,no_run
1256    /// # use google_cloud_clouddms_v1::model::GenerateTcpProxyScriptRequest;
1257    /// let x = GenerateTcpProxyScriptRequest::new().set_vm_name("example");
1258    /// ```
1259    pub fn set_vm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1260        self.vm_name = v.into();
1261        self
1262    }
1263
1264    /// Sets the value of [vm_machine_type][crate::model::GenerateTcpProxyScriptRequest::vm_machine_type].
1265    ///
1266    /// # Example
1267    /// ```ignore,no_run
1268    /// # use google_cloud_clouddms_v1::model::GenerateTcpProxyScriptRequest;
1269    /// let x = GenerateTcpProxyScriptRequest::new().set_vm_machine_type("example");
1270    /// ```
1271    pub fn set_vm_machine_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1272        self.vm_machine_type = v.into();
1273        self
1274    }
1275
1276    /// Sets the value of [vm_zone][crate::model::GenerateTcpProxyScriptRequest::vm_zone].
1277    ///
1278    /// # Example
1279    /// ```ignore,no_run
1280    /// # use google_cloud_clouddms_v1::model::GenerateTcpProxyScriptRequest;
1281    /// let x = GenerateTcpProxyScriptRequest::new().set_vm_zone("example");
1282    /// ```
1283    pub fn set_vm_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1284        self.vm_zone = v.into();
1285        self
1286    }
1287
1288    /// Sets the value of [vm_subnet][crate::model::GenerateTcpProxyScriptRequest::vm_subnet].
1289    ///
1290    /// # Example
1291    /// ```ignore,no_run
1292    /// # use google_cloud_clouddms_v1::model::GenerateTcpProxyScriptRequest;
1293    /// let x = GenerateTcpProxyScriptRequest::new().set_vm_subnet("example");
1294    /// ```
1295    pub fn set_vm_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1296        self.vm_subnet = v.into();
1297        self
1298    }
1299}
1300
1301impl wkt::message::Message for GenerateTcpProxyScriptRequest {
1302    fn typename() -> &'static str {
1303        "type.googleapis.com/google.cloud.clouddms.v1.GenerateTcpProxyScriptRequest"
1304    }
1305}
1306
1307/// Response message for 'GenerateTcpProxyScript' request.
1308#[derive(Clone, Default, PartialEq)]
1309#[non_exhaustive]
1310pub struct TcpProxyScript {
1311    /// The TCP Proxy configuration script.
1312    pub script: std::string::String,
1313
1314    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1315}
1316
1317impl TcpProxyScript {
1318    pub fn new() -> Self {
1319        std::default::Default::default()
1320    }
1321
1322    /// Sets the value of [script][crate::model::TcpProxyScript::script].
1323    ///
1324    /// # Example
1325    /// ```ignore,no_run
1326    /// # use google_cloud_clouddms_v1::model::TcpProxyScript;
1327    /// let x = TcpProxyScript::new().set_script("example");
1328    /// ```
1329    pub fn set_script<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1330        self.script = v.into();
1331        self
1332    }
1333}
1334
1335impl wkt::message::Message for TcpProxyScript {
1336    fn typename() -> &'static str {
1337        "type.googleapis.com/google.cloud.clouddms.v1.TcpProxyScript"
1338    }
1339}
1340
1341/// Request message for 'ListConnectionProfiles' request.
1342#[derive(Clone, Default, PartialEq)]
1343#[non_exhaustive]
1344pub struct ListConnectionProfilesRequest {
1345    /// Required. The parent which owns this collection of connection profiles.
1346    pub parent: std::string::String,
1347
1348    /// The maximum number of connection profiles to return. The service may return
1349    /// fewer than this value. If unspecified, at most 50 connection profiles will
1350    /// be returned. The maximum value is 1000; values above 1000 are coerced
1351    /// to 1000.
1352    pub page_size: i32,
1353
1354    /// A page token, received from a previous `ListConnectionProfiles` call.
1355    /// Provide this to retrieve the subsequent page.
1356    ///
1357    /// When paginating, all other parameters provided to `ListConnectionProfiles`
1358    /// must match the call that provided the page token.
1359    pub page_token: std::string::String,
1360
1361    /// A filter expression that filters connection profiles listed in the
1362    /// response. The expression must specify the field name, a comparison
1363    /// operator, and the value that you want to use for filtering. The value must
1364    /// be a string, a number, or a boolean. The comparison operator must be either
1365    /// =, !=, >, or <. For example, list connection profiles created this year by
1366    /// specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z**. You can
1367    /// also filter nested fields. For example, you could specify **mySql.username
1368    /// = %lt;my_username%gt;** to list all connection profiles configured to
1369    /// connect with a specific username.
1370    pub filter: std::string::String,
1371
1372    /// A comma-separated list of fields to order results according to.
1373    pub order_by: std::string::String,
1374
1375    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1376}
1377
1378impl ListConnectionProfilesRequest {
1379    pub fn new() -> Self {
1380        std::default::Default::default()
1381    }
1382
1383    /// Sets the value of [parent][crate::model::ListConnectionProfilesRequest::parent].
1384    ///
1385    /// # Example
1386    /// ```ignore,no_run
1387    /// # use google_cloud_clouddms_v1::model::ListConnectionProfilesRequest;
1388    /// let x = ListConnectionProfilesRequest::new().set_parent("example");
1389    /// ```
1390    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1391        self.parent = v.into();
1392        self
1393    }
1394
1395    /// Sets the value of [page_size][crate::model::ListConnectionProfilesRequest::page_size].
1396    ///
1397    /// # Example
1398    /// ```ignore,no_run
1399    /// # use google_cloud_clouddms_v1::model::ListConnectionProfilesRequest;
1400    /// let x = ListConnectionProfilesRequest::new().set_page_size(42);
1401    /// ```
1402    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1403        self.page_size = v.into();
1404        self
1405    }
1406
1407    /// Sets the value of [page_token][crate::model::ListConnectionProfilesRequest::page_token].
1408    ///
1409    /// # Example
1410    /// ```ignore,no_run
1411    /// # use google_cloud_clouddms_v1::model::ListConnectionProfilesRequest;
1412    /// let x = ListConnectionProfilesRequest::new().set_page_token("example");
1413    /// ```
1414    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1415        self.page_token = v.into();
1416        self
1417    }
1418
1419    /// Sets the value of [filter][crate::model::ListConnectionProfilesRequest::filter].
1420    ///
1421    /// # Example
1422    /// ```ignore,no_run
1423    /// # use google_cloud_clouddms_v1::model::ListConnectionProfilesRequest;
1424    /// let x = ListConnectionProfilesRequest::new().set_filter("example");
1425    /// ```
1426    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1427        self.filter = v.into();
1428        self
1429    }
1430
1431    /// Sets the value of [order_by][crate::model::ListConnectionProfilesRequest::order_by].
1432    ///
1433    /// # Example
1434    /// ```ignore,no_run
1435    /// # use google_cloud_clouddms_v1::model::ListConnectionProfilesRequest;
1436    /// let x = ListConnectionProfilesRequest::new().set_order_by("example");
1437    /// ```
1438    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1439        self.order_by = v.into();
1440        self
1441    }
1442}
1443
1444impl wkt::message::Message for ListConnectionProfilesRequest {
1445    fn typename() -> &'static str {
1446        "type.googleapis.com/google.cloud.clouddms.v1.ListConnectionProfilesRequest"
1447    }
1448}
1449
1450/// Response message for 'ListConnectionProfiles' request.
1451#[derive(Clone, Default, PartialEq)]
1452#[non_exhaustive]
1453pub struct ListConnectionProfilesResponse {
1454    /// The response list of connection profiles.
1455    pub connection_profiles: std::vec::Vec<crate::model::ConnectionProfile>,
1456
1457    /// A token which can be sent as `page_token` to retrieve the next page.
1458    /// If this field is omitted, there are no subsequent pages.
1459    pub next_page_token: std::string::String,
1460
1461    /// Locations that could not be reached.
1462    pub unreachable: std::vec::Vec<std::string::String>,
1463
1464    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1465}
1466
1467impl ListConnectionProfilesResponse {
1468    pub fn new() -> Self {
1469        std::default::Default::default()
1470    }
1471
1472    /// Sets the value of [connection_profiles][crate::model::ListConnectionProfilesResponse::connection_profiles].
1473    ///
1474    /// # Example
1475    /// ```ignore,no_run
1476    /// # use google_cloud_clouddms_v1::model::ListConnectionProfilesResponse;
1477    /// use google_cloud_clouddms_v1::model::ConnectionProfile;
1478    /// let x = ListConnectionProfilesResponse::new()
1479    ///     .set_connection_profiles([
1480    ///         ConnectionProfile::default()/* use setters */,
1481    ///         ConnectionProfile::default()/* use (different) setters */,
1482    ///     ]);
1483    /// ```
1484    pub fn set_connection_profiles<T, V>(mut self, v: T) -> Self
1485    where
1486        T: std::iter::IntoIterator<Item = V>,
1487        V: std::convert::Into<crate::model::ConnectionProfile>,
1488    {
1489        use std::iter::Iterator;
1490        self.connection_profiles = v.into_iter().map(|i| i.into()).collect();
1491        self
1492    }
1493
1494    /// Sets the value of [next_page_token][crate::model::ListConnectionProfilesResponse::next_page_token].
1495    ///
1496    /// # Example
1497    /// ```ignore,no_run
1498    /// # use google_cloud_clouddms_v1::model::ListConnectionProfilesResponse;
1499    /// let x = ListConnectionProfilesResponse::new().set_next_page_token("example");
1500    /// ```
1501    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1502        self.next_page_token = v.into();
1503        self
1504    }
1505
1506    /// Sets the value of [unreachable][crate::model::ListConnectionProfilesResponse::unreachable].
1507    ///
1508    /// # Example
1509    /// ```ignore,no_run
1510    /// # use google_cloud_clouddms_v1::model::ListConnectionProfilesResponse;
1511    /// let x = ListConnectionProfilesResponse::new().set_unreachable(["a", "b", "c"]);
1512    /// ```
1513    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1514    where
1515        T: std::iter::IntoIterator<Item = V>,
1516        V: std::convert::Into<std::string::String>,
1517    {
1518        use std::iter::Iterator;
1519        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1520        self
1521    }
1522}
1523
1524impl wkt::message::Message for ListConnectionProfilesResponse {
1525    fn typename() -> &'static str {
1526        "type.googleapis.com/google.cloud.clouddms.v1.ListConnectionProfilesResponse"
1527    }
1528}
1529
1530#[doc(hidden)]
1531impl google_cloud_gax::paginator::internal::PageableResponse for ListConnectionProfilesResponse {
1532    type PageItem = crate::model::ConnectionProfile;
1533
1534    fn items(self) -> std::vec::Vec<Self::PageItem> {
1535        self.connection_profiles
1536    }
1537
1538    fn next_page_token(&self) -> std::string::String {
1539        use std::clone::Clone;
1540        self.next_page_token.clone()
1541    }
1542}
1543
1544/// Request message for 'GetConnectionProfile' request.
1545#[derive(Clone, Default, PartialEq)]
1546#[non_exhaustive]
1547pub struct GetConnectionProfileRequest {
1548    /// Required. Name of the connection profile resource to get.
1549    pub name: std::string::String,
1550
1551    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1552}
1553
1554impl GetConnectionProfileRequest {
1555    pub fn new() -> Self {
1556        std::default::Default::default()
1557    }
1558
1559    /// Sets the value of [name][crate::model::GetConnectionProfileRequest::name].
1560    ///
1561    /// # Example
1562    /// ```ignore,no_run
1563    /// # use google_cloud_clouddms_v1::model::GetConnectionProfileRequest;
1564    /// let x = GetConnectionProfileRequest::new().set_name("example");
1565    /// ```
1566    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1567        self.name = v.into();
1568        self
1569    }
1570}
1571
1572impl wkt::message::Message for GetConnectionProfileRequest {
1573    fn typename() -> &'static str {
1574        "type.googleapis.com/google.cloud.clouddms.v1.GetConnectionProfileRequest"
1575    }
1576}
1577
1578/// Request message for 'CreateConnectionProfile' request.
1579#[derive(Clone, Default, PartialEq)]
1580#[non_exhaustive]
1581pub struct CreateConnectionProfileRequest {
1582    /// Required. The parent which owns this collection of connection profiles.
1583    pub parent: std::string::String,
1584
1585    /// Required. The connection profile identifier.
1586    pub connection_profile_id: std::string::String,
1587
1588    /// Required. The create request body including the connection profile data
1589    pub connection_profile: std::option::Option<crate::model::ConnectionProfile>,
1590
1591    /// Optional. A unique ID used to identify the request. If the server receives
1592    /// two requests with the same ID, then the second request is ignored.
1593    ///
1594    /// It is recommended to always set this value to a UUID.
1595    ///
1596    /// The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
1597    /// (_), and hyphens (-). The maximum length is 40 characters.
1598    pub request_id: std::string::String,
1599
1600    /// Optional. Only validate the connection profile, but don't create any
1601    /// resources. The default is false. Only supported for Oracle connection
1602    /// profiles.
1603    pub validate_only: bool,
1604
1605    /// Optional. Create the connection profile without validating it.
1606    /// The default is false.
1607    /// Only supported for Oracle connection profiles.
1608    pub skip_validation: bool,
1609
1610    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1611}
1612
1613impl CreateConnectionProfileRequest {
1614    pub fn new() -> Self {
1615        std::default::Default::default()
1616    }
1617
1618    /// Sets the value of [parent][crate::model::CreateConnectionProfileRequest::parent].
1619    ///
1620    /// # Example
1621    /// ```ignore,no_run
1622    /// # use google_cloud_clouddms_v1::model::CreateConnectionProfileRequest;
1623    /// let x = CreateConnectionProfileRequest::new().set_parent("example");
1624    /// ```
1625    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1626        self.parent = v.into();
1627        self
1628    }
1629
1630    /// Sets the value of [connection_profile_id][crate::model::CreateConnectionProfileRequest::connection_profile_id].
1631    ///
1632    /// # Example
1633    /// ```ignore,no_run
1634    /// # use google_cloud_clouddms_v1::model::CreateConnectionProfileRequest;
1635    /// let x = CreateConnectionProfileRequest::new().set_connection_profile_id("example");
1636    /// ```
1637    pub fn set_connection_profile_id<T: std::convert::Into<std::string::String>>(
1638        mut self,
1639        v: T,
1640    ) -> Self {
1641        self.connection_profile_id = v.into();
1642        self
1643    }
1644
1645    /// Sets the value of [connection_profile][crate::model::CreateConnectionProfileRequest::connection_profile].
1646    ///
1647    /// # Example
1648    /// ```ignore,no_run
1649    /// # use google_cloud_clouddms_v1::model::CreateConnectionProfileRequest;
1650    /// use google_cloud_clouddms_v1::model::ConnectionProfile;
1651    /// let x = CreateConnectionProfileRequest::new().set_connection_profile(ConnectionProfile::default()/* use setters */);
1652    /// ```
1653    pub fn set_connection_profile<T>(mut self, v: T) -> Self
1654    where
1655        T: std::convert::Into<crate::model::ConnectionProfile>,
1656    {
1657        self.connection_profile = std::option::Option::Some(v.into());
1658        self
1659    }
1660
1661    /// Sets or clears the value of [connection_profile][crate::model::CreateConnectionProfileRequest::connection_profile].
1662    ///
1663    /// # Example
1664    /// ```ignore,no_run
1665    /// # use google_cloud_clouddms_v1::model::CreateConnectionProfileRequest;
1666    /// use google_cloud_clouddms_v1::model::ConnectionProfile;
1667    /// let x = CreateConnectionProfileRequest::new().set_or_clear_connection_profile(Some(ConnectionProfile::default()/* use setters */));
1668    /// let x = CreateConnectionProfileRequest::new().set_or_clear_connection_profile(None::<ConnectionProfile>);
1669    /// ```
1670    pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
1671    where
1672        T: std::convert::Into<crate::model::ConnectionProfile>,
1673    {
1674        self.connection_profile = v.map(|x| x.into());
1675        self
1676    }
1677
1678    /// Sets the value of [request_id][crate::model::CreateConnectionProfileRequest::request_id].
1679    ///
1680    /// # Example
1681    /// ```ignore,no_run
1682    /// # use google_cloud_clouddms_v1::model::CreateConnectionProfileRequest;
1683    /// let x = CreateConnectionProfileRequest::new().set_request_id("example");
1684    /// ```
1685    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1686        self.request_id = v.into();
1687        self
1688    }
1689
1690    /// Sets the value of [validate_only][crate::model::CreateConnectionProfileRequest::validate_only].
1691    ///
1692    /// # Example
1693    /// ```ignore,no_run
1694    /// # use google_cloud_clouddms_v1::model::CreateConnectionProfileRequest;
1695    /// let x = CreateConnectionProfileRequest::new().set_validate_only(true);
1696    /// ```
1697    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1698        self.validate_only = v.into();
1699        self
1700    }
1701
1702    /// Sets the value of [skip_validation][crate::model::CreateConnectionProfileRequest::skip_validation].
1703    ///
1704    /// # Example
1705    /// ```ignore,no_run
1706    /// # use google_cloud_clouddms_v1::model::CreateConnectionProfileRequest;
1707    /// let x = CreateConnectionProfileRequest::new().set_skip_validation(true);
1708    /// ```
1709    pub fn set_skip_validation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1710        self.skip_validation = v.into();
1711        self
1712    }
1713}
1714
1715impl wkt::message::Message for CreateConnectionProfileRequest {
1716    fn typename() -> &'static str {
1717        "type.googleapis.com/google.cloud.clouddms.v1.CreateConnectionProfileRequest"
1718    }
1719}
1720
1721/// Request message for 'UpdateConnectionProfile' request.
1722#[derive(Clone, Default, PartialEq)]
1723#[non_exhaustive]
1724pub struct UpdateConnectionProfileRequest {
1725    /// Required. Field mask is used to specify the fields to be overwritten by the
1726    /// update in the conversion workspace resource.
1727    pub update_mask: std::option::Option<wkt::FieldMask>,
1728
1729    /// Required. The connection profile parameters to update.
1730    pub connection_profile: std::option::Option<crate::model::ConnectionProfile>,
1731
1732    /// Optional. A unique ID used to identify the request. If the server receives
1733    /// two requests with the same ID, then the second request is ignored.
1734    ///
1735    /// It is recommended to always set this value to a UUID.
1736    ///
1737    /// The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
1738    /// (_), and hyphens (-). The maximum length is 40 characters.
1739    pub request_id: std::string::String,
1740
1741    /// Optional. Only validate the connection profile, but don't update any
1742    /// resources. The default is false. Only supported for Oracle connection
1743    /// profiles.
1744    pub validate_only: bool,
1745
1746    /// Optional. Update the connection profile without validating it.
1747    /// The default is false.
1748    /// Only supported for Oracle connection profiles.
1749    pub skip_validation: bool,
1750
1751    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1752}
1753
1754impl UpdateConnectionProfileRequest {
1755    pub fn new() -> Self {
1756        std::default::Default::default()
1757    }
1758
1759    /// Sets the value of [update_mask][crate::model::UpdateConnectionProfileRequest::update_mask].
1760    ///
1761    /// # Example
1762    /// ```ignore,no_run
1763    /// # use google_cloud_clouddms_v1::model::UpdateConnectionProfileRequest;
1764    /// use wkt::FieldMask;
1765    /// let x = UpdateConnectionProfileRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1766    /// ```
1767    pub fn set_update_mask<T>(mut self, v: T) -> Self
1768    where
1769        T: std::convert::Into<wkt::FieldMask>,
1770    {
1771        self.update_mask = std::option::Option::Some(v.into());
1772        self
1773    }
1774
1775    /// Sets or clears the value of [update_mask][crate::model::UpdateConnectionProfileRequest::update_mask].
1776    ///
1777    /// # Example
1778    /// ```ignore,no_run
1779    /// # use google_cloud_clouddms_v1::model::UpdateConnectionProfileRequest;
1780    /// use wkt::FieldMask;
1781    /// let x = UpdateConnectionProfileRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1782    /// let x = UpdateConnectionProfileRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1783    /// ```
1784    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1785    where
1786        T: std::convert::Into<wkt::FieldMask>,
1787    {
1788        self.update_mask = v.map(|x| x.into());
1789        self
1790    }
1791
1792    /// Sets the value of [connection_profile][crate::model::UpdateConnectionProfileRequest::connection_profile].
1793    ///
1794    /// # Example
1795    /// ```ignore,no_run
1796    /// # use google_cloud_clouddms_v1::model::UpdateConnectionProfileRequest;
1797    /// use google_cloud_clouddms_v1::model::ConnectionProfile;
1798    /// let x = UpdateConnectionProfileRequest::new().set_connection_profile(ConnectionProfile::default()/* use setters */);
1799    /// ```
1800    pub fn set_connection_profile<T>(mut self, v: T) -> Self
1801    where
1802        T: std::convert::Into<crate::model::ConnectionProfile>,
1803    {
1804        self.connection_profile = std::option::Option::Some(v.into());
1805        self
1806    }
1807
1808    /// Sets or clears the value of [connection_profile][crate::model::UpdateConnectionProfileRequest::connection_profile].
1809    ///
1810    /// # Example
1811    /// ```ignore,no_run
1812    /// # use google_cloud_clouddms_v1::model::UpdateConnectionProfileRequest;
1813    /// use google_cloud_clouddms_v1::model::ConnectionProfile;
1814    /// let x = UpdateConnectionProfileRequest::new().set_or_clear_connection_profile(Some(ConnectionProfile::default()/* use setters */));
1815    /// let x = UpdateConnectionProfileRequest::new().set_or_clear_connection_profile(None::<ConnectionProfile>);
1816    /// ```
1817    pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
1818    where
1819        T: std::convert::Into<crate::model::ConnectionProfile>,
1820    {
1821        self.connection_profile = v.map(|x| x.into());
1822        self
1823    }
1824
1825    /// Sets the value of [request_id][crate::model::UpdateConnectionProfileRequest::request_id].
1826    ///
1827    /// # Example
1828    /// ```ignore,no_run
1829    /// # use google_cloud_clouddms_v1::model::UpdateConnectionProfileRequest;
1830    /// let x = UpdateConnectionProfileRequest::new().set_request_id("example");
1831    /// ```
1832    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1833        self.request_id = v.into();
1834        self
1835    }
1836
1837    /// Sets the value of [validate_only][crate::model::UpdateConnectionProfileRequest::validate_only].
1838    ///
1839    /// # Example
1840    /// ```ignore,no_run
1841    /// # use google_cloud_clouddms_v1::model::UpdateConnectionProfileRequest;
1842    /// let x = UpdateConnectionProfileRequest::new().set_validate_only(true);
1843    /// ```
1844    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1845        self.validate_only = v.into();
1846        self
1847    }
1848
1849    /// Sets the value of [skip_validation][crate::model::UpdateConnectionProfileRequest::skip_validation].
1850    ///
1851    /// # Example
1852    /// ```ignore,no_run
1853    /// # use google_cloud_clouddms_v1::model::UpdateConnectionProfileRequest;
1854    /// let x = UpdateConnectionProfileRequest::new().set_skip_validation(true);
1855    /// ```
1856    pub fn set_skip_validation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1857        self.skip_validation = v.into();
1858        self
1859    }
1860}
1861
1862impl wkt::message::Message for UpdateConnectionProfileRequest {
1863    fn typename() -> &'static str {
1864        "type.googleapis.com/google.cloud.clouddms.v1.UpdateConnectionProfileRequest"
1865    }
1866}
1867
1868/// Request message for 'DeleteConnectionProfile' request.
1869#[derive(Clone, Default, PartialEq)]
1870#[non_exhaustive]
1871pub struct DeleteConnectionProfileRequest {
1872    /// Required. Name of the connection profile resource to delete.
1873    pub name: std::string::String,
1874
1875    /// A unique ID used to identify the request. If the server receives two
1876    /// requests with the same ID, then the second request is ignored.
1877    ///
1878    /// It is recommended to always set this value to a UUID.
1879    ///
1880    /// The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
1881    /// (_), and hyphens (-). The maximum length is 40 characters.
1882    pub request_id: std::string::String,
1883
1884    /// In case of force delete, the CloudSQL replica database is also deleted
1885    /// (only for CloudSQL connection profile).
1886    pub force: bool,
1887
1888    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1889}
1890
1891impl DeleteConnectionProfileRequest {
1892    pub fn new() -> Self {
1893        std::default::Default::default()
1894    }
1895
1896    /// Sets the value of [name][crate::model::DeleteConnectionProfileRequest::name].
1897    ///
1898    /// # Example
1899    /// ```ignore,no_run
1900    /// # use google_cloud_clouddms_v1::model::DeleteConnectionProfileRequest;
1901    /// let x = DeleteConnectionProfileRequest::new().set_name("example");
1902    /// ```
1903    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1904        self.name = v.into();
1905        self
1906    }
1907
1908    /// Sets the value of [request_id][crate::model::DeleteConnectionProfileRequest::request_id].
1909    ///
1910    /// # Example
1911    /// ```ignore,no_run
1912    /// # use google_cloud_clouddms_v1::model::DeleteConnectionProfileRequest;
1913    /// let x = DeleteConnectionProfileRequest::new().set_request_id("example");
1914    /// ```
1915    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1916        self.request_id = v.into();
1917        self
1918    }
1919
1920    /// Sets the value of [force][crate::model::DeleteConnectionProfileRequest::force].
1921    ///
1922    /// # Example
1923    /// ```ignore,no_run
1924    /// # use google_cloud_clouddms_v1::model::DeleteConnectionProfileRequest;
1925    /// let x = DeleteConnectionProfileRequest::new().set_force(true);
1926    /// ```
1927    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1928        self.force = v.into();
1929        self
1930    }
1931}
1932
1933impl wkt::message::Message for DeleteConnectionProfileRequest {
1934    fn typename() -> &'static str {
1935        "type.googleapis.com/google.cloud.clouddms.v1.DeleteConnectionProfileRequest"
1936    }
1937}
1938
1939/// Request message to create a new private connection in the specified project
1940/// and region.
1941#[derive(Clone, Default, PartialEq)]
1942#[non_exhaustive]
1943pub struct CreatePrivateConnectionRequest {
1944    /// Required. The parent that owns the collection of PrivateConnections.
1945    pub parent: std::string::String,
1946
1947    /// Required. The private connection identifier.
1948    pub private_connection_id: std::string::String,
1949
1950    /// Required. The private connection resource to create.
1951    pub private_connection: std::option::Option<crate::model::PrivateConnection>,
1952
1953    /// Optional. A unique ID used to identify the request. If the server receives
1954    /// two requests with the same ID, then the second request is ignored.
1955    ///
1956    /// It is recommended to always set this value to a UUID.
1957    ///
1958    /// The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
1959    /// (_), and hyphens (-). The maximum length is 40 characters.
1960    pub request_id: std::string::String,
1961
1962    /// Optional. If set to true, will skip validations.
1963    pub skip_validation: bool,
1964
1965    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1966}
1967
1968impl CreatePrivateConnectionRequest {
1969    pub fn new() -> Self {
1970        std::default::Default::default()
1971    }
1972
1973    /// Sets the value of [parent][crate::model::CreatePrivateConnectionRequest::parent].
1974    ///
1975    /// # Example
1976    /// ```ignore,no_run
1977    /// # use google_cloud_clouddms_v1::model::CreatePrivateConnectionRequest;
1978    /// let x = CreatePrivateConnectionRequest::new().set_parent("example");
1979    /// ```
1980    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1981        self.parent = v.into();
1982        self
1983    }
1984
1985    /// Sets the value of [private_connection_id][crate::model::CreatePrivateConnectionRequest::private_connection_id].
1986    ///
1987    /// # Example
1988    /// ```ignore,no_run
1989    /// # use google_cloud_clouddms_v1::model::CreatePrivateConnectionRequest;
1990    /// let x = CreatePrivateConnectionRequest::new().set_private_connection_id("example");
1991    /// ```
1992    pub fn set_private_connection_id<T: std::convert::Into<std::string::String>>(
1993        mut self,
1994        v: T,
1995    ) -> Self {
1996        self.private_connection_id = v.into();
1997        self
1998    }
1999
2000    /// Sets the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
2001    ///
2002    /// # Example
2003    /// ```ignore,no_run
2004    /// # use google_cloud_clouddms_v1::model::CreatePrivateConnectionRequest;
2005    /// use google_cloud_clouddms_v1::model::PrivateConnection;
2006    /// let x = CreatePrivateConnectionRequest::new().set_private_connection(PrivateConnection::default()/* use setters */);
2007    /// ```
2008    pub fn set_private_connection<T>(mut self, v: T) -> Self
2009    where
2010        T: std::convert::Into<crate::model::PrivateConnection>,
2011    {
2012        self.private_connection = std::option::Option::Some(v.into());
2013        self
2014    }
2015
2016    /// Sets or clears the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
2017    ///
2018    /// # Example
2019    /// ```ignore,no_run
2020    /// # use google_cloud_clouddms_v1::model::CreatePrivateConnectionRequest;
2021    /// use google_cloud_clouddms_v1::model::PrivateConnection;
2022    /// let x = CreatePrivateConnectionRequest::new().set_or_clear_private_connection(Some(PrivateConnection::default()/* use setters */));
2023    /// let x = CreatePrivateConnectionRequest::new().set_or_clear_private_connection(None::<PrivateConnection>);
2024    /// ```
2025    pub fn set_or_clear_private_connection<T>(mut self, v: std::option::Option<T>) -> Self
2026    where
2027        T: std::convert::Into<crate::model::PrivateConnection>,
2028    {
2029        self.private_connection = v.map(|x| x.into());
2030        self
2031    }
2032
2033    /// Sets the value of [request_id][crate::model::CreatePrivateConnectionRequest::request_id].
2034    ///
2035    /// # Example
2036    /// ```ignore,no_run
2037    /// # use google_cloud_clouddms_v1::model::CreatePrivateConnectionRequest;
2038    /// let x = CreatePrivateConnectionRequest::new().set_request_id("example");
2039    /// ```
2040    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2041        self.request_id = v.into();
2042        self
2043    }
2044
2045    /// Sets the value of [skip_validation][crate::model::CreatePrivateConnectionRequest::skip_validation].
2046    ///
2047    /// # Example
2048    /// ```ignore,no_run
2049    /// # use google_cloud_clouddms_v1::model::CreatePrivateConnectionRequest;
2050    /// let x = CreatePrivateConnectionRequest::new().set_skip_validation(true);
2051    /// ```
2052    pub fn set_skip_validation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2053        self.skip_validation = v.into();
2054        self
2055    }
2056}
2057
2058impl wkt::message::Message for CreatePrivateConnectionRequest {
2059    fn typename() -> &'static str {
2060        "type.googleapis.com/google.cloud.clouddms.v1.CreatePrivateConnectionRequest"
2061    }
2062}
2063
2064/// Request message to retrieve a list of private connections in a given project
2065/// and location.
2066#[derive(Clone, Default, PartialEq)]
2067#[non_exhaustive]
2068pub struct ListPrivateConnectionsRequest {
2069    /// Required. The parent that owns the collection of private connections.
2070    pub parent: std::string::String,
2071
2072    /// Maximum number of private connections to return.
2073    /// If unspecified, at most 50 private connections that are returned.
2074    /// The maximum value is 1000; values above 1000 are coerced to 1000.
2075    pub page_size: i32,
2076
2077    /// Page token received from a previous `ListPrivateConnections` call.
2078    /// Provide this to retrieve the subsequent page.
2079    ///
2080    /// When paginating, all other parameters provided to
2081    /// `ListPrivateConnections` must match the call that provided the page
2082    /// token.
2083    pub page_token: std::string::String,
2084
2085    /// A filter expression that filters private connections listed in the
2086    /// response. The expression must specify the field name, a comparison
2087    /// operator, and the value that you want to use for filtering. The value must
2088    /// be a string, a number, or a boolean. The comparison operator must be either
2089    /// =, !=, >, or <. For example, list private connections created this year by
2090    /// specifying **createTime %gt; 2021-01-01T00:00:00.000000000Z**.
2091    pub filter: std::string::String,
2092
2093    /// Order by fields for the result.
2094    pub order_by: std::string::String,
2095
2096    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2097}
2098
2099impl ListPrivateConnectionsRequest {
2100    pub fn new() -> Self {
2101        std::default::Default::default()
2102    }
2103
2104    /// Sets the value of [parent][crate::model::ListPrivateConnectionsRequest::parent].
2105    ///
2106    /// # Example
2107    /// ```ignore,no_run
2108    /// # use google_cloud_clouddms_v1::model::ListPrivateConnectionsRequest;
2109    /// let x = ListPrivateConnectionsRequest::new().set_parent("example");
2110    /// ```
2111    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2112        self.parent = v.into();
2113        self
2114    }
2115
2116    /// Sets the value of [page_size][crate::model::ListPrivateConnectionsRequest::page_size].
2117    ///
2118    /// # Example
2119    /// ```ignore,no_run
2120    /// # use google_cloud_clouddms_v1::model::ListPrivateConnectionsRequest;
2121    /// let x = ListPrivateConnectionsRequest::new().set_page_size(42);
2122    /// ```
2123    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2124        self.page_size = v.into();
2125        self
2126    }
2127
2128    /// Sets the value of [page_token][crate::model::ListPrivateConnectionsRequest::page_token].
2129    ///
2130    /// # Example
2131    /// ```ignore,no_run
2132    /// # use google_cloud_clouddms_v1::model::ListPrivateConnectionsRequest;
2133    /// let x = ListPrivateConnectionsRequest::new().set_page_token("example");
2134    /// ```
2135    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2136        self.page_token = v.into();
2137        self
2138    }
2139
2140    /// Sets the value of [filter][crate::model::ListPrivateConnectionsRequest::filter].
2141    ///
2142    /// # Example
2143    /// ```ignore,no_run
2144    /// # use google_cloud_clouddms_v1::model::ListPrivateConnectionsRequest;
2145    /// let x = ListPrivateConnectionsRequest::new().set_filter("example");
2146    /// ```
2147    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2148        self.filter = v.into();
2149        self
2150    }
2151
2152    /// Sets the value of [order_by][crate::model::ListPrivateConnectionsRequest::order_by].
2153    ///
2154    /// # Example
2155    /// ```ignore,no_run
2156    /// # use google_cloud_clouddms_v1::model::ListPrivateConnectionsRequest;
2157    /// let x = ListPrivateConnectionsRequest::new().set_order_by("example");
2158    /// ```
2159    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2160        self.order_by = v.into();
2161        self
2162    }
2163}
2164
2165impl wkt::message::Message for ListPrivateConnectionsRequest {
2166    fn typename() -> &'static str {
2167        "type.googleapis.com/google.cloud.clouddms.v1.ListPrivateConnectionsRequest"
2168    }
2169}
2170
2171/// Response message for 'ListPrivateConnections' request.
2172#[derive(Clone, Default, PartialEq)]
2173#[non_exhaustive]
2174pub struct ListPrivateConnectionsResponse {
2175    /// List of private connections.
2176    pub private_connections: std::vec::Vec<crate::model::PrivateConnection>,
2177
2178    /// A token which can be sent as `page_token` to retrieve the next page.
2179    /// If this field is omitted, there are no subsequent pages.
2180    pub next_page_token: std::string::String,
2181
2182    /// Locations that could not be reached.
2183    pub unreachable: std::vec::Vec<std::string::String>,
2184
2185    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2186}
2187
2188impl ListPrivateConnectionsResponse {
2189    pub fn new() -> Self {
2190        std::default::Default::default()
2191    }
2192
2193    /// Sets the value of [private_connections][crate::model::ListPrivateConnectionsResponse::private_connections].
2194    ///
2195    /// # Example
2196    /// ```ignore,no_run
2197    /// # use google_cloud_clouddms_v1::model::ListPrivateConnectionsResponse;
2198    /// use google_cloud_clouddms_v1::model::PrivateConnection;
2199    /// let x = ListPrivateConnectionsResponse::new()
2200    ///     .set_private_connections([
2201    ///         PrivateConnection::default()/* use setters */,
2202    ///         PrivateConnection::default()/* use (different) setters */,
2203    ///     ]);
2204    /// ```
2205    pub fn set_private_connections<T, V>(mut self, v: T) -> Self
2206    where
2207        T: std::iter::IntoIterator<Item = V>,
2208        V: std::convert::Into<crate::model::PrivateConnection>,
2209    {
2210        use std::iter::Iterator;
2211        self.private_connections = v.into_iter().map(|i| i.into()).collect();
2212        self
2213    }
2214
2215    /// Sets the value of [next_page_token][crate::model::ListPrivateConnectionsResponse::next_page_token].
2216    ///
2217    /// # Example
2218    /// ```ignore,no_run
2219    /// # use google_cloud_clouddms_v1::model::ListPrivateConnectionsResponse;
2220    /// let x = ListPrivateConnectionsResponse::new().set_next_page_token("example");
2221    /// ```
2222    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2223        self.next_page_token = v.into();
2224        self
2225    }
2226
2227    /// Sets the value of [unreachable][crate::model::ListPrivateConnectionsResponse::unreachable].
2228    ///
2229    /// # Example
2230    /// ```ignore,no_run
2231    /// # use google_cloud_clouddms_v1::model::ListPrivateConnectionsResponse;
2232    /// let x = ListPrivateConnectionsResponse::new().set_unreachable(["a", "b", "c"]);
2233    /// ```
2234    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2235    where
2236        T: std::iter::IntoIterator<Item = V>,
2237        V: std::convert::Into<std::string::String>,
2238    {
2239        use std::iter::Iterator;
2240        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2241        self
2242    }
2243}
2244
2245impl wkt::message::Message for ListPrivateConnectionsResponse {
2246    fn typename() -> &'static str {
2247        "type.googleapis.com/google.cloud.clouddms.v1.ListPrivateConnectionsResponse"
2248    }
2249}
2250
2251#[doc(hidden)]
2252impl google_cloud_gax::paginator::internal::PageableResponse for ListPrivateConnectionsResponse {
2253    type PageItem = crate::model::PrivateConnection;
2254
2255    fn items(self) -> std::vec::Vec<Self::PageItem> {
2256        self.private_connections
2257    }
2258
2259    fn next_page_token(&self) -> std::string::String {
2260        use std::clone::Clone;
2261        self.next_page_token.clone()
2262    }
2263}
2264
2265/// Request message to delete a private connection.
2266#[derive(Clone, Default, PartialEq)]
2267#[non_exhaustive]
2268pub struct DeletePrivateConnectionRequest {
2269    /// Required. The name of the private connection to delete.
2270    pub name: std::string::String,
2271
2272    /// Optional. A unique ID used to identify the request. If the server receives
2273    /// two requests with the same ID, then the second request is ignored.
2274    ///
2275    /// It is recommended to always set this value to a UUID.
2276    ///
2277    /// The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
2278    /// (_), and hyphens (-). The maximum length is 40 characters.
2279    pub request_id: std::string::String,
2280
2281    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2282}
2283
2284impl DeletePrivateConnectionRequest {
2285    pub fn new() -> Self {
2286        std::default::Default::default()
2287    }
2288
2289    /// Sets the value of [name][crate::model::DeletePrivateConnectionRequest::name].
2290    ///
2291    /// # Example
2292    /// ```ignore,no_run
2293    /// # use google_cloud_clouddms_v1::model::DeletePrivateConnectionRequest;
2294    /// let x = DeletePrivateConnectionRequest::new().set_name("example");
2295    /// ```
2296    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2297        self.name = v.into();
2298        self
2299    }
2300
2301    /// Sets the value of [request_id][crate::model::DeletePrivateConnectionRequest::request_id].
2302    ///
2303    /// # Example
2304    /// ```ignore,no_run
2305    /// # use google_cloud_clouddms_v1::model::DeletePrivateConnectionRequest;
2306    /// let x = DeletePrivateConnectionRequest::new().set_request_id("example");
2307    /// ```
2308    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2309        self.request_id = v.into();
2310        self
2311    }
2312}
2313
2314impl wkt::message::Message for DeletePrivateConnectionRequest {
2315    fn typename() -> &'static str {
2316        "type.googleapis.com/google.cloud.clouddms.v1.DeletePrivateConnectionRequest"
2317    }
2318}
2319
2320/// Request message to get a private connection resource.
2321#[derive(Clone, Default, PartialEq)]
2322#[non_exhaustive]
2323pub struct GetPrivateConnectionRequest {
2324    /// Required. The name of the private connection to get.
2325    pub name: std::string::String,
2326
2327    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2328}
2329
2330impl GetPrivateConnectionRequest {
2331    pub fn new() -> Self {
2332        std::default::Default::default()
2333    }
2334
2335    /// Sets the value of [name][crate::model::GetPrivateConnectionRequest::name].
2336    ///
2337    /// # Example
2338    /// ```ignore,no_run
2339    /// # use google_cloud_clouddms_v1::model::GetPrivateConnectionRequest;
2340    /// let x = GetPrivateConnectionRequest::new().set_name("example");
2341    /// ```
2342    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2343        self.name = v.into();
2344        self
2345    }
2346}
2347
2348impl wkt::message::Message for GetPrivateConnectionRequest {
2349    fn typename() -> &'static str {
2350        "type.googleapis.com/google.cloud.clouddms.v1.GetPrivateConnectionRequest"
2351    }
2352}
2353
2354/// Represents the metadata of the long-running operation.
2355#[derive(Clone, Default, PartialEq)]
2356#[non_exhaustive]
2357pub struct OperationMetadata {
2358    /// Output only. The time the operation was created.
2359    pub create_time: std::option::Option<wkt::Timestamp>,
2360
2361    /// Output only. The time the operation finished running.
2362    pub end_time: std::option::Option<wkt::Timestamp>,
2363
2364    /// Output only. Server-defined resource path for the target of the operation.
2365    pub target: std::string::String,
2366
2367    /// Output only. Name of the verb executed by the operation.
2368    pub verb: std::string::String,
2369
2370    /// Output only. Human-readable status of the operation, if any.
2371    pub status_message: std::string::String,
2372
2373    /// Output only. Identifies whether the user has requested cancellation
2374    /// of the operation. Operations that have successfully been cancelled
2375    /// have
2376    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
2377    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
2378    /// corresponding to `Code.CANCELLED`.
2379    ///
2380    /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
2381    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
2382    pub requested_cancellation: bool,
2383
2384    /// Output only. API version used to start the operation.
2385    pub api_version: std::string::String,
2386
2387    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2388}
2389
2390impl OperationMetadata {
2391    pub fn new() -> Self {
2392        std::default::Default::default()
2393    }
2394
2395    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
2396    ///
2397    /// # Example
2398    /// ```ignore,no_run
2399    /// # use google_cloud_clouddms_v1::model::OperationMetadata;
2400    /// use wkt::Timestamp;
2401    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
2402    /// ```
2403    pub fn set_create_time<T>(mut self, v: T) -> Self
2404    where
2405        T: std::convert::Into<wkt::Timestamp>,
2406    {
2407        self.create_time = std::option::Option::Some(v.into());
2408        self
2409    }
2410
2411    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
2412    ///
2413    /// # Example
2414    /// ```ignore,no_run
2415    /// # use google_cloud_clouddms_v1::model::OperationMetadata;
2416    /// use wkt::Timestamp;
2417    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2418    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
2419    /// ```
2420    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2421    where
2422        T: std::convert::Into<wkt::Timestamp>,
2423    {
2424        self.create_time = v.map(|x| x.into());
2425        self
2426    }
2427
2428    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
2429    ///
2430    /// # Example
2431    /// ```ignore,no_run
2432    /// # use google_cloud_clouddms_v1::model::OperationMetadata;
2433    /// use wkt::Timestamp;
2434    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
2435    /// ```
2436    pub fn set_end_time<T>(mut self, v: T) -> Self
2437    where
2438        T: std::convert::Into<wkt::Timestamp>,
2439    {
2440        self.end_time = std::option::Option::Some(v.into());
2441        self
2442    }
2443
2444    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
2445    ///
2446    /// # Example
2447    /// ```ignore,no_run
2448    /// # use google_cloud_clouddms_v1::model::OperationMetadata;
2449    /// use wkt::Timestamp;
2450    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
2451    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
2452    /// ```
2453    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2454    where
2455        T: std::convert::Into<wkt::Timestamp>,
2456    {
2457        self.end_time = v.map(|x| x.into());
2458        self
2459    }
2460
2461    /// Sets the value of [target][crate::model::OperationMetadata::target].
2462    ///
2463    /// # Example
2464    /// ```ignore,no_run
2465    /// # use google_cloud_clouddms_v1::model::OperationMetadata;
2466    /// let x = OperationMetadata::new().set_target("example");
2467    /// ```
2468    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2469        self.target = v.into();
2470        self
2471    }
2472
2473    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
2474    ///
2475    /// # Example
2476    /// ```ignore,no_run
2477    /// # use google_cloud_clouddms_v1::model::OperationMetadata;
2478    /// let x = OperationMetadata::new().set_verb("example");
2479    /// ```
2480    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2481        self.verb = v.into();
2482        self
2483    }
2484
2485    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
2486    ///
2487    /// # Example
2488    /// ```ignore,no_run
2489    /// # use google_cloud_clouddms_v1::model::OperationMetadata;
2490    /// let x = OperationMetadata::new().set_status_message("example");
2491    /// ```
2492    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2493        self.status_message = v.into();
2494        self
2495    }
2496
2497    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
2498    ///
2499    /// # Example
2500    /// ```ignore,no_run
2501    /// # use google_cloud_clouddms_v1::model::OperationMetadata;
2502    /// let x = OperationMetadata::new().set_requested_cancellation(true);
2503    /// ```
2504    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2505        self.requested_cancellation = v.into();
2506        self
2507    }
2508
2509    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
2510    ///
2511    /// # Example
2512    /// ```ignore,no_run
2513    /// # use google_cloud_clouddms_v1::model::OperationMetadata;
2514    /// let x = OperationMetadata::new().set_api_version("example");
2515    /// ```
2516    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2517        self.api_version = v.into();
2518        self
2519    }
2520}
2521
2522impl wkt::message::Message for OperationMetadata {
2523    fn typename() -> &'static str {
2524        "type.googleapis.com/google.cloud.clouddms.v1.OperationMetadata"
2525    }
2526}
2527
2528/// Retrieve a list of all conversion workspaces in a given project and location.
2529#[derive(Clone, Default, PartialEq)]
2530#[non_exhaustive]
2531pub struct ListConversionWorkspacesRequest {
2532    /// Required. The parent which owns this collection of conversion workspaces.
2533    pub parent: std::string::String,
2534
2535    /// The maximum number of conversion workspaces to return. The service may
2536    /// return fewer than this value. If unspecified, at most 50 sets are returned.
2537    pub page_size: i32,
2538
2539    /// The nextPageToken value received in the previous call to
2540    /// conversionWorkspaces.list, used in the subsequent request to retrieve the
2541    /// next page of results. On first call this should be left blank. When
2542    /// paginating, all other parameters provided to conversionWorkspaces.list must
2543    /// match the call that provided the page token.
2544    pub page_token: std::string::String,
2545
2546    /// A filter expression that filters conversion workspaces listed in the
2547    /// response. The expression must specify the field name, a comparison
2548    /// operator, and the value that you want to use for filtering. The value must
2549    /// be a string, a number, or a boolean. The comparison operator must be either
2550    /// =, !=, >, or <. For example, list conversion workspaces created this year
2551    /// by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** You can
2552    /// also filter nested fields. For example, you could specify
2553    /// **source.version = "12.c.1"** to select all conversion workspaces with
2554    /// source database version equal to 12.c.1.
2555    pub filter: std::string::String,
2556
2557    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2558}
2559
2560impl ListConversionWorkspacesRequest {
2561    pub fn new() -> Self {
2562        std::default::Default::default()
2563    }
2564
2565    /// Sets the value of [parent][crate::model::ListConversionWorkspacesRequest::parent].
2566    ///
2567    /// # Example
2568    /// ```ignore,no_run
2569    /// # use google_cloud_clouddms_v1::model::ListConversionWorkspacesRequest;
2570    /// let x = ListConversionWorkspacesRequest::new().set_parent("example");
2571    /// ```
2572    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2573        self.parent = v.into();
2574        self
2575    }
2576
2577    /// Sets the value of [page_size][crate::model::ListConversionWorkspacesRequest::page_size].
2578    ///
2579    /// # Example
2580    /// ```ignore,no_run
2581    /// # use google_cloud_clouddms_v1::model::ListConversionWorkspacesRequest;
2582    /// let x = ListConversionWorkspacesRequest::new().set_page_size(42);
2583    /// ```
2584    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2585        self.page_size = v.into();
2586        self
2587    }
2588
2589    /// Sets the value of [page_token][crate::model::ListConversionWorkspacesRequest::page_token].
2590    ///
2591    /// # Example
2592    /// ```ignore,no_run
2593    /// # use google_cloud_clouddms_v1::model::ListConversionWorkspacesRequest;
2594    /// let x = ListConversionWorkspacesRequest::new().set_page_token("example");
2595    /// ```
2596    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2597        self.page_token = v.into();
2598        self
2599    }
2600
2601    /// Sets the value of [filter][crate::model::ListConversionWorkspacesRequest::filter].
2602    ///
2603    /// # Example
2604    /// ```ignore,no_run
2605    /// # use google_cloud_clouddms_v1::model::ListConversionWorkspacesRequest;
2606    /// let x = ListConversionWorkspacesRequest::new().set_filter("example");
2607    /// ```
2608    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2609        self.filter = v.into();
2610        self
2611    }
2612}
2613
2614impl wkt::message::Message for ListConversionWorkspacesRequest {
2615    fn typename() -> &'static str {
2616        "type.googleapis.com/google.cloud.clouddms.v1.ListConversionWorkspacesRequest"
2617    }
2618}
2619
2620/// Response message for 'ListConversionWorkspaces' request.
2621#[derive(Clone, Default, PartialEq)]
2622#[non_exhaustive]
2623pub struct ListConversionWorkspacesResponse {
2624    /// The list of conversion workspace objects.
2625    pub conversion_workspaces: std::vec::Vec<crate::model::ConversionWorkspace>,
2626
2627    /// A token which can be sent as `page_token` to retrieve the next page.
2628    /// If this field is omitted, there are no subsequent pages.
2629    pub next_page_token: std::string::String,
2630
2631    /// Locations that could not be reached.
2632    pub unreachable: std::vec::Vec<std::string::String>,
2633
2634    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2635}
2636
2637impl ListConversionWorkspacesResponse {
2638    pub fn new() -> Self {
2639        std::default::Default::default()
2640    }
2641
2642    /// Sets the value of [conversion_workspaces][crate::model::ListConversionWorkspacesResponse::conversion_workspaces].
2643    ///
2644    /// # Example
2645    /// ```ignore,no_run
2646    /// # use google_cloud_clouddms_v1::model::ListConversionWorkspacesResponse;
2647    /// use google_cloud_clouddms_v1::model::ConversionWorkspace;
2648    /// let x = ListConversionWorkspacesResponse::new()
2649    ///     .set_conversion_workspaces([
2650    ///         ConversionWorkspace::default()/* use setters */,
2651    ///         ConversionWorkspace::default()/* use (different) setters */,
2652    ///     ]);
2653    /// ```
2654    pub fn set_conversion_workspaces<T, V>(mut self, v: T) -> Self
2655    where
2656        T: std::iter::IntoIterator<Item = V>,
2657        V: std::convert::Into<crate::model::ConversionWorkspace>,
2658    {
2659        use std::iter::Iterator;
2660        self.conversion_workspaces = v.into_iter().map(|i| i.into()).collect();
2661        self
2662    }
2663
2664    /// Sets the value of [next_page_token][crate::model::ListConversionWorkspacesResponse::next_page_token].
2665    ///
2666    /// # Example
2667    /// ```ignore,no_run
2668    /// # use google_cloud_clouddms_v1::model::ListConversionWorkspacesResponse;
2669    /// let x = ListConversionWorkspacesResponse::new().set_next_page_token("example");
2670    /// ```
2671    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2672        self.next_page_token = v.into();
2673        self
2674    }
2675
2676    /// Sets the value of [unreachable][crate::model::ListConversionWorkspacesResponse::unreachable].
2677    ///
2678    /// # Example
2679    /// ```ignore,no_run
2680    /// # use google_cloud_clouddms_v1::model::ListConversionWorkspacesResponse;
2681    /// let x = ListConversionWorkspacesResponse::new().set_unreachable(["a", "b", "c"]);
2682    /// ```
2683    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2684    where
2685        T: std::iter::IntoIterator<Item = V>,
2686        V: std::convert::Into<std::string::String>,
2687    {
2688        use std::iter::Iterator;
2689        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2690        self
2691    }
2692}
2693
2694impl wkt::message::Message for ListConversionWorkspacesResponse {
2695    fn typename() -> &'static str {
2696        "type.googleapis.com/google.cloud.clouddms.v1.ListConversionWorkspacesResponse"
2697    }
2698}
2699
2700#[doc(hidden)]
2701impl google_cloud_gax::paginator::internal::PageableResponse for ListConversionWorkspacesResponse {
2702    type PageItem = crate::model::ConversionWorkspace;
2703
2704    fn items(self) -> std::vec::Vec<Self::PageItem> {
2705        self.conversion_workspaces
2706    }
2707
2708    fn next_page_token(&self) -> std::string::String {
2709        use std::clone::Clone;
2710        self.next_page_token.clone()
2711    }
2712}
2713
2714/// Request message for 'GetConversionWorkspace' request.
2715#[derive(Clone, Default, PartialEq)]
2716#[non_exhaustive]
2717pub struct GetConversionWorkspaceRequest {
2718    /// Required. Name of the conversion workspace resource to get.
2719    pub name: std::string::String,
2720
2721    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2722}
2723
2724impl GetConversionWorkspaceRequest {
2725    pub fn new() -> Self {
2726        std::default::Default::default()
2727    }
2728
2729    /// Sets the value of [name][crate::model::GetConversionWorkspaceRequest::name].
2730    ///
2731    /// # Example
2732    /// ```ignore,no_run
2733    /// # use google_cloud_clouddms_v1::model::GetConversionWorkspaceRequest;
2734    /// let x = GetConversionWorkspaceRequest::new().set_name("example");
2735    /// ```
2736    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2737        self.name = v.into();
2738        self
2739    }
2740}
2741
2742impl wkt::message::Message for GetConversionWorkspaceRequest {
2743    fn typename() -> &'static str {
2744        "type.googleapis.com/google.cloud.clouddms.v1.GetConversionWorkspaceRequest"
2745    }
2746}
2747
2748/// Request message to create a new Conversion Workspace
2749/// in the specified project and region.
2750#[derive(Clone, Default, PartialEq)]
2751#[non_exhaustive]
2752pub struct CreateConversionWorkspaceRequest {
2753    /// Required. The parent which owns this collection of conversion workspaces.
2754    pub parent: std::string::String,
2755
2756    /// Required. The ID of the conversion workspace to create.
2757    pub conversion_workspace_id: std::string::String,
2758
2759    /// Required. Represents a conversion workspace object.
2760    pub conversion_workspace: std::option::Option<crate::model::ConversionWorkspace>,
2761
2762    /// A unique ID used to identify the request. If the server receives two
2763    /// requests with the same ID, then the second request is ignored.
2764    ///
2765    /// It is recommended to always set this value to a UUID.
2766    ///
2767    /// The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
2768    /// (_), and hyphens (-). The maximum length is 40 characters.
2769    pub request_id: std::string::String,
2770
2771    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2772}
2773
2774impl CreateConversionWorkspaceRequest {
2775    pub fn new() -> Self {
2776        std::default::Default::default()
2777    }
2778
2779    /// Sets the value of [parent][crate::model::CreateConversionWorkspaceRequest::parent].
2780    ///
2781    /// # Example
2782    /// ```ignore,no_run
2783    /// # use google_cloud_clouddms_v1::model::CreateConversionWorkspaceRequest;
2784    /// let x = CreateConversionWorkspaceRequest::new().set_parent("example");
2785    /// ```
2786    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2787        self.parent = v.into();
2788        self
2789    }
2790
2791    /// Sets the value of [conversion_workspace_id][crate::model::CreateConversionWorkspaceRequest::conversion_workspace_id].
2792    ///
2793    /// # Example
2794    /// ```ignore,no_run
2795    /// # use google_cloud_clouddms_v1::model::CreateConversionWorkspaceRequest;
2796    /// let x = CreateConversionWorkspaceRequest::new().set_conversion_workspace_id("example");
2797    /// ```
2798    pub fn set_conversion_workspace_id<T: std::convert::Into<std::string::String>>(
2799        mut self,
2800        v: T,
2801    ) -> Self {
2802        self.conversion_workspace_id = v.into();
2803        self
2804    }
2805
2806    /// Sets the value of [conversion_workspace][crate::model::CreateConversionWorkspaceRequest::conversion_workspace].
2807    ///
2808    /// # Example
2809    /// ```ignore,no_run
2810    /// # use google_cloud_clouddms_v1::model::CreateConversionWorkspaceRequest;
2811    /// use google_cloud_clouddms_v1::model::ConversionWorkspace;
2812    /// let x = CreateConversionWorkspaceRequest::new().set_conversion_workspace(ConversionWorkspace::default()/* use setters */);
2813    /// ```
2814    pub fn set_conversion_workspace<T>(mut self, v: T) -> Self
2815    where
2816        T: std::convert::Into<crate::model::ConversionWorkspace>,
2817    {
2818        self.conversion_workspace = std::option::Option::Some(v.into());
2819        self
2820    }
2821
2822    /// Sets or clears the value of [conversion_workspace][crate::model::CreateConversionWorkspaceRequest::conversion_workspace].
2823    ///
2824    /// # Example
2825    /// ```ignore,no_run
2826    /// # use google_cloud_clouddms_v1::model::CreateConversionWorkspaceRequest;
2827    /// use google_cloud_clouddms_v1::model::ConversionWorkspace;
2828    /// let x = CreateConversionWorkspaceRequest::new().set_or_clear_conversion_workspace(Some(ConversionWorkspace::default()/* use setters */));
2829    /// let x = CreateConversionWorkspaceRequest::new().set_or_clear_conversion_workspace(None::<ConversionWorkspace>);
2830    /// ```
2831    pub fn set_or_clear_conversion_workspace<T>(mut self, v: std::option::Option<T>) -> Self
2832    where
2833        T: std::convert::Into<crate::model::ConversionWorkspace>,
2834    {
2835        self.conversion_workspace = v.map(|x| x.into());
2836        self
2837    }
2838
2839    /// Sets the value of [request_id][crate::model::CreateConversionWorkspaceRequest::request_id].
2840    ///
2841    /// # Example
2842    /// ```ignore,no_run
2843    /// # use google_cloud_clouddms_v1::model::CreateConversionWorkspaceRequest;
2844    /// let x = CreateConversionWorkspaceRequest::new().set_request_id("example");
2845    /// ```
2846    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2847        self.request_id = v.into();
2848        self
2849    }
2850}
2851
2852impl wkt::message::Message for CreateConversionWorkspaceRequest {
2853    fn typename() -> &'static str {
2854        "type.googleapis.com/google.cloud.clouddms.v1.CreateConversionWorkspaceRequest"
2855    }
2856}
2857
2858/// Request message for 'UpdateConversionWorkspace' request.
2859#[derive(Clone, Default, PartialEq)]
2860#[non_exhaustive]
2861pub struct UpdateConversionWorkspaceRequest {
2862    /// Required. Field mask is used to specify the fields to be overwritten by the
2863    /// update in the conversion workspace resource.
2864    pub update_mask: std::option::Option<wkt::FieldMask>,
2865
2866    /// Required. The conversion workspace parameters to update.
2867    pub conversion_workspace: std::option::Option<crate::model::ConversionWorkspace>,
2868
2869    /// A unique ID used to identify the request. If the server receives two
2870    /// requests with the same ID, then the second request is ignored.
2871    ///
2872    /// It is recommended to always set this value to a UUID.
2873    ///
2874    /// The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
2875    /// (_), and hyphens (-). The maximum length is 40 characters.
2876    pub request_id: std::string::String,
2877
2878    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2879}
2880
2881impl UpdateConversionWorkspaceRequest {
2882    pub fn new() -> Self {
2883        std::default::Default::default()
2884    }
2885
2886    /// Sets the value of [update_mask][crate::model::UpdateConversionWorkspaceRequest::update_mask].
2887    ///
2888    /// # Example
2889    /// ```ignore,no_run
2890    /// # use google_cloud_clouddms_v1::model::UpdateConversionWorkspaceRequest;
2891    /// use wkt::FieldMask;
2892    /// let x = UpdateConversionWorkspaceRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2893    /// ```
2894    pub fn set_update_mask<T>(mut self, v: T) -> Self
2895    where
2896        T: std::convert::Into<wkt::FieldMask>,
2897    {
2898        self.update_mask = std::option::Option::Some(v.into());
2899        self
2900    }
2901
2902    /// Sets or clears the value of [update_mask][crate::model::UpdateConversionWorkspaceRequest::update_mask].
2903    ///
2904    /// # Example
2905    /// ```ignore,no_run
2906    /// # use google_cloud_clouddms_v1::model::UpdateConversionWorkspaceRequest;
2907    /// use wkt::FieldMask;
2908    /// let x = UpdateConversionWorkspaceRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2909    /// let x = UpdateConversionWorkspaceRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2910    /// ```
2911    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2912    where
2913        T: std::convert::Into<wkt::FieldMask>,
2914    {
2915        self.update_mask = v.map(|x| x.into());
2916        self
2917    }
2918
2919    /// Sets the value of [conversion_workspace][crate::model::UpdateConversionWorkspaceRequest::conversion_workspace].
2920    ///
2921    /// # Example
2922    /// ```ignore,no_run
2923    /// # use google_cloud_clouddms_v1::model::UpdateConversionWorkspaceRequest;
2924    /// use google_cloud_clouddms_v1::model::ConversionWorkspace;
2925    /// let x = UpdateConversionWorkspaceRequest::new().set_conversion_workspace(ConversionWorkspace::default()/* use setters */);
2926    /// ```
2927    pub fn set_conversion_workspace<T>(mut self, v: T) -> Self
2928    where
2929        T: std::convert::Into<crate::model::ConversionWorkspace>,
2930    {
2931        self.conversion_workspace = std::option::Option::Some(v.into());
2932        self
2933    }
2934
2935    /// Sets or clears the value of [conversion_workspace][crate::model::UpdateConversionWorkspaceRequest::conversion_workspace].
2936    ///
2937    /// # Example
2938    /// ```ignore,no_run
2939    /// # use google_cloud_clouddms_v1::model::UpdateConversionWorkspaceRequest;
2940    /// use google_cloud_clouddms_v1::model::ConversionWorkspace;
2941    /// let x = UpdateConversionWorkspaceRequest::new().set_or_clear_conversion_workspace(Some(ConversionWorkspace::default()/* use setters */));
2942    /// let x = UpdateConversionWorkspaceRequest::new().set_or_clear_conversion_workspace(None::<ConversionWorkspace>);
2943    /// ```
2944    pub fn set_or_clear_conversion_workspace<T>(mut self, v: std::option::Option<T>) -> Self
2945    where
2946        T: std::convert::Into<crate::model::ConversionWorkspace>,
2947    {
2948        self.conversion_workspace = v.map(|x| x.into());
2949        self
2950    }
2951
2952    /// Sets the value of [request_id][crate::model::UpdateConversionWorkspaceRequest::request_id].
2953    ///
2954    /// # Example
2955    /// ```ignore,no_run
2956    /// # use google_cloud_clouddms_v1::model::UpdateConversionWorkspaceRequest;
2957    /// let x = UpdateConversionWorkspaceRequest::new().set_request_id("example");
2958    /// ```
2959    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2960        self.request_id = v.into();
2961        self
2962    }
2963}
2964
2965impl wkt::message::Message for UpdateConversionWorkspaceRequest {
2966    fn typename() -> &'static str {
2967        "type.googleapis.com/google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest"
2968    }
2969}
2970
2971/// Request message for 'DeleteConversionWorkspace' request.
2972#[derive(Clone, Default, PartialEq)]
2973#[non_exhaustive]
2974pub struct DeleteConversionWorkspaceRequest {
2975    /// Required. Name of the conversion workspace resource to delete.
2976    pub name: std::string::String,
2977
2978    /// A unique ID used to identify the request. If the server receives two
2979    /// requests with the same ID, then the second request is ignored.
2980    ///
2981    /// It is recommended to always set this value to a UUID.
2982    ///
2983    /// The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
2984    /// (_), and hyphens (-). The maximum length is 40 characters.
2985    pub request_id: std::string::String,
2986
2987    /// Force delete the conversion workspace, even if there's a running migration
2988    /// that is using the workspace.
2989    pub force: bool,
2990
2991    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2992}
2993
2994impl DeleteConversionWorkspaceRequest {
2995    pub fn new() -> Self {
2996        std::default::Default::default()
2997    }
2998
2999    /// Sets the value of [name][crate::model::DeleteConversionWorkspaceRequest::name].
3000    ///
3001    /// # Example
3002    /// ```ignore,no_run
3003    /// # use google_cloud_clouddms_v1::model::DeleteConversionWorkspaceRequest;
3004    /// let x = DeleteConversionWorkspaceRequest::new().set_name("example");
3005    /// ```
3006    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3007        self.name = v.into();
3008        self
3009    }
3010
3011    /// Sets the value of [request_id][crate::model::DeleteConversionWorkspaceRequest::request_id].
3012    ///
3013    /// # Example
3014    /// ```ignore,no_run
3015    /// # use google_cloud_clouddms_v1::model::DeleteConversionWorkspaceRequest;
3016    /// let x = DeleteConversionWorkspaceRequest::new().set_request_id("example");
3017    /// ```
3018    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3019        self.request_id = v.into();
3020        self
3021    }
3022
3023    /// Sets the value of [force][crate::model::DeleteConversionWorkspaceRequest::force].
3024    ///
3025    /// # Example
3026    /// ```ignore,no_run
3027    /// # use google_cloud_clouddms_v1::model::DeleteConversionWorkspaceRequest;
3028    /// let x = DeleteConversionWorkspaceRequest::new().set_force(true);
3029    /// ```
3030    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3031        self.force = v.into();
3032        self
3033    }
3034}
3035
3036impl wkt::message::Message for DeleteConversionWorkspaceRequest {
3037    fn typename() -> &'static str {
3038        "type.googleapis.com/google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest"
3039    }
3040}
3041
3042/// Request message for 'CommitConversionWorkspace' request.
3043#[derive(Clone, Default, PartialEq)]
3044#[non_exhaustive]
3045pub struct CommitConversionWorkspaceRequest {
3046    /// Required. Name of the conversion workspace resource to commit.
3047    pub name: std::string::String,
3048
3049    /// Optional. Optional name of the commit.
3050    pub commit_name: std::string::String,
3051
3052    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3053}
3054
3055impl CommitConversionWorkspaceRequest {
3056    pub fn new() -> Self {
3057        std::default::Default::default()
3058    }
3059
3060    /// Sets the value of [name][crate::model::CommitConversionWorkspaceRequest::name].
3061    ///
3062    /// # Example
3063    /// ```ignore,no_run
3064    /// # use google_cloud_clouddms_v1::model::CommitConversionWorkspaceRequest;
3065    /// let x = CommitConversionWorkspaceRequest::new().set_name("example");
3066    /// ```
3067    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3068        self.name = v.into();
3069        self
3070    }
3071
3072    /// Sets the value of [commit_name][crate::model::CommitConversionWorkspaceRequest::commit_name].
3073    ///
3074    /// # Example
3075    /// ```ignore,no_run
3076    /// # use google_cloud_clouddms_v1::model::CommitConversionWorkspaceRequest;
3077    /// let x = CommitConversionWorkspaceRequest::new().set_commit_name("example");
3078    /// ```
3079    pub fn set_commit_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3080        self.commit_name = v.into();
3081        self
3082    }
3083}
3084
3085impl wkt::message::Message for CommitConversionWorkspaceRequest {
3086    fn typename() -> &'static str {
3087        "type.googleapis.com/google.cloud.clouddms.v1.CommitConversionWorkspaceRequest"
3088    }
3089}
3090
3091/// Request message for 'RollbackConversionWorkspace' request.
3092#[derive(Clone, Default, PartialEq)]
3093#[non_exhaustive]
3094pub struct RollbackConversionWorkspaceRequest {
3095    /// Required. Name of the conversion workspace resource to roll back to.
3096    pub name: std::string::String,
3097
3098    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3099}
3100
3101impl RollbackConversionWorkspaceRequest {
3102    pub fn new() -> Self {
3103        std::default::Default::default()
3104    }
3105
3106    /// Sets the value of [name][crate::model::RollbackConversionWorkspaceRequest::name].
3107    ///
3108    /// # Example
3109    /// ```ignore,no_run
3110    /// # use google_cloud_clouddms_v1::model::RollbackConversionWorkspaceRequest;
3111    /// let x = RollbackConversionWorkspaceRequest::new().set_name("example");
3112    /// ```
3113    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3114        self.name = v.into();
3115        self
3116    }
3117}
3118
3119impl wkt::message::Message for RollbackConversionWorkspaceRequest {
3120    fn typename() -> &'static str {
3121        "type.googleapis.com/google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest"
3122    }
3123}
3124
3125/// Request message for 'ApplyConversionWorkspace' request.
3126#[derive(Clone, Default, PartialEq)]
3127#[non_exhaustive]
3128pub struct ApplyConversionWorkspaceRequest {
3129    /// Required. The name of the conversion workspace resource for which to apply
3130    /// the draft tree. Must be in the form of:
3131    /// projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.
3132    pub name: std::string::String,
3133
3134    /// Filter which entities to apply. Leaving this field empty will apply all of
3135    /// the entities. Supports Google AIP 160 based filtering.
3136    pub filter: std::string::String,
3137
3138    /// Optional. Only validates the apply process, but doesn't change the
3139    /// destination database. Only works for PostgreSQL destination connection
3140    /// profile.
3141    pub dry_run: bool,
3142
3143    /// Optional. Specifies whether the conversion workspace is to be committed
3144    /// automatically after the apply.
3145    pub auto_commit: bool,
3146
3147    /// Which destination to use when applying the conversion workspace.
3148    pub destination:
3149        std::option::Option<crate::model::apply_conversion_workspace_request::Destination>,
3150
3151    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3152}
3153
3154impl ApplyConversionWorkspaceRequest {
3155    pub fn new() -> Self {
3156        std::default::Default::default()
3157    }
3158
3159    /// Sets the value of [name][crate::model::ApplyConversionWorkspaceRequest::name].
3160    ///
3161    /// # Example
3162    /// ```ignore,no_run
3163    /// # use google_cloud_clouddms_v1::model::ApplyConversionWorkspaceRequest;
3164    /// let x = ApplyConversionWorkspaceRequest::new().set_name("example");
3165    /// ```
3166    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3167        self.name = v.into();
3168        self
3169    }
3170
3171    /// Sets the value of [filter][crate::model::ApplyConversionWorkspaceRequest::filter].
3172    ///
3173    /// # Example
3174    /// ```ignore,no_run
3175    /// # use google_cloud_clouddms_v1::model::ApplyConversionWorkspaceRequest;
3176    /// let x = ApplyConversionWorkspaceRequest::new().set_filter("example");
3177    /// ```
3178    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3179        self.filter = v.into();
3180        self
3181    }
3182
3183    /// Sets the value of [dry_run][crate::model::ApplyConversionWorkspaceRequest::dry_run].
3184    ///
3185    /// # Example
3186    /// ```ignore,no_run
3187    /// # use google_cloud_clouddms_v1::model::ApplyConversionWorkspaceRequest;
3188    /// let x = ApplyConversionWorkspaceRequest::new().set_dry_run(true);
3189    /// ```
3190    pub fn set_dry_run<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3191        self.dry_run = v.into();
3192        self
3193    }
3194
3195    /// Sets the value of [auto_commit][crate::model::ApplyConversionWorkspaceRequest::auto_commit].
3196    ///
3197    /// # Example
3198    /// ```ignore,no_run
3199    /// # use google_cloud_clouddms_v1::model::ApplyConversionWorkspaceRequest;
3200    /// let x = ApplyConversionWorkspaceRequest::new().set_auto_commit(true);
3201    /// ```
3202    pub fn set_auto_commit<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3203        self.auto_commit = v.into();
3204        self
3205    }
3206
3207    /// Sets the value of [destination][crate::model::ApplyConversionWorkspaceRequest::destination].
3208    ///
3209    /// Note that all the setters affecting `destination` are mutually
3210    /// exclusive.
3211    ///
3212    /// # Example
3213    /// ```ignore,no_run
3214    /// # use google_cloud_clouddms_v1::model::ApplyConversionWorkspaceRequest;
3215    /// use google_cloud_clouddms_v1::model::apply_conversion_workspace_request::Destination;
3216    /// let x = ApplyConversionWorkspaceRequest::new().set_destination(Some(Destination::ConnectionProfile("example".to_string())));
3217    /// ```
3218    pub fn set_destination<
3219        T: std::convert::Into<
3220                std::option::Option<crate::model::apply_conversion_workspace_request::Destination>,
3221            >,
3222    >(
3223        mut self,
3224        v: T,
3225    ) -> Self {
3226        self.destination = v.into();
3227        self
3228    }
3229
3230    /// The value of [destination][crate::model::ApplyConversionWorkspaceRequest::destination]
3231    /// if it holds a `ConnectionProfile`, `None` if the field is not set or
3232    /// holds a different branch.
3233    pub fn connection_profile(&self) -> std::option::Option<&std::string::String> {
3234        #[allow(unreachable_patterns)]
3235        self.destination.as_ref().and_then(|v| match v {
3236            crate::model::apply_conversion_workspace_request::Destination::ConnectionProfile(v) => {
3237                std::option::Option::Some(v)
3238            }
3239            _ => std::option::Option::None,
3240        })
3241    }
3242
3243    /// Sets the value of [destination][crate::model::ApplyConversionWorkspaceRequest::destination]
3244    /// to hold a `ConnectionProfile`.
3245    ///
3246    /// Note that all the setters affecting `destination` are
3247    /// mutually exclusive.
3248    ///
3249    /// # Example
3250    /// ```ignore,no_run
3251    /// # use google_cloud_clouddms_v1::model::ApplyConversionWorkspaceRequest;
3252    /// let x = ApplyConversionWorkspaceRequest::new().set_connection_profile("example");
3253    /// assert!(x.connection_profile().is_some());
3254    /// ```
3255    pub fn set_connection_profile<T: std::convert::Into<std::string::String>>(
3256        mut self,
3257        v: T,
3258    ) -> Self {
3259        self.destination = std::option::Option::Some(
3260            crate::model::apply_conversion_workspace_request::Destination::ConnectionProfile(
3261                v.into(),
3262            ),
3263        );
3264        self
3265    }
3266}
3267
3268impl wkt::message::Message for ApplyConversionWorkspaceRequest {
3269    fn typename() -> &'static str {
3270        "type.googleapis.com/google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest"
3271    }
3272}
3273
3274/// Defines additional types related to [ApplyConversionWorkspaceRequest].
3275pub mod apply_conversion_workspace_request {
3276    #[allow(unused_imports)]
3277    use super::*;
3278
3279    /// Which destination to use when applying the conversion workspace.
3280    #[derive(Clone, Debug, PartialEq)]
3281    #[non_exhaustive]
3282    pub enum Destination {
3283        /// Optional. Fully qualified (Uri) name of the destination connection
3284        /// profile.
3285        ConnectionProfile(std::string::String),
3286    }
3287}
3288
3289/// Retrieve a list of all mapping rules in a given conversion workspace.
3290#[derive(Clone, Default, PartialEq)]
3291#[non_exhaustive]
3292pub struct ListMappingRulesRequest {
3293    /// Required. Name of the conversion workspace resource whose mapping rules are
3294    /// listed in the form of:
3295    /// projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.
3296    pub parent: std::string::String,
3297
3298    /// The maximum number of rules to return. The service may return
3299    /// fewer than this value.
3300    pub page_size: i32,
3301
3302    /// The nextPageToken value received in the previous call to
3303    /// mappingRules.list, used in the subsequent request to retrieve the next
3304    /// page of results. On first call this should be left blank. When paginating,
3305    /// all other parameters provided to mappingRules.list must match the call
3306    /// that provided the page token.
3307    pub page_token: std::string::String,
3308
3309    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3310}
3311
3312impl ListMappingRulesRequest {
3313    pub fn new() -> Self {
3314        std::default::Default::default()
3315    }
3316
3317    /// Sets the value of [parent][crate::model::ListMappingRulesRequest::parent].
3318    ///
3319    /// # Example
3320    /// ```ignore,no_run
3321    /// # use google_cloud_clouddms_v1::model::ListMappingRulesRequest;
3322    /// let x = ListMappingRulesRequest::new().set_parent("example");
3323    /// ```
3324    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3325        self.parent = v.into();
3326        self
3327    }
3328
3329    /// Sets the value of [page_size][crate::model::ListMappingRulesRequest::page_size].
3330    ///
3331    /// # Example
3332    /// ```ignore,no_run
3333    /// # use google_cloud_clouddms_v1::model::ListMappingRulesRequest;
3334    /// let x = ListMappingRulesRequest::new().set_page_size(42);
3335    /// ```
3336    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3337        self.page_size = v.into();
3338        self
3339    }
3340
3341    /// Sets the value of [page_token][crate::model::ListMappingRulesRequest::page_token].
3342    ///
3343    /// # Example
3344    /// ```ignore,no_run
3345    /// # use google_cloud_clouddms_v1::model::ListMappingRulesRequest;
3346    /// let x = ListMappingRulesRequest::new().set_page_token("example");
3347    /// ```
3348    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3349        self.page_token = v.into();
3350        self
3351    }
3352}
3353
3354impl wkt::message::Message for ListMappingRulesRequest {
3355    fn typename() -> &'static str {
3356        "type.googleapis.com/google.cloud.clouddms.v1.ListMappingRulesRequest"
3357    }
3358}
3359
3360/// Response message for 'ListMappingRulesRequest' request.
3361#[derive(Clone, Default, PartialEq)]
3362#[non_exhaustive]
3363pub struct ListMappingRulesResponse {
3364    /// The list of conversion workspace mapping rules.
3365    pub mapping_rules: std::vec::Vec<crate::model::MappingRule>,
3366
3367    /// A token which can be sent as `page_token` to retrieve the next page.
3368    /// If this field is omitted, there are no subsequent pages.
3369    pub next_page_token: std::string::String,
3370
3371    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3372}
3373
3374impl ListMappingRulesResponse {
3375    pub fn new() -> Self {
3376        std::default::Default::default()
3377    }
3378
3379    /// Sets the value of [mapping_rules][crate::model::ListMappingRulesResponse::mapping_rules].
3380    ///
3381    /// # Example
3382    /// ```ignore,no_run
3383    /// # use google_cloud_clouddms_v1::model::ListMappingRulesResponse;
3384    /// use google_cloud_clouddms_v1::model::MappingRule;
3385    /// let x = ListMappingRulesResponse::new()
3386    ///     .set_mapping_rules([
3387    ///         MappingRule::default()/* use setters */,
3388    ///         MappingRule::default()/* use (different) setters */,
3389    ///     ]);
3390    /// ```
3391    pub fn set_mapping_rules<T, V>(mut self, v: T) -> Self
3392    where
3393        T: std::iter::IntoIterator<Item = V>,
3394        V: std::convert::Into<crate::model::MappingRule>,
3395    {
3396        use std::iter::Iterator;
3397        self.mapping_rules = v.into_iter().map(|i| i.into()).collect();
3398        self
3399    }
3400
3401    /// Sets the value of [next_page_token][crate::model::ListMappingRulesResponse::next_page_token].
3402    ///
3403    /// # Example
3404    /// ```ignore,no_run
3405    /// # use google_cloud_clouddms_v1::model::ListMappingRulesResponse;
3406    /// let x = ListMappingRulesResponse::new().set_next_page_token("example");
3407    /// ```
3408    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3409        self.next_page_token = v.into();
3410        self
3411    }
3412}
3413
3414impl wkt::message::Message for ListMappingRulesResponse {
3415    fn typename() -> &'static str {
3416        "type.googleapis.com/google.cloud.clouddms.v1.ListMappingRulesResponse"
3417    }
3418}
3419
3420#[doc(hidden)]
3421impl google_cloud_gax::paginator::internal::PageableResponse for ListMappingRulesResponse {
3422    type PageItem = crate::model::MappingRule;
3423
3424    fn items(self) -> std::vec::Vec<Self::PageItem> {
3425        self.mapping_rules
3426    }
3427
3428    fn next_page_token(&self) -> std::string::String {
3429        use std::clone::Clone;
3430        self.next_page_token.clone()
3431    }
3432}
3433
3434/// Request message for 'GetMappingRule' request.
3435#[derive(Clone, Default, PartialEq)]
3436#[non_exhaustive]
3437pub struct GetMappingRuleRequest {
3438    /// Required. Name of the mapping rule resource to get.
3439    /// Example: conversionWorkspaces/123/mappingRules/rule123
3440    ///
3441    /// In order to retrieve a previous revision of the mapping rule, also provide
3442    /// the revision ID.
3443    /// Example:
3444    /// conversionWorkspace/123/mappingRules/rule123@c7cfa2a8c7cfa2a8c7cfa2a8c7cfa2a8
3445    pub name: std::string::String,
3446
3447    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3448}
3449
3450impl GetMappingRuleRequest {
3451    pub fn new() -> Self {
3452        std::default::Default::default()
3453    }
3454
3455    /// Sets the value of [name][crate::model::GetMappingRuleRequest::name].
3456    ///
3457    /// # Example
3458    /// ```ignore,no_run
3459    /// # use google_cloud_clouddms_v1::model::GetMappingRuleRequest;
3460    /// let x = GetMappingRuleRequest::new().set_name("example");
3461    /// ```
3462    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3463        self.name = v.into();
3464        self
3465    }
3466}
3467
3468impl wkt::message::Message for GetMappingRuleRequest {
3469    fn typename() -> &'static str {
3470        "type.googleapis.com/google.cloud.clouddms.v1.GetMappingRuleRequest"
3471    }
3472}
3473
3474/// Request message for 'SeedConversionWorkspace' request.
3475#[derive(Clone, Default, PartialEq)]
3476#[non_exhaustive]
3477pub struct SeedConversionWorkspaceRequest {
3478    /// Name of the conversion workspace resource to seed with new database
3479    /// structure, in the form of:
3480    /// projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.
3481    pub name: std::string::String,
3482
3483    /// Should the conversion workspace be committed automatically after the
3484    /// seed operation.
3485    pub auto_commit: bool,
3486
3487    /// The input to be used for seeding the conversion workspace. The input can
3488    /// either be from the source or destination databases and it can be provided
3489    /// through a connection profile or a DDL file.
3490    pub seed_from: std::option::Option<crate::model::seed_conversion_workspace_request::SeedFrom>,
3491
3492    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3493}
3494
3495impl SeedConversionWorkspaceRequest {
3496    pub fn new() -> Self {
3497        std::default::Default::default()
3498    }
3499
3500    /// Sets the value of [name][crate::model::SeedConversionWorkspaceRequest::name].
3501    ///
3502    /// # Example
3503    /// ```ignore,no_run
3504    /// # use google_cloud_clouddms_v1::model::SeedConversionWorkspaceRequest;
3505    /// let x = SeedConversionWorkspaceRequest::new().set_name("example");
3506    /// ```
3507    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3508        self.name = v.into();
3509        self
3510    }
3511
3512    /// Sets the value of [auto_commit][crate::model::SeedConversionWorkspaceRequest::auto_commit].
3513    ///
3514    /// # Example
3515    /// ```ignore,no_run
3516    /// # use google_cloud_clouddms_v1::model::SeedConversionWorkspaceRequest;
3517    /// let x = SeedConversionWorkspaceRequest::new().set_auto_commit(true);
3518    /// ```
3519    pub fn set_auto_commit<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3520        self.auto_commit = v.into();
3521        self
3522    }
3523
3524    /// Sets the value of [seed_from][crate::model::SeedConversionWorkspaceRequest::seed_from].
3525    ///
3526    /// Note that all the setters affecting `seed_from` are mutually
3527    /// exclusive.
3528    ///
3529    /// # Example
3530    /// ```ignore,no_run
3531    /// # use google_cloud_clouddms_v1::model::SeedConversionWorkspaceRequest;
3532    /// use google_cloud_clouddms_v1::model::seed_conversion_workspace_request::SeedFrom;
3533    /// let x = SeedConversionWorkspaceRequest::new().set_seed_from(Some(SeedFrom::SourceConnectionProfile("example".to_string())));
3534    /// ```
3535    pub fn set_seed_from<
3536        T: std::convert::Into<
3537                std::option::Option<crate::model::seed_conversion_workspace_request::SeedFrom>,
3538            >,
3539    >(
3540        mut self,
3541        v: T,
3542    ) -> Self {
3543        self.seed_from = v.into();
3544        self
3545    }
3546
3547    /// The value of [seed_from][crate::model::SeedConversionWorkspaceRequest::seed_from]
3548    /// if it holds a `SourceConnectionProfile`, `None` if the field is not set or
3549    /// holds a different branch.
3550    pub fn source_connection_profile(&self) -> std::option::Option<&std::string::String> {
3551        #[allow(unreachable_patterns)]
3552        self.seed_from.as_ref().and_then(|v| match v {
3553            crate::model::seed_conversion_workspace_request::SeedFrom::SourceConnectionProfile(
3554                v,
3555            ) => std::option::Option::Some(v),
3556            _ => std::option::Option::None,
3557        })
3558    }
3559
3560    /// Sets the value of [seed_from][crate::model::SeedConversionWorkspaceRequest::seed_from]
3561    /// to hold a `SourceConnectionProfile`.
3562    ///
3563    /// Note that all the setters affecting `seed_from` are
3564    /// mutually exclusive.
3565    ///
3566    /// # Example
3567    /// ```ignore,no_run
3568    /// # use google_cloud_clouddms_v1::model::SeedConversionWorkspaceRequest;
3569    /// let x = SeedConversionWorkspaceRequest::new().set_source_connection_profile("example");
3570    /// assert!(x.source_connection_profile().is_some());
3571    /// assert!(x.destination_connection_profile().is_none());
3572    /// ```
3573    pub fn set_source_connection_profile<T: std::convert::Into<std::string::String>>(
3574        mut self,
3575        v: T,
3576    ) -> Self {
3577        self.seed_from = std::option::Option::Some(
3578            crate::model::seed_conversion_workspace_request::SeedFrom::SourceConnectionProfile(
3579                v.into(),
3580            ),
3581        );
3582        self
3583    }
3584
3585    /// The value of [seed_from][crate::model::SeedConversionWorkspaceRequest::seed_from]
3586    /// if it holds a `DestinationConnectionProfile`, `None` if the field is not set or
3587    /// holds a different branch.
3588    pub fn destination_connection_profile(&self) -> std::option::Option<&std::string::String> {
3589        #[allow(unreachable_patterns)]
3590        self.seed_from.as_ref().and_then(|v| match v {
3591            crate::model::seed_conversion_workspace_request::SeedFrom::DestinationConnectionProfile(v) => std::option::Option::Some(v),
3592            _ => std::option::Option::None,
3593        })
3594    }
3595
3596    /// Sets the value of [seed_from][crate::model::SeedConversionWorkspaceRequest::seed_from]
3597    /// to hold a `DestinationConnectionProfile`.
3598    ///
3599    /// Note that all the setters affecting `seed_from` are
3600    /// mutually exclusive.
3601    ///
3602    /// # Example
3603    /// ```ignore,no_run
3604    /// # use google_cloud_clouddms_v1::model::SeedConversionWorkspaceRequest;
3605    /// let x = SeedConversionWorkspaceRequest::new().set_destination_connection_profile("example");
3606    /// assert!(x.destination_connection_profile().is_some());
3607    /// assert!(x.source_connection_profile().is_none());
3608    /// ```
3609    pub fn set_destination_connection_profile<T: std::convert::Into<std::string::String>>(
3610        mut self,
3611        v: T,
3612    ) -> Self {
3613        self.seed_from = std::option::Option::Some(
3614            crate::model::seed_conversion_workspace_request::SeedFrom::DestinationConnectionProfile(
3615                v.into(),
3616            ),
3617        );
3618        self
3619    }
3620}
3621
3622impl wkt::message::Message for SeedConversionWorkspaceRequest {
3623    fn typename() -> &'static str {
3624        "type.googleapis.com/google.cloud.clouddms.v1.SeedConversionWorkspaceRequest"
3625    }
3626}
3627
3628/// Defines additional types related to [SeedConversionWorkspaceRequest].
3629pub mod seed_conversion_workspace_request {
3630    #[allow(unused_imports)]
3631    use super::*;
3632
3633    /// The input to be used for seeding the conversion workspace. The input can
3634    /// either be from the source or destination databases and it can be provided
3635    /// through a connection profile or a DDL file.
3636    #[derive(Clone, Debug, PartialEq)]
3637    #[non_exhaustive]
3638    pub enum SeedFrom {
3639        /// Optional. Fully qualified (Uri) name of the source connection profile.
3640        SourceConnectionProfile(std::string::String),
3641        /// Optional. Fully qualified (Uri) name of the destination connection
3642        /// profile.
3643        DestinationConnectionProfile(std::string::String),
3644    }
3645}
3646
3647/// Request message for 'ConvertConversionWorkspace' request.
3648#[derive(Clone, Default, PartialEq)]
3649#[non_exhaustive]
3650pub struct ConvertConversionWorkspaceRequest {
3651    /// Name of the conversion workspace resource to convert in the form of:
3652    /// projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.
3653    pub name: std::string::String,
3654
3655    /// Optional. Specifies whether the conversion workspace is to be committed
3656    /// automatically after the conversion.
3657    pub auto_commit: bool,
3658
3659    /// Optional. Filter the entities to convert. Leaving this field empty will
3660    /// convert all of the entities. Supports Google AIP-160 style filtering.
3661    pub filter: std::string::String,
3662
3663    /// Optional. Automatically convert the full entity path for each entity
3664    /// specified by the filter. For example, if the filter specifies a table, that
3665    /// table schema (and database if there is one) will also be converted.
3666    pub convert_full_path: bool,
3667
3668    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3669}
3670
3671impl ConvertConversionWorkspaceRequest {
3672    pub fn new() -> Self {
3673        std::default::Default::default()
3674    }
3675
3676    /// Sets the value of [name][crate::model::ConvertConversionWorkspaceRequest::name].
3677    ///
3678    /// # Example
3679    /// ```ignore,no_run
3680    /// # use google_cloud_clouddms_v1::model::ConvertConversionWorkspaceRequest;
3681    /// let x = ConvertConversionWorkspaceRequest::new().set_name("example");
3682    /// ```
3683    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3684        self.name = v.into();
3685        self
3686    }
3687
3688    /// Sets the value of [auto_commit][crate::model::ConvertConversionWorkspaceRequest::auto_commit].
3689    ///
3690    /// # Example
3691    /// ```ignore,no_run
3692    /// # use google_cloud_clouddms_v1::model::ConvertConversionWorkspaceRequest;
3693    /// let x = ConvertConversionWorkspaceRequest::new().set_auto_commit(true);
3694    /// ```
3695    pub fn set_auto_commit<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3696        self.auto_commit = v.into();
3697        self
3698    }
3699
3700    /// Sets the value of [filter][crate::model::ConvertConversionWorkspaceRequest::filter].
3701    ///
3702    /// # Example
3703    /// ```ignore,no_run
3704    /// # use google_cloud_clouddms_v1::model::ConvertConversionWorkspaceRequest;
3705    /// let x = ConvertConversionWorkspaceRequest::new().set_filter("example");
3706    /// ```
3707    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3708        self.filter = v.into();
3709        self
3710    }
3711
3712    /// Sets the value of [convert_full_path][crate::model::ConvertConversionWorkspaceRequest::convert_full_path].
3713    ///
3714    /// # Example
3715    /// ```ignore,no_run
3716    /// # use google_cloud_clouddms_v1::model::ConvertConversionWorkspaceRequest;
3717    /// let x = ConvertConversionWorkspaceRequest::new().set_convert_full_path(true);
3718    /// ```
3719    pub fn set_convert_full_path<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3720        self.convert_full_path = v.into();
3721        self
3722    }
3723}
3724
3725impl wkt::message::Message for ConvertConversionWorkspaceRequest {
3726    fn typename() -> &'static str {
3727        "type.googleapis.com/google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest"
3728    }
3729}
3730
3731/// Request message for 'ImportMappingRules' request.
3732#[derive(Clone, Default, PartialEq)]
3733#[non_exhaustive]
3734pub struct ImportMappingRulesRequest {
3735    /// Required. Name of the conversion workspace resource to import the rules to
3736    /// in the form of:
3737    /// projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.
3738    pub parent: std::string::String,
3739
3740    /// Required. The format of the rules content file.
3741    pub rules_format: crate::model::ImportRulesFileFormat,
3742
3743    /// Required. One or more rules files.
3744    pub rules_files: std::vec::Vec<crate::model::import_mapping_rules_request::RulesFile>,
3745
3746    /// Required. Should the conversion workspace be committed automatically after
3747    /// the import operation.
3748    pub auto_commit: bool,
3749
3750    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3751}
3752
3753impl ImportMappingRulesRequest {
3754    pub fn new() -> Self {
3755        std::default::Default::default()
3756    }
3757
3758    /// Sets the value of [parent][crate::model::ImportMappingRulesRequest::parent].
3759    ///
3760    /// # Example
3761    /// ```ignore,no_run
3762    /// # use google_cloud_clouddms_v1::model::ImportMappingRulesRequest;
3763    /// let x = ImportMappingRulesRequest::new().set_parent("example");
3764    /// ```
3765    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3766        self.parent = v.into();
3767        self
3768    }
3769
3770    /// Sets the value of [rules_format][crate::model::ImportMappingRulesRequest::rules_format].
3771    ///
3772    /// # Example
3773    /// ```ignore,no_run
3774    /// # use google_cloud_clouddms_v1::model::ImportMappingRulesRequest;
3775    /// use google_cloud_clouddms_v1::model::ImportRulesFileFormat;
3776    /// let x0 = ImportMappingRulesRequest::new().set_rules_format(ImportRulesFileFormat::HarbourBridgeSessionFile);
3777    /// let x1 = ImportMappingRulesRequest::new().set_rules_format(ImportRulesFileFormat::OratopgConfigFile);
3778    /// ```
3779    pub fn set_rules_format<T: std::convert::Into<crate::model::ImportRulesFileFormat>>(
3780        mut self,
3781        v: T,
3782    ) -> Self {
3783        self.rules_format = v.into();
3784        self
3785    }
3786
3787    /// Sets the value of [rules_files][crate::model::ImportMappingRulesRequest::rules_files].
3788    ///
3789    /// # Example
3790    /// ```ignore,no_run
3791    /// # use google_cloud_clouddms_v1::model::ImportMappingRulesRequest;
3792    /// use google_cloud_clouddms_v1::model::import_mapping_rules_request::RulesFile;
3793    /// let x = ImportMappingRulesRequest::new()
3794    ///     .set_rules_files([
3795    ///         RulesFile::default()/* use setters */,
3796    ///         RulesFile::default()/* use (different) setters */,
3797    ///     ]);
3798    /// ```
3799    pub fn set_rules_files<T, V>(mut self, v: T) -> Self
3800    where
3801        T: std::iter::IntoIterator<Item = V>,
3802        V: std::convert::Into<crate::model::import_mapping_rules_request::RulesFile>,
3803    {
3804        use std::iter::Iterator;
3805        self.rules_files = v.into_iter().map(|i| i.into()).collect();
3806        self
3807    }
3808
3809    /// Sets the value of [auto_commit][crate::model::ImportMappingRulesRequest::auto_commit].
3810    ///
3811    /// # Example
3812    /// ```ignore,no_run
3813    /// # use google_cloud_clouddms_v1::model::ImportMappingRulesRequest;
3814    /// let x = ImportMappingRulesRequest::new().set_auto_commit(true);
3815    /// ```
3816    pub fn set_auto_commit<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3817        self.auto_commit = v.into();
3818        self
3819    }
3820}
3821
3822impl wkt::message::Message for ImportMappingRulesRequest {
3823    fn typename() -> &'static str {
3824        "type.googleapis.com/google.cloud.clouddms.v1.ImportMappingRulesRequest"
3825    }
3826}
3827
3828/// Defines additional types related to [ImportMappingRulesRequest].
3829pub mod import_mapping_rules_request {
3830    #[allow(unused_imports)]
3831    use super::*;
3832
3833    /// Details of a single rules file.
3834    #[derive(Clone, Default, PartialEq)]
3835    #[non_exhaustive]
3836    pub struct RulesFile {
3837        /// Required. The filename of the rules that needs to be converted. The
3838        /// filename is used mainly so that future logs of the import rules job
3839        /// contain it, and can therefore be searched by it.
3840        pub rules_source_filename: std::string::String,
3841
3842        /// Required. The text content of the rules that needs to be converted.
3843        pub rules_content: std::string::String,
3844
3845        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3846    }
3847
3848    impl RulesFile {
3849        pub fn new() -> Self {
3850            std::default::Default::default()
3851        }
3852
3853        /// Sets the value of [rules_source_filename][crate::model::import_mapping_rules_request::RulesFile::rules_source_filename].
3854        ///
3855        /// # Example
3856        /// ```ignore,no_run
3857        /// # use google_cloud_clouddms_v1::model::import_mapping_rules_request::RulesFile;
3858        /// let x = RulesFile::new().set_rules_source_filename("example");
3859        /// ```
3860        pub fn set_rules_source_filename<T: std::convert::Into<std::string::String>>(
3861            mut self,
3862            v: T,
3863        ) -> Self {
3864            self.rules_source_filename = v.into();
3865            self
3866        }
3867
3868        /// Sets the value of [rules_content][crate::model::import_mapping_rules_request::RulesFile::rules_content].
3869        ///
3870        /// # Example
3871        /// ```ignore,no_run
3872        /// # use google_cloud_clouddms_v1::model::import_mapping_rules_request::RulesFile;
3873        /// let x = RulesFile::new().set_rules_content("example");
3874        /// ```
3875        pub fn set_rules_content<T: std::convert::Into<std::string::String>>(
3876            mut self,
3877            v: T,
3878        ) -> Self {
3879            self.rules_content = v.into();
3880            self
3881        }
3882    }
3883
3884    impl wkt::message::Message for RulesFile {
3885        fn typename() -> &'static str {
3886            "type.googleapis.com/google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile"
3887        }
3888    }
3889}
3890
3891/// Request message for 'DescribeDatabaseEntities' request.
3892#[derive(Clone, Default, PartialEq)]
3893#[non_exhaustive]
3894pub struct DescribeDatabaseEntitiesRequest {
3895    /// Required. Name of the conversion workspace resource whose database entities
3896    /// are described. Must be in the form of:
3897    /// projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.
3898    pub conversion_workspace: std::string::String,
3899
3900    /// Optional. The maximum number of entities to return. The service may return
3901    /// fewer entities than the value specifies.
3902    pub page_size: i32,
3903
3904    /// Optional. The nextPageToken value received in the previous call to
3905    /// conversionWorkspace.describeDatabaseEntities, used in the subsequent
3906    /// request to retrieve the next page of results. On first call this should be
3907    /// left blank. When paginating, all other parameters provided to
3908    /// conversionWorkspace.describeDatabaseEntities must match the call that
3909    /// provided the page token.
3910    pub page_token: std::string::String,
3911
3912    /// Required. The tree to fetch.
3913    pub tree: crate::model::describe_database_entities_request::DBTreeType,
3914
3915    /// Optional. Whether to retrieve the latest committed version of the entities
3916    /// or the latest version. This field is ignored if a specific commit_id is
3917    /// specified.
3918    pub uncommitted: bool,
3919
3920    /// Optional. Request a specific commit ID. If not specified, the entities from
3921    /// the latest commit are returned.
3922    pub commit_id: std::string::String,
3923
3924    /// Optional. Filter the returned entities based on AIP-160 standard.
3925    pub filter: std::string::String,
3926
3927    /// Optional. Results view based on AIP-157
3928    pub view: crate::model::DatabaseEntityView,
3929
3930    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3931}
3932
3933impl DescribeDatabaseEntitiesRequest {
3934    pub fn new() -> Self {
3935        std::default::Default::default()
3936    }
3937
3938    /// Sets the value of [conversion_workspace][crate::model::DescribeDatabaseEntitiesRequest::conversion_workspace].
3939    ///
3940    /// # Example
3941    /// ```ignore,no_run
3942    /// # use google_cloud_clouddms_v1::model::DescribeDatabaseEntitiesRequest;
3943    /// let x = DescribeDatabaseEntitiesRequest::new().set_conversion_workspace("example");
3944    /// ```
3945    pub fn set_conversion_workspace<T: std::convert::Into<std::string::String>>(
3946        mut self,
3947        v: T,
3948    ) -> Self {
3949        self.conversion_workspace = v.into();
3950        self
3951    }
3952
3953    /// Sets the value of [page_size][crate::model::DescribeDatabaseEntitiesRequest::page_size].
3954    ///
3955    /// # Example
3956    /// ```ignore,no_run
3957    /// # use google_cloud_clouddms_v1::model::DescribeDatabaseEntitiesRequest;
3958    /// let x = DescribeDatabaseEntitiesRequest::new().set_page_size(42);
3959    /// ```
3960    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3961        self.page_size = v.into();
3962        self
3963    }
3964
3965    /// Sets the value of [page_token][crate::model::DescribeDatabaseEntitiesRequest::page_token].
3966    ///
3967    /// # Example
3968    /// ```ignore,no_run
3969    /// # use google_cloud_clouddms_v1::model::DescribeDatabaseEntitiesRequest;
3970    /// let x = DescribeDatabaseEntitiesRequest::new().set_page_token("example");
3971    /// ```
3972    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3973        self.page_token = v.into();
3974        self
3975    }
3976
3977    /// Sets the value of [tree][crate::model::DescribeDatabaseEntitiesRequest::tree].
3978    ///
3979    /// # Example
3980    /// ```ignore,no_run
3981    /// # use google_cloud_clouddms_v1::model::DescribeDatabaseEntitiesRequest;
3982    /// use google_cloud_clouddms_v1::model::describe_database_entities_request::DBTreeType;
3983    /// let x0 = DescribeDatabaseEntitiesRequest::new().set_tree(DBTreeType::SourceTree);
3984    /// let x1 = DescribeDatabaseEntitiesRequest::new().set_tree(DBTreeType::DraftTree);
3985    /// let x2 = DescribeDatabaseEntitiesRequest::new().set_tree(DBTreeType::DestinationTree);
3986    /// ```
3987    pub fn set_tree<
3988        T: std::convert::Into<crate::model::describe_database_entities_request::DBTreeType>,
3989    >(
3990        mut self,
3991        v: T,
3992    ) -> Self {
3993        self.tree = v.into();
3994        self
3995    }
3996
3997    /// Sets the value of [uncommitted][crate::model::DescribeDatabaseEntitiesRequest::uncommitted].
3998    ///
3999    /// # Example
4000    /// ```ignore,no_run
4001    /// # use google_cloud_clouddms_v1::model::DescribeDatabaseEntitiesRequest;
4002    /// let x = DescribeDatabaseEntitiesRequest::new().set_uncommitted(true);
4003    /// ```
4004    pub fn set_uncommitted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4005        self.uncommitted = v.into();
4006        self
4007    }
4008
4009    /// Sets the value of [commit_id][crate::model::DescribeDatabaseEntitiesRequest::commit_id].
4010    ///
4011    /// # Example
4012    /// ```ignore,no_run
4013    /// # use google_cloud_clouddms_v1::model::DescribeDatabaseEntitiesRequest;
4014    /// let x = DescribeDatabaseEntitiesRequest::new().set_commit_id("example");
4015    /// ```
4016    pub fn set_commit_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4017        self.commit_id = v.into();
4018        self
4019    }
4020
4021    /// Sets the value of [filter][crate::model::DescribeDatabaseEntitiesRequest::filter].
4022    ///
4023    /// # Example
4024    /// ```ignore,no_run
4025    /// # use google_cloud_clouddms_v1::model::DescribeDatabaseEntitiesRequest;
4026    /// let x = DescribeDatabaseEntitiesRequest::new().set_filter("example");
4027    /// ```
4028    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4029        self.filter = v.into();
4030        self
4031    }
4032
4033    /// Sets the value of [view][crate::model::DescribeDatabaseEntitiesRequest::view].
4034    ///
4035    /// # Example
4036    /// ```ignore,no_run
4037    /// # use google_cloud_clouddms_v1::model::DescribeDatabaseEntitiesRequest;
4038    /// use google_cloud_clouddms_v1::model::DatabaseEntityView;
4039    /// let x0 = DescribeDatabaseEntitiesRequest::new().set_view(DatabaseEntityView::Basic);
4040    /// let x1 = DescribeDatabaseEntitiesRequest::new().set_view(DatabaseEntityView::Full);
4041    /// let x2 = DescribeDatabaseEntitiesRequest::new().set_view(DatabaseEntityView::RootSummary);
4042    /// ```
4043    pub fn set_view<T: std::convert::Into<crate::model::DatabaseEntityView>>(
4044        mut self,
4045        v: T,
4046    ) -> Self {
4047        self.view = v.into();
4048        self
4049    }
4050}
4051
4052impl wkt::message::Message for DescribeDatabaseEntitiesRequest {
4053    fn typename() -> &'static str {
4054        "type.googleapis.com/google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest"
4055    }
4056}
4057
4058/// Defines additional types related to [DescribeDatabaseEntitiesRequest].
4059pub mod describe_database_entities_request {
4060    #[allow(unused_imports)]
4061    use super::*;
4062
4063    /// The type of a tree to return
4064    ///
4065    /// # Working with unknown values
4066    ///
4067    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4068    /// additional enum variants at any time. Adding new variants is not considered
4069    /// a breaking change. Applications should write their code in anticipation of:
4070    ///
4071    /// - New values appearing in future releases of the client library, **and**
4072    /// - New values received dynamically, without application changes.
4073    ///
4074    /// Please consult the [Working with enums] section in the user guide for some
4075    /// guidelines.
4076    ///
4077    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4078    #[derive(Clone, Debug, PartialEq)]
4079    #[non_exhaustive]
4080    pub enum DBTreeType {
4081        /// Unspecified tree type.
4082        Unspecified,
4083        /// The source database tree.
4084        SourceTree,
4085        /// The draft database tree.
4086        DraftTree,
4087        /// The destination database tree.
4088        DestinationTree,
4089        /// If set, the enum was initialized with an unknown value.
4090        ///
4091        /// Applications can examine the value using [DBTreeType::value] or
4092        /// [DBTreeType::name].
4093        UnknownValue(db_tree_type::UnknownValue),
4094    }
4095
4096    #[doc(hidden)]
4097    pub mod db_tree_type {
4098        #[allow(unused_imports)]
4099        use super::*;
4100        #[derive(Clone, Debug, PartialEq)]
4101        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4102    }
4103
4104    impl DBTreeType {
4105        /// Gets the enum value.
4106        ///
4107        /// Returns `None` if the enum contains an unknown value deserialized from
4108        /// the string representation of enums.
4109        pub fn value(&self) -> std::option::Option<i32> {
4110            match self {
4111                Self::Unspecified => std::option::Option::Some(0),
4112                Self::SourceTree => std::option::Option::Some(1),
4113                Self::DraftTree => std::option::Option::Some(2),
4114                Self::DestinationTree => std::option::Option::Some(3),
4115                Self::UnknownValue(u) => u.0.value(),
4116            }
4117        }
4118
4119        /// Gets the enum value as a string.
4120        ///
4121        /// Returns `None` if the enum contains an unknown value deserialized from
4122        /// the integer representation of enums.
4123        pub fn name(&self) -> std::option::Option<&str> {
4124            match self {
4125                Self::Unspecified => std::option::Option::Some("DB_TREE_TYPE_UNSPECIFIED"),
4126                Self::SourceTree => std::option::Option::Some("SOURCE_TREE"),
4127                Self::DraftTree => std::option::Option::Some("DRAFT_TREE"),
4128                Self::DestinationTree => std::option::Option::Some("DESTINATION_TREE"),
4129                Self::UnknownValue(u) => u.0.name(),
4130            }
4131        }
4132    }
4133
4134    impl std::default::Default for DBTreeType {
4135        fn default() -> Self {
4136            use std::convert::From;
4137            Self::from(0)
4138        }
4139    }
4140
4141    impl std::fmt::Display for DBTreeType {
4142        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4143            wkt::internal::display_enum(f, self.name(), self.value())
4144        }
4145    }
4146
4147    impl std::convert::From<i32> for DBTreeType {
4148        fn from(value: i32) -> Self {
4149            match value {
4150                0 => Self::Unspecified,
4151                1 => Self::SourceTree,
4152                2 => Self::DraftTree,
4153                3 => Self::DestinationTree,
4154                _ => Self::UnknownValue(db_tree_type::UnknownValue(
4155                    wkt::internal::UnknownEnumValue::Integer(value),
4156                )),
4157            }
4158        }
4159    }
4160
4161    impl std::convert::From<&str> for DBTreeType {
4162        fn from(value: &str) -> Self {
4163            use std::string::ToString;
4164            match value {
4165                "DB_TREE_TYPE_UNSPECIFIED" => Self::Unspecified,
4166                "SOURCE_TREE" => Self::SourceTree,
4167                "DRAFT_TREE" => Self::DraftTree,
4168                "DESTINATION_TREE" => Self::DestinationTree,
4169                _ => Self::UnknownValue(db_tree_type::UnknownValue(
4170                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4171                )),
4172            }
4173        }
4174    }
4175
4176    impl serde::ser::Serialize for DBTreeType {
4177        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4178        where
4179            S: serde::Serializer,
4180        {
4181            match self {
4182                Self::Unspecified => serializer.serialize_i32(0),
4183                Self::SourceTree => serializer.serialize_i32(1),
4184                Self::DraftTree => serializer.serialize_i32(2),
4185                Self::DestinationTree => serializer.serialize_i32(3),
4186                Self::UnknownValue(u) => u.0.serialize(serializer),
4187            }
4188        }
4189    }
4190
4191    impl<'de> serde::de::Deserialize<'de> for DBTreeType {
4192        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4193        where
4194            D: serde::Deserializer<'de>,
4195        {
4196            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DBTreeType>::new(
4197                ".google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest.DBTreeType",
4198            ))
4199        }
4200    }
4201}
4202
4203/// Response message for 'DescribeDatabaseEntities' request.
4204#[derive(Clone, Default, PartialEq)]
4205#[non_exhaustive]
4206pub struct DescribeDatabaseEntitiesResponse {
4207    /// The list of database entities for the conversion workspace.
4208    pub database_entities: std::vec::Vec<crate::model::DatabaseEntity>,
4209
4210    /// A token which can be sent as `page_token` to retrieve the next page.
4211    /// If this field is omitted, there are no subsequent pages.
4212    pub next_page_token: std::string::String,
4213
4214    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4215}
4216
4217impl DescribeDatabaseEntitiesResponse {
4218    pub fn new() -> Self {
4219        std::default::Default::default()
4220    }
4221
4222    /// Sets the value of [database_entities][crate::model::DescribeDatabaseEntitiesResponse::database_entities].
4223    ///
4224    /// # Example
4225    /// ```ignore,no_run
4226    /// # use google_cloud_clouddms_v1::model::DescribeDatabaseEntitiesResponse;
4227    /// use google_cloud_clouddms_v1::model::DatabaseEntity;
4228    /// let x = DescribeDatabaseEntitiesResponse::new()
4229    ///     .set_database_entities([
4230    ///         DatabaseEntity::default()/* use setters */,
4231    ///         DatabaseEntity::default()/* use (different) setters */,
4232    ///     ]);
4233    /// ```
4234    pub fn set_database_entities<T, V>(mut self, v: T) -> Self
4235    where
4236        T: std::iter::IntoIterator<Item = V>,
4237        V: std::convert::Into<crate::model::DatabaseEntity>,
4238    {
4239        use std::iter::Iterator;
4240        self.database_entities = v.into_iter().map(|i| i.into()).collect();
4241        self
4242    }
4243
4244    /// Sets the value of [next_page_token][crate::model::DescribeDatabaseEntitiesResponse::next_page_token].
4245    ///
4246    /// # Example
4247    /// ```ignore,no_run
4248    /// # use google_cloud_clouddms_v1::model::DescribeDatabaseEntitiesResponse;
4249    /// let x = DescribeDatabaseEntitiesResponse::new().set_next_page_token("example");
4250    /// ```
4251    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4252        self.next_page_token = v.into();
4253        self
4254    }
4255}
4256
4257impl wkt::message::Message for DescribeDatabaseEntitiesResponse {
4258    fn typename() -> &'static str {
4259        "type.googleapis.com/google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse"
4260    }
4261}
4262
4263#[doc(hidden)]
4264impl google_cloud_gax::paginator::internal::PageableResponse for DescribeDatabaseEntitiesResponse {
4265    type PageItem = crate::model::DatabaseEntity;
4266
4267    fn items(self) -> std::vec::Vec<Self::PageItem> {
4268        self.database_entities
4269    }
4270
4271    fn next_page_token(&self) -> std::string::String {
4272        use std::clone::Clone;
4273        self.next_page_token.clone()
4274    }
4275}
4276
4277/// Request message for 'SearchBackgroundJobs' request.
4278#[derive(Clone, Default, PartialEq)]
4279#[non_exhaustive]
4280pub struct SearchBackgroundJobsRequest {
4281    /// Required. Name of the conversion workspace resource whose jobs are listed,
4282    /// in the form of:
4283    /// projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.
4284    pub conversion_workspace: std::string::String,
4285
4286    /// Optional. Whether or not to return just the most recent job per job type,
4287    pub return_most_recent_per_job_type: bool,
4288
4289    /// Optional. The maximum number of jobs to return. The service may return
4290    /// fewer than this value. If unspecified, at most 100 jobs are
4291    /// returned. The maximum value is 100; values above 100 are coerced to
4292    /// 100.
4293    pub max_size: i32,
4294
4295    /// Optional. If provided, only returns jobs that completed until (not
4296    /// including) the given timestamp.
4297    pub completed_until_time: std::option::Option<wkt::Timestamp>,
4298
4299    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4300}
4301
4302impl SearchBackgroundJobsRequest {
4303    pub fn new() -> Self {
4304        std::default::Default::default()
4305    }
4306
4307    /// Sets the value of [conversion_workspace][crate::model::SearchBackgroundJobsRequest::conversion_workspace].
4308    ///
4309    /// # Example
4310    /// ```ignore,no_run
4311    /// # use google_cloud_clouddms_v1::model::SearchBackgroundJobsRequest;
4312    /// let x = SearchBackgroundJobsRequest::new().set_conversion_workspace("example");
4313    /// ```
4314    pub fn set_conversion_workspace<T: std::convert::Into<std::string::String>>(
4315        mut self,
4316        v: T,
4317    ) -> Self {
4318        self.conversion_workspace = v.into();
4319        self
4320    }
4321
4322    /// Sets the value of [return_most_recent_per_job_type][crate::model::SearchBackgroundJobsRequest::return_most_recent_per_job_type].
4323    ///
4324    /// # Example
4325    /// ```ignore,no_run
4326    /// # use google_cloud_clouddms_v1::model::SearchBackgroundJobsRequest;
4327    /// let x = SearchBackgroundJobsRequest::new().set_return_most_recent_per_job_type(true);
4328    /// ```
4329    pub fn set_return_most_recent_per_job_type<T: std::convert::Into<bool>>(
4330        mut self,
4331        v: T,
4332    ) -> Self {
4333        self.return_most_recent_per_job_type = v.into();
4334        self
4335    }
4336
4337    /// Sets the value of [max_size][crate::model::SearchBackgroundJobsRequest::max_size].
4338    ///
4339    /// # Example
4340    /// ```ignore,no_run
4341    /// # use google_cloud_clouddms_v1::model::SearchBackgroundJobsRequest;
4342    /// let x = SearchBackgroundJobsRequest::new().set_max_size(42);
4343    /// ```
4344    pub fn set_max_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4345        self.max_size = v.into();
4346        self
4347    }
4348
4349    /// Sets the value of [completed_until_time][crate::model::SearchBackgroundJobsRequest::completed_until_time].
4350    ///
4351    /// # Example
4352    /// ```ignore,no_run
4353    /// # use google_cloud_clouddms_v1::model::SearchBackgroundJobsRequest;
4354    /// use wkt::Timestamp;
4355    /// let x = SearchBackgroundJobsRequest::new().set_completed_until_time(Timestamp::default()/* use setters */);
4356    /// ```
4357    pub fn set_completed_until_time<T>(mut self, v: T) -> Self
4358    where
4359        T: std::convert::Into<wkt::Timestamp>,
4360    {
4361        self.completed_until_time = std::option::Option::Some(v.into());
4362        self
4363    }
4364
4365    /// Sets or clears the value of [completed_until_time][crate::model::SearchBackgroundJobsRequest::completed_until_time].
4366    ///
4367    /// # Example
4368    /// ```ignore,no_run
4369    /// # use google_cloud_clouddms_v1::model::SearchBackgroundJobsRequest;
4370    /// use wkt::Timestamp;
4371    /// let x = SearchBackgroundJobsRequest::new().set_or_clear_completed_until_time(Some(Timestamp::default()/* use setters */));
4372    /// let x = SearchBackgroundJobsRequest::new().set_or_clear_completed_until_time(None::<Timestamp>);
4373    /// ```
4374    pub fn set_or_clear_completed_until_time<T>(mut self, v: std::option::Option<T>) -> Self
4375    where
4376        T: std::convert::Into<wkt::Timestamp>,
4377    {
4378        self.completed_until_time = v.map(|x| x.into());
4379        self
4380    }
4381}
4382
4383impl wkt::message::Message for SearchBackgroundJobsRequest {
4384    fn typename() -> &'static str {
4385        "type.googleapis.com/google.cloud.clouddms.v1.SearchBackgroundJobsRequest"
4386    }
4387}
4388
4389/// Response message for 'SearchBackgroundJobs' request.
4390#[derive(Clone, Default, PartialEq)]
4391#[non_exhaustive]
4392pub struct SearchBackgroundJobsResponse {
4393    /// The list of conversion workspace mapping rules.
4394    pub jobs: std::vec::Vec<crate::model::BackgroundJobLogEntry>,
4395
4396    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4397}
4398
4399impl SearchBackgroundJobsResponse {
4400    pub fn new() -> Self {
4401        std::default::Default::default()
4402    }
4403
4404    /// Sets the value of [jobs][crate::model::SearchBackgroundJobsResponse::jobs].
4405    ///
4406    /// # Example
4407    /// ```ignore,no_run
4408    /// # use google_cloud_clouddms_v1::model::SearchBackgroundJobsResponse;
4409    /// use google_cloud_clouddms_v1::model::BackgroundJobLogEntry;
4410    /// let x = SearchBackgroundJobsResponse::new()
4411    ///     .set_jobs([
4412    ///         BackgroundJobLogEntry::default()/* use setters */,
4413    ///         BackgroundJobLogEntry::default()/* use (different) setters */,
4414    ///     ]);
4415    /// ```
4416    pub fn set_jobs<T, V>(mut self, v: T) -> Self
4417    where
4418        T: std::iter::IntoIterator<Item = V>,
4419        V: std::convert::Into<crate::model::BackgroundJobLogEntry>,
4420    {
4421        use std::iter::Iterator;
4422        self.jobs = v.into_iter().map(|i| i.into()).collect();
4423        self
4424    }
4425}
4426
4427impl wkt::message::Message for SearchBackgroundJobsResponse {
4428    fn typename() -> &'static str {
4429        "type.googleapis.com/google.cloud.clouddms.v1.SearchBackgroundJobsResponse"
4430    }
4431}
4432
4433/// Request message for 'DescribeConversionWorkspaceRevisions' request.
4434#[derive(Clone, Default, PartialEq)]
4435#[non_exhaustive]
4436pub struct DescribeConversionWorkspaceRevisionsRequest {
4437    /// Required. Name of the conversion workspace resource whose revisions are
4438    /// listed. Must be in the form of:
4439    /// projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.
4440    pub conversion_workspace: std::string::String,
4441
4442    /// Optional. Optional filter to request a specific commit ID.
4443    pub commit_id: std::string::String,
4444
4445    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4446}
4447
4448impl DescribeConversionWorkspaceRevisionsRequest {
4449    pub fn new() -> Self {
4450        std::default::Default::default()
4451    }
4452
4453    /// Sets the value of [conversion_workspace][crate::model::DescribeConversionWorkspaceRevisionsRequest::conversion_workspace].
4454    ///
4455    /// # Example
4456    /// ```ignore,no_run
4457    /// # use google_cloud_clouddms_v1::model::DescribeConversionWorkspaceRevisionsRequest;
4458    /// let x = DescribeConversionWorkspaceRevisionsRequest::new().set_conversion_workspace("example");
4459    /// ```
4460    pub fn set_conversion_workspace<T: std::convert::Into<std::string::String>>(
4461        mut self,
4462        v: T,
4463    ) -> Self {
4464        self.conversion_workspace = v.into();
4465        self
4466    }
4467
4468    /// Sets the value of [commit_id][crate::model::DescribeConversionWorkspaceRevisionsRequest::commit_id].
4469    ///
4470    /// # Example
4471    /// ```ignore,no_run
4472    /// # use google_cloud_clouddms_v1::model::DescribeConversionWorkspaceRevisionsRequest;
4473    /// let x = DescribeConversionWorkspaceRevisionsRequest::new().set_commit_id("example");
4474    /// ```
4475    pub fn set_commit_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4476        self.commit_id = v.into();
4477        self
4478    }
4479}
4480
4481impl wkt::message::Message for DescribeConversionWorkspaceRevisionsRequest {
4482    fn typename() -> &'static str {
4483        "type.googleapis.com/google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest"
4484    }
4485}
4486
4487/// Response message for 'DescribeConversionWorkspaceRevisions' request.
4488#[derive(Clone, Default, PartialEq)]
4489#[non_exhaustive]
4490pub struct DescribeConversionWorkspaceRevisionsResponse {
4491    /// The list of conversion workspace revisions.
4492    pub revisions: std::vec::Vec<crate::model::ConversionWorkspace>,
4493
4494    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4495}
4496
4497impl DescribeConversionWorkspaceRevisionsResponse {
4498    pub fn new() -> Self {
4499        std::default::Default::default()
4500    }
4501
4502    /// Sets the value of [revisions][crate::model::DescribeConversionWorkspaceRevisionsResponse::revisions].
4503    ///
4504    /// # Example
4505    /// ```ignore,no_run
4506    /// # use google_cloud_clouddms_v1::model::DescribeConversionWorkspaceRevisionsResponse;
4507    /// use google_cloud_clouddms_v1::model::ConversionWorkspace;
4508    /// let x = DescribeConversionWorkspaceRevisionsResponse::new()
4509    ///     .set_revisions([
4510    ///         ConversionWorkspace::default()/* use setters */,
4511    ///         ConversionWorkspace::default()/* use (different) setters */,
4512    ///     ]);
4513    /// ```
4514    pub fn set_revisions<T, V>(mut self, v: T) -> Self
4515    where
4516        T: std::iter::IntoIterator<Item = V>,
4517        V: std::convert::Into<crate::model::ConversionWorkspace>,
4518    {
4519        use std::iter::Iterator;
4520        self.revisions = v.into_iter().map(|i| i.into()).collect();
4521        self
4522    }
4523}
4524
4525impl wkt::message::Message for DescribeConversionWorkspaceRevisionsResponse {
4526    fn typename() -> &'static str {
4527        "type.googleapis.com/google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse"
4528    }
4529}
4530
4531/// Request message for 'CreateMappingRule' command.
4532#[derive(Clone, Default, PartialEq)]
4533#[non_exhaustive]
4534pub struct CreateMappingRuleRequest {
4535    /// Required. The parent which owns this collection of mapping rules.
4536    pub parent: std::string::String,
4537
4538    /// Required. The ID of the rule to create.
4539    pub mapping_rule_id: std::string::String,
4540
4541    /// Required. Represents a [mapping rule]
4542    /// (<https://cloud.google.com/database-migration/reference/rest/v1/projects.locations.mappingRules>)
4543    /// object.
4544    pub mapping_rule: std::option::Option<crate::model::MappingRule>,
4545
4546    /// A unique ID used to identify the request. If the server receives two
4547    /// requests with the same ID, then the second request is ignored.
4548    ///
4549    /// It is recommended to always set this value to a UUID.
4550    ///
4551    /// The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
4552    /// (_), and hyphens (-). The maximum length is 40 characters.
4553    pub request_id: std::string::String,
4554
4555    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4556}
4557
4558impl CreateMappingRuleRequest {
4559    pub fn new() -> Self {
4560        std::default::Default::default()
4561    }
4562
4563    /// Sets the value of [parent][crate::model::CreateMappingRuleRequest::parent].
4564    ///
4565    /// # Example
4566    /// ```ignore,no_run
4567    /// # use google_cloud_clouddms_v1::model::CreateMappingRuleRequest;
4568    /// let x = CreateMappingRuleRequest::new().set_parent("example");
4569    /// ```
4570    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4571        self.parent = v.into();
4572        self
4573    }
4574
4575    /// Sets the value of [mapping_rule_id][crate::model::CreateMappingRuleRequest::mapping_rule_id].
4576    ///
4577    /// # Example
4578    /// ```ignore,no_run
4579    /// # use google_cloud_clouddms_v1::model::CreateMappingRuleRequest;
4580    /// let x = CreateMappingRuleRequest::new().set_mapping_rule_id("example");
4581    /// ```
4582    pub fn set_mapping_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4583        self.mapping_rule_id = v.into();
4584        self
4585    }
4586
4587    /// Sets the value of [mapping_rule][crate::model::CreateMappingRuleRequest::mapping_rule].
4588    ///
4589    /// # Example
4590    /// ```ignore,no_run
4591    /// # use google_cloud_clouddms_v1::model::CreateMappingRuleRequest;
4592    /// use google_cloud_clouddms_v1::model::MappingRule;
4593    /// let x = CreateMappingRuleRequest::new().set_mapping_rule(MappingRule::default()/* use setters */);
4594    /// ```
4595    pub fn set_mapping_rule<T>(mut self, v: T) -> Self
4596    where
4597        T: std::convert::Into<crate::model::MappingRule>,
4598    {
4599        self.mapping_rule = std::option::Option::Some(v.into());
4600        self
4601    }
4602
4603    /// Sets or clears the value of [mapping_rule][crate::model::CreateMappingRuleRequest::mapping_rule].
4604    ///
4605    /// # Example
4606    /// ```ignore,no_run
4607    /// # use google_cloud_clouddms_v1::model::CreateMappingRuleRequest;
4608    /// use google_cloud_clouddms_v1::model::MappingRule;
4609    /// let x = CreateMappingRuleRequest::new().set_or_clear_mapping_rule(Some(MappingRule::default()/* use setters */));
4610    /// let x = CreateMappingRuleRequest::new().set_or_clear_mapping_rule(None::<MappingRule>);
4611    /// ```
4612    pub fn set_or_clear_mapping_rule<T>(mut self, v: std::option::Option<T>) -> Self
4613    where
4614        T: std::convert::Into<crate::model::MappingRule>,
4615    {
4616        self.mapping_rule = v.map(|x| x.into());
4617        self
4618    }
4619
4620    /// Sets the value of [request_id][crate::model::CreateMappingRuleRequest::request_id].
4621    ///
4622    /// # Example
4623    /// ```ignore,no_run
4624    /// # use google_cloud_clouddms_v1::model::CreateMappingRuleRequest;
4625    /// let x = CreateMappingRuleRequest::new().set_request_id("example");
4626    /// ```
4627    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4628        self.request_id = v.into();
4629        self
4630    }
4631}
4632
4633impl wkt::message::Message for CreateMappingRuleRequest {
4634    fn typename() -> &'static str {
4635        "type.googleapis.com/google.cloud.clouddms.v1.CreateMappingRuleRequest"
4636    }
4637}
4638
4639/// Request message for 'DeleteMappingRule' request.
4640#[derive(Clone, Default, PartialEq)]
4641#[non_exhaustive]
4642pub struct DeleteMappingRuleRequest {
4643    /// Required. Name of the mapping rule resource to delete.
4644    pub name: std::string::String,
4645
4646    /// Optional. A unique ID used to identify the request. If the server receives
4647    /// two requests with the same ID, then the second request is ignored.
4648    ///
4649    /// It is recommended to always set this value to a UUID.
4650    ///
4651    /// The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
4652    /// (_), and hyphens (-). The maximum length is 40 characters.
4653    pub request_id: std::string::String,
4654
4655    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4656}
4657
4658impl DeleteMappingRuleRequest {
4659    pub fn new() -> Self {
4660        std::default::Default::default()
4661    }
4662
4663    /// Sets the value of [name][crate::model::DeleteMappingRuleRequest::name].
4664    ///
4665    /// # Example
4666    /// ```ignore,no_run
4667    /// # use google_cloud_clouddms_v1::model::DeleteMappingRuleRequest;
4668    /// let x = DeleteMappingRuleRequest::new().set_name("example");
4669    /// ```
4670    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4671        self.name = v.into();
4672        self
4673    }
4674
4675    /// Sets the value of [request_id][crate::model::DeleteMappingRuleRequest::request_id].
4676    ///
4677    /// # Example
4678    /// ```ignore,no_run
4679    /// # use google_cloud_clouddms_v1::model::DeleteMappingRuleRequest;
4680    /// let x = DeleteMappingRuleRequest::new().set_request_id("example");
4681    /// ```
4682    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4683        self.request_id = v.into();
4684        self
4685    }
4686}
4687
4688impl wkt::message::Message for DeleteMappingRuleRequest {
4689    fn typename() -> &'static str {
4690        "type.googleapis.com/google.cloud.clouddms.v1.DeleteMappingRuleRequest"
4691    }
4692}
4693
4694/// Request message for 'FetchStaticIps' request.
4695#[derive(Clone, Default, PartialEq)]
4696#[non_exhaustive]
4697pub struct FetchStaticIpsRequest {
4698    /// Required. The resource name for the location for which static IPs should be
4699    /// returned. Must be in the format `projects/*/locations/*`.
4700    pub name: std::string::String,
4701
4702    /// Maximum number of IPs to return.
4703    pub page_size: i32,
4704
4705    /// A page token, received from a previous `FetchStaticIps` call.
4706    pub page_token: std::string::String,
4707
4708    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4709}
4710
4711impl FetchStaticIpsRequest {
4712    pub fn new() -> Self {
4713        std::default::Default::default()
4714    }
4715
4716    /// Sets the value of [name][crate::model::FetchStaticIpsRequest::name].
4717    ///
4718    /// # Example
4719    /// ```ignore,no_run
4720    /// # use google_cloud_clouddms_v1::model::FetchStaticIpsRequest;
4721    /// let x = FetchStaticIpsRequest::new().set_name("example");
4722    /// ```
4723    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4724        self.name = v.into();
4725        self
4726    }
4727
4728    /// Sets the value of [page_size][crate::model::FetchStaticIpsRequest::page_size].
4729    ///
4730    /// # Example
4731    /// ```ignore,no_run
4732    /// # use google_cloud_clouddms_v1::model::FetchStaticIpsRequest;
4733    /// let x = FetchStaticIpsRequest::new().set_page_size(42);
4734    /// ```
4735    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4736        self.page_size = v.into();
4737        self
4738    }
4739
4740    /// Sets the value of [page_token][crate::model::FetchStaticIpsRequest::page_token].
4741    ///
4742    /// # Example
4743    /// ```ignore,no_run
4744    /// # use google_cloud_clouddms_v1::model::FetchStaticIpsRequest;
4745    /// let x = FetchStaticIpsRequest::new().set_page_token("example");
4746    /// ```
4747    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4748        self.page_token = v.into();
4749        self
4750    }
4751}
4752
4753impl wkt::message::Message for FetchStaticIpsRequest {
4754    fn typename() -> &'static str {
4755        "type.googleapis.com/google.cloud.clouddms.v1.FetchStaticIpsRequest"
4756    }
4757}
4758
4759/// Response message for a 'FetchStaticIps' request.
4760#[derive(Clone, Default, PartialEq)]
4761#[non_exhaustive]
4762pub struct FetchStaticIpsResponse {
4763    /// List of static IPs.
4764    pub static_ips: std::vec::Vec<std::string::String>,
4765
4766    /// A token that can be sent as `page_token` to retrieve the next page.
4767    /// If this field is omitted, there are no subsequent pages.
4768    pub next_page_token: std::string::String,
4769
4770    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4771}
4772
4773impl FetchStaticIpsResponse {
4774    pub fn new() -> Self {
4775        std::default::Default::default()
4776    }
4777
4778    /// Sets the value of [static_ips][crate::model::FetchStaticIpsResponse::static_ips].
4779    ///
4780    /// # Example
4781    /// ```ignore,no_run
4782    /// # use google_cloud_clouddms_v1::model::FetchStaticIpsResponse;
4783    /// let x = FetchStaticIpsResponse::new().set_static_ips(["a", "b", "c"]);
4784    /// ```
4785    pub fn set_static_ips<T, V>(mut self, v: T) -> Self
4786    where
4787        T: std::iter::IntoIterator<Item = V>,
4788        V: std::convert::Into<std::string::String>,
4789    {
4790        use std::iter::Iterator;
4791        self.static_ips = v.into_iter().map(|i| i.into()).collect();
4792        self
4793    }
4794
4795    /// Sets the value of [next_page_token][crate::model::FetchStaticIpsResponse::next_page_token].
4796    ///
4797    /// # Example
4798    /// ```ignore,no_run
4799    /// # use google_cloud_clouddms_v1::model::FetchStaticIpsResponse;
4800    /// let x = FetchStaticIpsResponse::new().set_next_page_token("example");
4801    /// ```
4802    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4803        self.next_page_token = v.into();
4804        self
4805    }
4806}
4807
4808impl wkt::message::Message for FetchStaticIpsResponse {
4809    fn typename() -> &'static str {
4810        "type.googleapis.com/google.cloud.clouddms.v1.FetchStaticIpsResponse"
4811    }
4812}
4813
4814/// SSL configuration information.
4815#[derive(Clone, Default, PartialEq)]
4816#[non_exhaustive]
4817pub struct SslConfig {
4818    /// Output only. The ssl config type according to 'client_key',
4819    /// 'client_certificate' and 'ca_certificate'.
4820    pub r#type: crate::model::ssl_config::SslType,
4821
4822    /// Input only. The unencrypted PKCS#1 or PKCS#8 PEM-encoded private key
4823    /// associated with the Client Certificate. If this field is used then the
4824    /// 'client_certificate' field is mandatory.
4825    pub client_key: std::string::String,
4826
4827    /// Input only. The x509 PEM-encoded certificate that will be used by the
4828    /// replica to authenticate against the source database server.If this field is
4829    /// used then the 'client_key' field is mandatory.
4830    pub client_certificate: std::string::String,
4831
4832    /// Required. Input only. The x509 PEM-encoded certificate of the CA that
4833    /// signed the source database server's certificate. The replica will use this
4834    /// certificate to verify it's connecting to the right host.
4835    pub ca_certificate: std::string::String,
4836
4837    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4838}
4839
4840impl SslConfig {
4841    pub fn new() -> Self {
4842        std::default::Default::default()
4843    }
4844
4845    /// Sets the value of [r#type][crate::model::SslConfig::type].
4846    ///
4847    /// # Example
4848    /// ```ignore,no_run
4849    /// # use google_cloud_clouddms_v1::model::SslConfig;
4850    /// use google_cloud_clouddms_v1::model::ssl_config::SslType;
4851    /// let x0 = SslConfig::new().set_type(SslType::ServerOnly);
4852    /// let x1 = SslConfig::new().set_type(SslType::ServerClient);
4853    /// ```
4854    pub fn set_type<T: std::convert::Into<crate::model::ssl_config::SslType>>(
4855        mut self,
4856        v: T,
4857    ) -> Self {
4858        self.r#type = v.into();
4859        self
4860    }
4861
4862    /// Sets the value of [client_key][crate::model::SslConfig::client_key].
4863    ///
4864    /// # Example
4865    /// ```ignore,no_run
4866    /// # use google_cloud_clouddms_v1::model::SslConfig;
4867    /// let x = SslConfig::new().set_client_key("example");
4868    /// ```
4869    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4870        self.client_key = v.into();
4871        self
4872    }
4873
4874    /// Sets the value of [client_certificate][crate::model::SslConfig::client_certificate].
4875    ///
4876    /// # Example
4877    /// ```ignore,no_run
4878    /// # use google_cloud_clouddms_v1::model::SslConfig;
4879    /// let x = SslConfig::new().set_client_certificate("example");
4880    /// ```
4881    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
4882        mut self,
4883        v: T,
4884    ) -> Self {
4885        self.client_certificate = v.into();
4886        self
4887    }
4888
4889    /// Sets the value of [ca_certificate][crate::model::SslConfig::ca_certificate].
4890    ///
4891    /// # Example
4892    /// ```ignore,no_run
4893    /// # use google_cloud_clouddms_v1::model::SslConfig;
4894    /// let x = SslConfig::new().set_ca_certificate("example");
4895    /// ```
4896    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4897        self.ca_certificate = v.into();
4898        self
4899    }
4900}
4901
4902impl wkt::message::Message for SslConfig {
4903    fn typename() -> &'static str {
4904        "type.googleapis.com/google.cloud.clouddms.v1.SslConfig"
4905    }
4906}
4907
4908/// Defines additional types related to [SslConfig].
4909pub mod ssl_config {
4910    #[allow(unused_imports)]
4911    use super::*;
4912
4913    /// Specifies The kind of ssl configuration used.
4914    ///
4915    /// # Working with unknown values
4916    ///
4917    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4918    /// additional enum variants at any time. Adding new variants is not considered
4919    /// a breaking change. Applications should write their code in anticipation of:
4920    ///
4921    /// - New values appearing in future releases of the client library, **and**
4922    /// - New values received dynamically, without application changes.
4923    ///
4924    /// Please consult the [Working with enums] section in the user guide for some
4925    /// guidelines.
4926    ///
4927    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4928    #[derive(Clone, Debug, PartialEq)]
4929    #[non_exhaustive]
4930    pub enum SslType {
4931        /// Unspecified.
4932        Unspecified,
4933        /// Only 'ca_certificate' specified.
4934        ServerOnly,
4935        /// Both server ('ca_certificate'), and client ('client_key',
4936        /// 'client_certificate') specified.
4937        ServerClient,
4938        /// If set, the enum was initialized with an unknown value.
4939        ///
4940        /// Applications can examine the value using [SslType::value] or
4941        /// [SslType::name].
4942        UnknownValue(ssl_type::UnknownValue),
4943    }
4944
4945    #[doc(hidden)]
4946    pub mod ssl_type {
4947        #[allow(unused_imports)]
4948        use super::*;
4949        #[derive(Clone, Debug, PartialEq)]
4950        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4951    }
4952
4953    impl SslType {
4954        /// Gets the enum value.
4955        ///
4956        /// Returns `None` if the enum contains an unknown value deserialized from
4957        /// the string representation of enums.
4958        pub fn value(&self) -> std::option::Option<i32> {
4959            match self {
4960                Self::Unspecified => std::option::Option::Some(0),
4961                Self::ServerOnly => std::option::Option::Some(1),
4962                Self::ServerClient => std::option::Option::Some(2),
4963                Self::UnknownValue(u) => u.0.value(),
4964            }
4965        }
4966
4967        /// Gets the enum value as a string.
4968        ///
4969        /// Returns `None` if the enum contains an unknown value deserialized from
4970        /// the integer representation of enums.
4971        pub fn name(&self) -> std::option::Option<&str> {
4972            match self {
4973                Self::Unspecified => std::option::Option::Some("SSL_TYPE_UNSPECIFIED"),
4974                Self::ServerOnly => std::option::Option::Some("SERVER_ONLY"),
4975                Self::ServerClient => std::option::Option::Some("SERVER_CLIENT"),
4976                Self::UnknownValue(u) => u.0.name(),
4977            }
4978        }
4979    }
4980
4981    impl std::default::Default for SslType {
4982        fn default() -> Self {
4983            use std::convert::From;
4984            Self::from(0)
4985        }
4986    }
4987
4988    impl std::fmt::Display for SslType {
4989        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4990            wkt::internal::display_enum(f, self.name(), self.value())
4991        }
4992    }
4993
4994    impl std::convert::From<i32> for SslType {
4995        fn from(value: i32) -> Self {
4996            match value {
4997                0 => Self::Unspecified,
4998                1 => Self::ServerOnly,
4999                2 => Self::ServerClient,
5000                _ => Self::UnknownValue(ssl_type::UnknownValue(
5001                    wkt::internal::UnknownEnumValue::Integer(value),
5002                )),
5003            }
5004        }
5005    }
5006
5007    impl std::convert::From<&str> for SslType {
5008        fn from(value: &str) -> Self {
5009            use std::string::ToString;
5010            match value {
5011                "SSL_TYPE_UNSPECIFIED" => Self::Unspecified,
5012                "SERVER_ONLY" => Self::ServerOnly,
5013                "SERVER_CLIENT" => Self::ServerClient,
5014                _ => Self::UnknownValue(ssl_type::UnknownValue(
5015                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5016                )),
5017            }
5018        }
5019    }
5020
5021    impl serde::ser::Serialize for SslType {
5022        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5023        where
5024            S: serde::Serializer,
5025        {
5026            match self {
5027                Self::Unspecified => serializer.serialize_i32(0),
5028                Self::ServerOnly => serializer.serialize_i32(1),
5029                Self::ServerClient => serializer.serialize_i32(2),
5030                Self::UnknownValue(u) => u.0.serialize(serializer),
5031            }
5032        }
5033    }
5034
5035    impl<'de> serde::de::Deserialize<'de> for SslType {
5036        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5037        where
5038            D: serde::Deserializer<'de>,
5039        {
5040            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslType>::new(
5041                ".google.cloud.clouddms.v1.SslConfig.SslType",
5042            ))
5043        }
5044    }
5045}
5046
5047/// Specifies connection parameters required specifically for MySQL databases.
5048#[derive(Clone, Default, PartialEq)]
5049#[non_exhaustive]
5050pub struct MySqlConnectionProfile {
5051    /// Required. The IP or hostname of the source MySQL database.
5052    pub host: std::string::String,
5053
5054    /// Required. The network port of the source MySQL database.
5055    pub port: i32,
5056
5057    /// Required. The username that Database Migration Service will use to connect
5058    /// to the database. The value is encrypted when stored in Database Migration
5059    /// Service.
5060    pub username: std::string::String,
5061
5062    /// Required. Input only. The password for the user that Database Migration
5063    /// Service will be using to connect to the database. This field is not
5064    /// returned on request, and the value is encrypted when stored in Database
5065    /// Migration Service.
5066    pub password: std::string::String,
5067
5068    /// Output only. Indicates If this connection profile password is stored.
5069    pub password_set: bool,
5070
5071    /// SSL configuration for the destination to connect to the source database.
5072    pub ssl: std::option::Option<crate::model::SslConfig>,
5073
5074    /// If the source is a Cloud SQL database, use this field to
5075    /// provide the Cloud SQL instance ID of the source.
5076    pub cloud_sql_id: std::string::String,
5077
5078    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5079}
5080
5081impl MySqlConnectionProfile {
5082    pub fn new() -> Self {
5083        std::default::Default::default()
5084    }
5085
5086    /// Sets the value of [host][crate::model::MySqlConnectionProfile::host].
5087    ///
5088    /// # Example
5089    /// ```ignore,no_run
5090    /// # use google_cloud_clouddms_v1::model::MySqlConnectionProfile;
5091    /// let x = MySqlConnectionProfile::new().set_host("example");
5092    /// ```
5093    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5094        self.host = v.into();
5095        self
5096    }
5097
5098    /// Sets the value of [port][crate::model::MySqlConnectionProfile::port].
5099    ///
5100    /// # Example
5101    /// ```ignore,no_run
5102    /// # use google_cloud_clouddms_v1::model::MySqlConnectionProfile;
5103    /// let x = MySqlConnectionProfile::new().set_port(42);
5104    /// ```
5105    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5106        self.port = v.into();
5107        self
5108    }
5109
5110    /// Sets the value of [username][crate::model::MySqlConnectionProfile::username].
5111    ///
5112    /// # Example
5113    /// ```ignore,no_run
5114    /// # use google_cloud_clouddms_v1::model::MySqlConnectionProfile;
5115    /// let x = MySqlConnectionProfile::new().set_username("example");
5116    /// ```
5117    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5118        self.username = v.into();
5119        self
5120    }
5121
5122    /// Sets the value of [password][crate::model::MySqlConnectionProfile::password].
5123    ///
5124    /// # Example
5125    /// ```ignore,no_run
5126    /// # use google_cloud_clouddms_v1::model::MySqlConnectionProfile;
5127    /// let x = MySqlConnectionProfile::new().set_password("example");
5128    /// ```
5129    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5130        self.password = v.into();
5131        self
5132    }
5133
5134    /// Sets the value of [password_set][crate::model::MySqlConnectionProfile::password_set].
5135    ///
5136    /// # Example
5137    /// ```ignore,no_run
5138    /// # use google_cloud_clouddms_v1::model::MySqlConnectionProfile;
5139    /// let x = MySqlConnectionProfile::new().set_password_set(true);
5140    /// ```
5141    pub fn set_password_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5142        self.password_set = v.into();
5143        self
5144    }
5145
5146    /// Sets the value of [ssl][crate::model::MySqlConnectionProfile::ssl].
5147    ///
5148    /// # Example
5149    /// ```ignore,no_run
5150    /// # use google_cloud_clouddms_v1::model::MySqlConnectionProfile;
5151    /// use google_cloud_clouddms_v1::model::SslConfig;
5152    /// let x = MySqlConnectionProfile::new().set_ssl(SslConfig::default()/* use setters */);
5153    /// ```
5154    pub fn set_ssl<T>(mut self, v: T) -> Self
5155    where
5156        T: std::convert::Into<crate::model::SslConfig>,
5157    {
5158        self.ssl = std::option::Option::Some(v.into());
5159        self
5160    }
5161
5162    /// Sets or clears the value of [ssl][crate::model::MySqlConnectionProfile::ssl].
5163    ///
5164    /// # Example
5165    /// ```ignore,no_run
5166    /// # use google_cloud_clouddms_v1::model::MySqlConnectionProfile;
5167    /// use google_cloud_clouddms_v1::model::SslConfig;
5168    /// let x = MySqlConnectionProfile::new().set_or_clear_ssl(Some(SslConfig::default()/* use setters */));
5169    /// let x = MySqlConnectionProfile::new().set_or_clear_ssl(None::<SslConfig>);
5170    /// ```
5171    pub fn set_or_clear_ssl<T>(mut self, v: std::option::Option<T>) -> Self
5172    where
5173        T: std::convert::Into<crate::model::SslConfig>,
5174    {
5175        self.ssl = v.map(|x| x.into());
5176        self
5177    }
5178
5179    /// Sets the value of [cloud_sql_id][crate::model::MySqlConnectionProfile::cloud_sql_id].
5180    ///
5181    /// # Example
5182    /// ```ignore,no_run
5183    /// # use google_cloud_clouddms_v1::model::MySqlConnectionProfile;
5184    /// let x = MySqlConnectionProfile::new().set_cloud_sql_id("example");
5185    /// ```
5186    pub fn set_cloud_sql_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5187        self.cloud_sql_id = v.into();
5188        self
5189    }
5190}
5191
5192impl wkt::message::Message for MySqlConnectionProfile {
5193    fn typename() -> &'static str {
5194        "type.googleapis.com/google.cloud.clouddms.v1.MySqlConnectionProfile"
5195    }
5196}
5197
5198/// Specifies connection parameters required specifically for PostgreSQL
5199/// databases.
5200#[derive(Clone, Default, PartialEq)]
5201#[non_exhaustive]
5202pub struct PostgreSqlConnectionProfile {
5203    /// Required. The IP or hostname of the source PostgreSQL database.
5204    pub host: std::string::String,
5205
5206    /// Required. The network port of the source PostgreSQL database.
5207    pub port: i32,
5208
5209    /// Required. The username that Database Migration Service will use to connect
5210    /// to the database. The value is encrypted when stored in Database Migration
5211    /// Service.
5212    pub username: std::string::String,
5213
5214    /// Required. Input only. The password for the user that Database Migration
5215    /// Service will be using to connect to the database. This field is not
5216    /// returned on request, and the value is encrypted when stored in Database
5217    /// Migration Service.
5218    pub password: std::string::String,
5219
5220    /// Output only. Indicates If this connection profile password is stored.
5221    pub password_set: bool,
5222
5223    /// SSL configuration for the destination to connect to the source database.
5224    pub ssl: std::option::Option<crate::model::SslConfig>,
5225
5226    /// If the source is a Cloud SQL database, use this field to
5227    /// provide the Cloud SQL instance ID of the source.
5228    pub cloud_sql_id: std::string::String,
5229
5230    /// Output only. If the source is a Cloud SQL database, this field indicates
5231    /// the network architecture it's associated with.
5232    pub network_architecture: crate::model::NetworkArchitecture,
5233
5234    /// Connectivity options used to establish a connection to the database server.
5235    pub connectivity:
5236        std::option::Option<crate::model::postgre_sql_connection_profile::Connectivity>,
5237
5238    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5239}
5240
5241impl PostgreSqlConnectionProfile {
5242    pub fn new() -> Self {
5243        std::default::Default::default()
5244    }
5245
5246    /// Sets the value of [host][crate::model::PostgreSqlConnectionProfile::host].
5247    ///
5248    /// # Example
5249    /// ```ignore,no_run
5250    /// # use google_cloud_clouddms_v1::model::PostgreSqlConnectionProfile;
5251    /// let x = PostgreSqlConnectionProfile::new().set_host("example");
5252    /// ```
5253    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5254        self.host = v.into();
5255        self
5256    }
5257
5258    /// Sets the value of [port][crate::model::PostgreSqlConnectionProfile::port].
5259    ///
5260    /// # Example
5261    /// ```ignore,no_run
5262    /// # use google_cloud_clouddms_v1::model::PostgreSqlConnectionProfile;
5263    /// let x = PostgreSqlConnectionProfile::new().set_port(42);
5264    /// ```
5265    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5266        self.port = v.into();
5267        self
5268    }
5269
5270    /// Sets the value of [username][crate::model::PostgreSqlConnectionProfile::username].
5271    ///
5272    /// # Example
5273    /// ```ignore,no_run
5274    /// # use google_cloud_clouddms_v1::model::PostgreSqlConnectionProfile;
5275    /// let x = PostgreSqlConnectionProfile::new().set_username("example");
5276    /// ```
5277    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5278        self.username = v.into();
5279        self
5280    }
5281
5282    /// Sets the value of [password][crate::model::PostgreSqlConnectionProfile::password].
5283    ///
5284    /// # Example
5285    /// ```ignore,no_run
5286    /// # use google_cloud_clouddms_v1::model::PostgreSqlConnectionProfile;
5287    /// let x = PostgreSqlConnectionProfile::new().set_password("example");
5288    /// ```
5289    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5290        self.password = v.into();
5291        self
5292    }
5293
5294    /// Sets the value of [password_set][crate::model::PostgreSqlConnectionProfile::password_set].
5295    ///
5296    /// # Example
5297    /// ```ignore,no_run
5298    /// # use google_cloud_clouddms_v1::model::PostgreSqlConnectionProfile;
5299    /// let x = PostgreSqlConnectionProfile::new().set_password_set(true);
5300    /// ```
5301    pub fn set_password_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5302        self.password_set = v.into();
5303        self
5304    }
5305
5306    /// Sets the value of [ssl][crate::model::PostgreSqlConnectionProfile::ssl].
5307    ///
5308    /// # Example
5309    /// ```ignore,no_run
5310    /// # use google_cloud_clouddms_v1::model::PostgreSqlConnectionProfile;
5311    /// use google_cloud_clouddms_v1::model::SslConfig;
5312    /// let x = PostgreSqlConnectionProfile::new().set_ssl(SslConfig::default()/* use setters */);
5313    /// ```
5314    pub fn set_ssl<T>(mut self, v: T) -> Self
5315    where
5316        T: std::convert::Into<crate::model::SslConfig>,
5317    {
5318        self.ssl = std::option::Option::Some(v.into());
5319        self
5320    }
5321
5322    /// Sets or clears the value of [ssl][crate::model::PostgreSqlConnectionProfile::ssl].
5323    ///
5324    /// # Example
5325    /// ```ignore,no_run
5326    /// # use google_cloud_clouddms_v1::model::PostgreSqlConnectionProfile;
5327    /// use google_cloud_clouddms_v1::model::SslConfig;
5328    /// let x = PostgreSqlConnectionProfile::new().set_or_clear_ssl(Some(SslConfig::default()/* use setters */));
5329    /// let x = PostgreSqlConnectionProfile::new().set_or_clear_ssl(None::<SslConfig>);
5330    /// ```
5331    pub fn set_or_clear_ssl<T>(mut self, v: std::option::Option<T>) -> Self
5332    where
5333        T: std::convert::Into<crate::model::SslConfig>,
5334    {
5335        self.ssl = v.map(|x| x.into());
5336        self
5337    }
5338
5339    /// Sets the value of [cloud_sql_id][crate::model::PostgreSqlConnectionProfile::cloud_sql_id].
5340    ///
5341    /// # Example
5342    /// ```ignore,no_run
5343    /// # use google_cloud_clouddms_v1::model::PostgreSqlConnectionProfile;
5344    /// let x = PostgreSqlConnectionProfile::new().set_cloud_sql_id("example");
5345    /// ```
5346    pub fn set_cloud_sql_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5347        self.cloud_sql_id = v.into();
5348        self
5349    }
5350
5351    /// Sets the value of [network_architecture][crate::model::PostgreSqlConnectionProfile::network_architecture].
5352    ///
5353    /// # Example
5354    /// ```ignore,no_run
5355    /// # use google_cloud_clouddms_v1::model::PostgreSqlConnectionProfile;
5356    /// use google_cloud_clouddms_v1::model::NetworkArchitecture;
5357    /// let x0 = PostgreSqlConnectionProfile::new().set_network_architecture(NetworkArchitecture::OldCsqlProducer);
5358    /// let x1 = PostgreSqlConnectionProfile::new().set_network_architecture(NetworkArchitecture::NewCsqlProducer);
5359    /// ```
5360    pub fn set_network_architecture<T: std::convert::Into<crate::model::NetworkArchitecture>>(
5361        mut self,
5362        v: T,
5363    ) -> Self {
5364        self.network_architecture = v.into();
5365        self
5366    }
5367
5368    /// Sets the value of [connectivity][crate::model::PostgreSqlConnectionProfile::connectivity].
5369    ///
5370    /// Note that all the setters affecting `connectivity` are mutually
5371    /// exclusive.
5372    ///
5373    /// # Example
5374    /// ```ignore,no_run
5375    /// # use google_cloud_clouddms_v1::model::PostgreSqlConnectionProfile;
5376    /// use google_cloud_clouddms_v1::model::StaticIpConnectivity;
5377    /// let x = PostgreSqlConnectionProfile::new().set_connectivity(Some(
5378    ///     google_cloud_clouddms_v1::model::postgre_sql_connection_profile::Connectivity::StaticIpConnectivity(StaticIpConnectivity::default().into())));
5379    /// ```
5380    pub fn set_connectivity<
5381        T: std::convert::Into<
5382                std::option::Option<crate::model::postgre_sql_connection_profile::Connectivity>,
5383            >,
5384    >(
5385        mut self,
5386        v: T,
5387    ) -> Self {
5388        self.connectivity = v.into();
5389        self
5390    }
5391
5392    /// The value of [connectivity][crate::model::PostgreSqlConnectionProfile::connectivity]
5393    /// if it holds a `StaticIpConnectivity`, `None` if the field is not set or
5394    /// holds a different branch.
5395    pub fn static_ip_connectivity(
5396        &self,
5397    ) -> std::option::Option<&std::boxed::Box<crate::model::StaticIpConnectivity>> {
5398        #[allow(unreachable_patterns)]
5399        self.connectivity.as_ref().and_then(|v| match v {
5400            crate::model::postgre_sql_connection_profile::Connectivity::StaticIpConnectivity(v) => {
5401                std::option::Option::Some(v)
5402            }
5403            _ => std::option::Option::None,
5404        })
5405    }
5406
5407    /// Sets the value of [connectivity][crate::model::PostgreSqlConnectionProfile::connectivity]
5408    /// to hold a `StaticIpConnectivity`.
5409    ///
5410    /// Note that all the setters affecting `connectivity` are
5411    /// mutually exclusive.
5412    ///
5413    /// # Example
5414    /// ```ignore,no_run
5415    /// # use google_cloud_clouddms_v1::model::PostgreSqlConnectionProfile;
5416    /// use google_cloud_clouddms_v1::model::StaticIpConnectivity;
5417    /// let x = PostgreSqlConnectionProfile::new().set_static_ip_connectivity(StaticIpConnectivity::default()/* use setters */);
5418    /// assert!(x.static_ip_connectivity().is_some());
5419    /// assert!(x.private_service_connect_connectivity().is_none());
5420    /// ```
5421    pub fn set_static_ip_connectivity<
5422        T: std::convert::Into<std::boxed::Box<crate::model::StaticIpConnectivity>>,
5423    >(
5424        mut self,
5425        v: T,
5426    ) -> Self {
5427        self.connectivity = std::option::Option::Some(
5428            crate::model::postgre_sql_connection_profile::Connectivity::StaticIpConnectivity(
5429                v.into(),
5430            ),
5431        );
5432        self
5433    }
5434
5435    /// The value of [connectivity][crate::model::PostgreSqlConnectionProfile::connectivity]
5436    /// if it holds a `PrivateServiceConnectConnectivity`, `None` if the field is not set or
5437    /// holds a different branch.
5438    pub fn private_service_connect_connectivity(
5439        &self,
5440    ) -> std::option::Option<&std::boxed::Box<crate::model::PrivateServiceConnectConnectivity>>
5441    {
5442        #[allow(unreachable_patterns)]
5443        self.connectivity.as_ref().and_then(|v| match v {
5444            crate::model::postgre_sql_connection_profile::Connectivity::PrivateServiceConnectConnectivity(v) => std::option::Option::Some(v),
5445            _ => std::option::Option::None,
5446        })
5447    }
5448
5449    /// Sets the value of [connectivity][crate::model::PostgreSqlConnectionProfile::connectivity]
5450    /// to hold a `PrivateServiceConnectConnectivity`.
5451    ///
5452    /// Note that all the setters affecting `connectivity` are
5453    /// mutually exclusive.
5454    ///
5455    /// # Example
5456    /// ```ignore,no_run
5457    /// # use google_cloud_clouddms_v1::model::PostgreSqlConnectionProfile;
5458    /// use google_cloud_clouddms_v1::model::PrivateServiceConnectConnectivity;
5459    /// let x = PostgreSqlConnectionProfile::new().set_private_service_connect_connectivity(PrivateServiceConnectConnectivity::default()/* use setters */);
5460    /// assert!(x.private_service_connect_connectivity().is_some());
5461    /// assert!(x.static_ip_connectivity().is_none());
5462    /// ```
5463    pub fn set_private_service_connect_connectivity<
5464        T: std::convert::Into<std::boxed::Box<crate::model::PrivateServiceConnectConnectivity>>,
5465    >(
5466        mut self,
5467        v: T,
5468    ) -> Self {
5469        self.connectivity = std::option::Option::Some(
5470            crate::model::postgre_sql_connection_profile::Connectivity::PrivateServiceConnectConnectivity(
5471                v.into()
5472            )
5473        );
5474        self
5475    }
5476}
5477
5478impl wkt::message::Message for PostgreSqlConnectionProfile {
5479    fn typename() -> &'static str {
5480        "type.googleapis.com/google.cloud.clouddms.v1.PostgreSqlConnectionProfile"
5481    }
5482}
5483
5484/// Defines additional types related to [PostgreSqlConnectionProfile].
5485pub mod postgre_sql_connection_profile {
5486    #[allow(unused_imports)]
5487    use super::*;
5488
5489    /// Connectivity options used to establish a connection to the database server.
5490    #[derive(Clone, Debug, PartialEq)]
5491    #[non_exhaustive]
5492    pub enum Connectivity {
5493        /// Static ip connectivity data (default, no additional details needed).
5494        StaticIpConnectivity(std::boxed::Box<crate::model::StaticIpConnectivity>),
5495        /// Private service connect connectivity.
5496        PrivateServiceConnectConnectivity(
5497            std::boxed::Box<crate::model::PrivateServiceConnectConnectivity>,
5498        ),
5499    }
5500}
5501
5502/// Specifies connection parameters required specifically for Oracle
5503/// databases.
5504#[derive(Clone, Default, PartialEq)]
5505#[non_exhaustive]
5506pub struct OracleConnectionProfile {
5507    /// Required. The IP or hostname of the source Oracle database.
5508    pub host: std::string::String,
5509
5510    /// Required. The network port of the source Oracle database.
5511    pub port: i32,
5512
5513    /// Required. The username that Database Migration Service will use to connect
5514    /// to the database. The value is encrypted when stored in Database Migration
5515    /// Service.
5516    pub username: std::string::String,
5517
5518    /// Required. Input only. The password for the user that Database Migration
5519    /// Service will be using to connect to the database. This field is not
5520    /// returned on request, and the value is encrypted when stored in Database
5521    /// Migration Service.
5522    pub password: std::string::String,
5523
5524    /// Output only. Indicates whether a new password is included in the request.
5525    pub password_set: bool,
5526
5527    /// Required. Database service for the Oracle connection.
5528    pub database_service: std::string::String,
5529
5530    /// SSL configuration for the connection to the source Oracle database.
5531    ///
5532    /// * Only `SERVER_ONLY` configuration is supported for Oracle SSL.
5533    /// * SSL is supported for Oracle versions 12 and above.
5534    pub ssl: std::option::Option<crate::model::SslConfig>,
5535
5536    /// Connectivity options used to establish a connection to the database server.
5537    pub connectivity: std::option::Option<crate::model::oracle_connection_profile::Connectivity>,
5538
5539    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5540}
5541
5542impl OracleConnectionProfile {
5543    pub fn new() -> Self {
5544        std::default::Default::default()
5545    }
5546
5547    /// Sets the value of [host][crate::model::OracleConnectionProfile::host].
5548    ///
5549    /// # Example
5550    /// ```ignore,no_run
5551    /// # use google_cloud_clouddms_v1::model::OracleConnectionProfile;
5552    /// let x = OracleConnectionProfile::new().set_host("example");
5553    /// ```
5554    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5555        self.host = v.into();
5556        self
5557    }
5558
5559    /// Sets the value of [port][crate::model::OracleConnectionProfile::port].
5560    ///
5561    /// # Example
5562    /// ```ignore,no_run
5563    /// # use google_cloud_clouddms_v1::model::OracleConnectionProfile;
5564    /// let x = OracleConnectionProfile::new().set_port(42);
5565    /// ```
5566    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5567        self.port = v.into();
5568        self
5569    }
5570
5571    /// Sets the value of [username][crate::model::OracleConnectionProfile::username].
5572    ///
5573    /// # Example
5574    /// ```ignore,no_run
5575    /// # use google_cloud_clouddms_v1::model::OracleConnectionProfile;
5576    /// let x = OracleConnectionProfile::new().set_username("example");
5577    /// ```
5578    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5579        self.username = v.into();
5580        self
5581    }
5582
5583    /// Sets the value of [password][crate::model::OracleConnectionProfile::password].
5584    ///
5585    /// # Example
5586    /// ```ignore,no_run
5587    /// # use google_cloud_clouddms_v1::model::OracleConnectionProfile;
5588    /// let x = OracleConnectionProfile::new().set_password("example");
5589    /// ```
5590    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5591        self.password = v.into();
5592        self
5593    }
5594
5595    /// Sets the value of [password_set][crate::model::OracleConnectionProfile::password_set].
5596    ///
5597    /// # Example
5598    /// ```ignore,no_run
5599    /// # use google_cloud_clouddms_v1::model::OracleConnectionProfile;
5600    /// let x = OracleConnectionProfile::new().set_password_set(true);
5601    /// ```
5602    pub fn set_password_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5603        self.password_set = v.into();
5604        self
5605    }
5606
5607    /// Sets the value of [database_service][crate::model::OracleConnectionProfile::database_service].
5608    ///
5609    /// # Example
5610    /// ```ignore,no_run
5611    /// # use google_cloud_clouddms_v1::model::OracleConnectionProfile;
5612    /// let x = OracleConnectionProfile::new().set_database_service("example");
5613    /// ```
5614    pub fn set_database_service<T: std::convert::Into<std::string::String>>(
5615        mut self,
5616        v: T,
5617    ) -> Self {
5618        self.database_service = v.into();
5619        self
5620    }
5621
5622    /// Sets the value of [ssl][crate::model::OracleConnectionProfile::ssl].
5623    ///
5624    /// # Example
5625    /// ```ignore,no_run
5626    /// # use google_cloud_clouddms_v1::model::OracleConnectionProfile;
5627    /// use google_cloud_clouddms_v1::model::SslConfig;
5628    /// let x = OracleConnectionProfile::new().set_ssl(SslConfig::default()/* use setters */);
5629    /// ```
5630    pub fn set_ssl<T>(mut self, v: T) -> Self
5631    where
5632        T: std::convert::Into<crate::model::SslConfig>,
5633    {
5634        self.ssl = std::option::Option::Some(v.into());
5635        self
5636    }
5637
5638    /// Sets or clears the value of [ssl][crate::model::OracleConnectionProfile::ssl].
5639    ///
5640    /// # Example
5641    /// ```ignore,no_run
5642    /// # use google_cloud_clouddms_v1::model::OracleConnectionProfile;
5643    /// use google_cloud_clouddms_v1::model::SslConfig;
5644    /// let x = OracleConnectionProfile::new().set_or_clear_ssl(Some(SslConfig::default()/* use setters */));
5645    /// let x = OracleConnectionProfile::new().set_or_clear_ssl(None::<SslConfig>);
5646    /// ```
5647    pub fn set_or_clear_ssl<T>(mut self, v: std::option::Option<T>) -> Self
5648    where
5649        T: std::convert::Into<crate::model::SslConfig>,
5650    {
5651        self.ssl = v.map(|x| x.into());
5652        self
5653    }
5654
5655    /// Sets the value of [connectivity][crate::model::OracleConnectionProfile::connectivity].
5656    ///
5657    /// Note that all the setters affecting `connectivity` are mutually
5658    /// exclusive.
5659    ///
5660    /// # Example
5661    /// ```ignore,no_run
5662    /// # use google_cloud_clouddms_v1::model::OracleConnectionProfile;
5663    /// use google_cloud_clouddms_v1::model::StaticServiceIpConnectivity;
5664    /// let x = OracleConnectionProfile::new().set_connectivity(Some(
5665    ///     google_cloud_clouddms_v1::model::oracle_connection_profile::Connectivity::StaticServiceIpConnectivity(StaticServiceIpConnectivity::default().into())));
5666    /// ```
5667    pub fn set_connectivity<
5668        T: std::convert::Into<
5669                std::option::Option<crate::model::oracle_connection_profile::Connectivity>,
5670            >,
5671    >(
5672        mut self,
5673        v: T,
5674    ) -> Self {
5675        self.connectivity = v.into();
5676        self
5677    }
5678
5679    /// The value of [connectivity][crate::model::OracleConnectionProfile::connectivity]
5680    /// if it holds a `StaticServiceIpConnectivity`, `None` if the field is not set or
5681    /// holds a different branch.
5682    pub fn static_service_ip_connectivity(
5683        &self,
5684    ) -> std::option::Option<&std::boxed::Box<crate::model::StaticServiceIpConnectivity>> {
5685        #[allow(unreachable_patterns)]
5686        self.connectivity.as_ref().and_then(|v| match v {
5687            crate::model::oracle_connection_profile::Connectivity::StaticServiceIpConnectivity(
5688                v,
5689            ) => std::option::Option::Some(v),
5690            _ => std::option::Option::None,
5691        })
5692    }
5693
5694    /// Sets the value of [connectivity][crate::model::OracleConnectionProfile::connectivity]
5695    /// to hold a `StaticServiceIpConnectivity`.
5696    ///
5697    /// Note that all the setters affecting `connectivity` are
5698    /// mutually exclusive.
5699    ///
5700    /// # Example
5701    /// ```ignore,no_run
5702    /// # use google_cloud_clouddms_v1::model::OracleConnectionProfile;
5703    /// use google_cloud_clouddms_v1::model::StaticServiceIpConnectivity;
5704    /// let x = OracleConnectionProfile::new().set_static_service_ip_connectivity(StaticServiceIpConnectivity::default()/* use setters */);
5705    /// assert!(x.static_service_ip_connectivity().is_some());
5706    /// assert!(x.forward_ssh_connectivity().is_none());
5707    /// assert!(x.private_connectivity().is_none());
5708    /// ```
5709    pub fn set_static_service_ip_connectivity<
5710        T: std::convert::Into<std::boxed::Box<crate::model::StaticServiceIpConnectivity>>,
5711    >(
5712        mut self,
5713        v: T,
5714    ) -> Self {
5715        self.connectivity = std::option::Option::Some(
5716            crate::model::oracle_connection_profile::Connectivity::StaticServiceIpConnectivity(
5717                v.into(),
5718            ),
5719        );
5720        self
5721    }
5722
5723    /// The value of [connectivity][crate::model::OracleConnectionProfile::connectivity]
5724    /// if it holds a `ForwardSshConnectivity`, `None` if the field is not set or
5725    /// holds a different branch.
5726    pub fn forward_ssh_connectivity(
5727        &self,
5728    ) -> std::option::Option<&std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>> {
5729        #[allow(unreachable_patterns)]
5730        self.connectivity.as_ref().and_then(|v| match v {
5731            crate::model::oracle_connection_profile::Connectivity::ForwardSshConnectivity(v) => {
5732                std::option::Option::Some(v)
5733            }
5734            _ => std::option::Option::None,
5735        })
5736    }
5737
5738    /// Sets the value of [connectivity][crate::model::OracleConnectionProfile::connectivity]
5739    /// to hold a `ForwardSshConnectivity`.
5740    ///
5741    /// Note that all the setters affecting `connectivity` are
5742    /// mutually exclusive.
5743    ///
5744    /// # Example
5745    /// ```ignore,no_run
5746    /// # use google_cloud_clouddms_v1::model::OracleConnectionProfile;
5747    /// use google_cloud_clouddms_v1::model::ForwardSshTunnelConnectivity;
5748    /// let x = OracleConnectionProfile::new().set_forward_ssh_connectivity(ForwardSshTunnelConnectivity::default()/* use setters */);
5749    /// assert!(x.forward_ssh_connectivity().is_some());
5750    /// assert!(x.static_service_ip_connectivity().is_none());
5751    /// assert!(x.private_connectivity().is_none());
5752    /// ```
5753    pub fn set_forward_ssh_connectivity<
5754        T: std::convert::Into<std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>>,
5755    >(
5756        mut self,
5757        v: T,
5758    ) -> Self {
5759        self.connectivity = std::option::Option::Some(
5760            crate::model::oracle_connection_profile::Connectivity::ForwardSshConnectivity(v.into()),
5761        );
5762        self
5763    }
5764
5765    /// The value of [connectivity][crate::model::OracleConnectionProfile::connectivity]
5766    /// if it holds a `PrivateConnectivity`, `None` if the field is not set or
5767    /// holds a different branch.
5768    pub fn private_connectivity(
5769        &self,
5770    ) -> std::option::Option<&std::boxed::Box<crate::model::PrivateConnectivity>> {
5771        #[allow(unreachable_patterns)]
5772        self.connectivity.as_ref().and_then(|v| match v {
5773            crate::model::oracle_connection_profile::Connectivity::PrivateConnectivity(v) => {
5774                std::option::Option::Some(v)
5775            }
5776            _ => std::option::Option::None,
5777        })
5778    }
5779
5780    /// Sets the value of [connectivity][crate::model::OracleConnectionProfile::connectivity]
5781    /// to hold a `PrivateConnectivity`.
5782    ///
5783    /// Note that all the setters affecting `connectivity` are
5784    /// mutually exclusive.
5785    ///
5786    /// # Example
5787    /// ```ignore,no_run
5788    /// # use google_cloud_clouddms_v1::model::OracleConnectionProfile;
5789    /// use google_cloud_clouddms_v1::model::PrivateConnectivity;
5790    /// let x = OracleConnectionProfile::new().set_private_connectivity(PrivateConnectivity::default()/* use setters */);
5791    /// assert!(x.private_connectivity().is_some());
5792    /// assert!(x.static_service_ip_connectivity().is_none());
5793    /// assert!(x.forward_ssh_connectivity().is_none());
5794    /// ```
5795    pub fn set_private_connectivity<
5796        T: std::convert::Into<std::boxed::Box<crate::model::PrivateConnectivity>>,
5797    >(
5798        mut self,
5799        v: T,
5800    ) -> Self {
5801        self.connectivity = std::option::Option::Some(
5802            crate::model::oracle_connection_profile::Connectivity::PrivateConnectivity(v.into()),
5803        );
5804        self
5805    }
5806}
5807
5808impl wkt::message::Message for OracleConnectionProfile {
5809    fn typename() -> &'static str {
5810        "type.googleapis.com/google.cloud.clouddms.v1.OracleConnectionProfile"
5811    }
5812}
5813
5814/// Defines additional types related to [OracleConnectionProfile].
5815pub mod oracle_connection_profile {
5816    #[allow(unused_imports)]
5817    use super::*;
5818
5819    /// Connectivity options used to establish a connection to the database server.
5820    #[derive(Clone, Debug, PartialEq)]
5821    #[non_exhaustive]
5822    pub enum Connectivity {
5823        /// Static Service IP connectivity.
5824        StaticServiceIpConnectivity(std::boxed::Box<crate::model::StaticServiceIpConnectivity>),
5825        /// Forward SSH tunnel connectivity.
5826        ForwardSshConnectivity(std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>),
5827        /// Private connectivity.
5828        PrivateConnectivity(std::boxed::Box<crate::model::PrivateConnectivity>),
5829    }
5830}
5831
5832/// Specifies required connection parameters, and, optionally, the parameters
5833/// required to create a Cloud SQL destination database instance.
5834#[derive(Clone, Default, PartialEq)]
5835#[non_exhaustive]
5836pub struct CloudSqlConnectionProfile {
5837    /// Output only. The Cloud SQL instance ID that this connection profile is
5838    /// associated with.
5839    pub cloud_sql_id: std::string::String,
5840
5841    /// Immutable. Metadata used to create the destination Cloud SQL database.
5842    pub settings: std::option::Option<crate::model::CloudSqlSettings>,
5843
5844    /// Output only. The Cloud SQL database instance's private IP.
5845    pub private_ip: std::string::String,
5846
5847    /// Output only. The Cloud SQL database instance's public IP.
5848    pub public_ip: std::string::String,
5849
5850    /// Output only. The Cloud SQL database instance's additional (outgoing) public
5851    /// IP. Used when the Cloud SQL database availability type is REGIONAL (i.e.
5852    /// multiple zones / highly available).
5853    pub additional_public_ip: std::string::String,
5854
5855    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5856}
5857
5858impl CloudSqlConnectionProfile {
5859    pub fn new() -> Self {
5860        std::default::Default::default()
5861    }
5862
5863    /// Sets the value of [cloud_sql_id][crate::model::CloudSqlConnectionProfile::cloud_sql_id].
5864    ///
5865    /// # Example
5866    /// ```ignore,no_run
5867    /// # use google_cloud_clouddms_v1::model::CloudSqlConnectionProfile;
5868    /// let x = CloudSqlConnectionProfile::new().set_cloud_sql_id("example");
5869    /// ```
5870    pub fn set_cloud_sql_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5871        self.cloud_sql_id = v.into();
5872        self
5873    }
5874
5875    /// Sets the value of [settings][crate::model::CloudSqlConnectionProfile::settings].
5876    ///
5877    /// # Example
5878    /// ```ignore,no_run
5879    /// # use google_cloud_clouddms_v1::model::CloudSqlConnectionProfile;
5880    /// use google_cloud_clouddms_v1::model::CloudSqlSettings;
5881    /// let x = CloudSqlConnectionProfile::new().set_settings(CloudSqlSettings::default()/* use setters */);
5882    /// ```
5883    pub fn set_settings<T>(mut self, v: T) -> Self
5884    where
5885        T: std::convert::Into<crate::model::CloudSqlSettings>,
5886    {
5887        self.settings = std::option::Option::Some(v.into());
5888        self
5889    }
5890
5891    /// Sets or clears the value of [settings][crate::model::CloudSqlConnectionProfile::settings].
5892    ///
5893    /// # Example
5894    /// ```ignore,no_run
5895    /// # use google_cloud_clouddms_v1::model::CloudSqlConnectionProfile;
5896    /// use google_cloud_clouddms_v1::model::CloudSqlSettings;
5897    /// let x = CloudSqlConnectionProfile::new().set_or_clear_settings(Some(CloudSqlSettings::default()/* use setters */));
5898    /// let x = CloudSqlConnectionProfile::new().set_or_clear_settings(None::<CloudSqlSettings>);
5899    /// ```
5900    pub fn set_or_clear_settings<T>(mut self, v: std::option::Option<T>) -> Self
5901    where
5902        T: std::convert::Into<crate::model::CloudSqlSettings>,
5903    {
5904        self.settings = v.map(|x| x.into());
5905        self
5906    }
5907
5908    /// Sets the value of [private_ip][crate::model::CloudSqlConnectionProfile::private_ip].
5909    ///
5910    /// # Example
5911    /// ```ignore,no_run
5912    /// # use google_cloud_clouddms_v1::model::CloudSqlConnectionProfile;
5913    /// let x = CloudSqlConnectionProfile::new().set_private_ip("example");
5914    /// ```
5915    pub fn set_private_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5916        self.private_ip = v.into();
5917        self
5918    }
5919
5920    /// Sets the value of [public_ip][crate::model::CloudSqlConnectionProfile::public_ip].
5921    ///
5922    /// # Example
5923    /// ```ignore,no_run
5924    /// # use google_cloud_clouddms_v1::model::CloudSqlConnectionProfile;
5925    /// let x = CloudSqlConnectionProfile::new().set_public_ip("example");
5926    /// ```
5927    pub fn set_public_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5928        self.public_ip = v.into();
5929        self
5930    }
5931
5932    /// Sets the value of [additional_public_ip][crate::model::CloudSqlConnectionProfile::additional_public_ip].
5933    ///
5934    /// # Example
5935    /// ```ignore,no_run
5936    /// # use google_cloud_clouddms_v1::model::CloudSqlConnectionProfile;
5937    /// let x = CloudSqlConnectionProfile::new().set_additional_public_ip("example");
5938    /// ```
5939    pub fn set_additional_public_ip<T: std::convert::Into<std::string::String>>(
5940        mut self,
5941        v: T,
5942    ) -> Self {
5943        self.additional_public_ip = v.into();
5944        self
5945    }
5946}
5947
5948impl wkt::message::Message for CloudSqlConnectionProfile {
5949    fn typename() -> &'static str {
5950        "type.googleapis.com/google.cloud.clouddms.v1.CloudSqlConnectionProfile"
5951    }
5952}
5953
5954/// Specifies required connection parameters, and the parameters
5955/// required to create an AlloyDB destination cluster.
5956#[derive(Clone, Default, PartialEq)]
5957#[non_exhaustive]
5958pub struct AlloyDbConnectionProfile {
5959    /// Required. The AlloyDB cluster ID that this connection profile is associated
5960    /// with.
5961    pub cluster_id: std::string::String,
5962
5963    /// Immutable. Metadata used to create the destination AlloyDB cluster.
5964    pub settings: std::option::Option<crate::model::AlloyDbSettings>,
5965
5966    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5967}
5968
5969impl AlloyDbConnectionProfile {
5970    pub fn new() -> Self {
5971        std::default::Default::default()
5972    }
5973
5974    /// Sets the value of [cluster_id][crate::model::AlloyDbConnectionProfile::cluster_id].
5975    ///
5976    /// # Example
5977    /// ```ignore,no_run
5978    /// # use google_cloud_clouddms_v1::model::AlloyDbConnectionProfile;
5979    /// let x = AlloyDbConnectionProfile::new().set_cluster_id("example");
5980    /// ```
5981    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5982        self.cluster_id = v.into();
5983        self
5984    }
5985
5986    /// Sets the value of [settings][crate::model::AlloyDbConnectionProfile::settings].
5987    ///
5988    /// # Example
5989    /// ```ignore,no_run
5990    /// # use google_cloud_clouddms_v1::model::AlloyDbConnectionProfile;
5991    /// use google_cloud_clouddms_v1::model::AlloyDbSettings;
5992    /// let x = AlloyDbConnectionProfile::new().set_settings(AlloyDbSettings::default()/* use setters */);
5993    /// ```
5994    pub fn set_settings<T>(mut self, v: T) -> Self
5995    where
5996        T: std::convert::Into<crate::model::AlloyDbSettings>,
5997    {
5998        self.settings = std::option::Option::Some(v.into());
5999        self
6000    }
6001
6002    /// Sets or clears the value of [settings][crate::model::AlloyDbConnectionProfile::settings].
6003    ///
6004    /// # Example
6005    /// ```ignore,no_run
6006    /// # use google_cloud_clouddms_v1::model::AlloyDbConnectionProfile;
6007    /// use google_cloud_clouddms_v1::model::AlloyDbSettings;
6008    /// let x = AlloyDbConnectionProfile::new().set_or_clear_settings(Some(AlloyDbSettings::default()/* use setters */));
6009    /// let x = AlloyDbConnectionProfile::new().set_or_clear_settings(None::<AlloyDbSettings>);
6010    /// ```
6011    pub fn set_or_clear_settings<T>(mut self, v: std::option::Option<T>) -> Self
6012    where
6013        T: std::convert::Into<crate::model::AlloyDbSettings>,
6014    {
6015        self.settings = v.map(|x| x.into());
6016        self
6017    }
6018}
6019
6020impl wkt::message::Message for AlloyDbConnectionProfile {
6021    fn typename() -> &'static str {
6022        "type.googleapis.com/google.cloud.clouddms.v1.AlloyDbConnectionProfile"
6023    }
6024}
6025
6026/// An entry for an Access Control list.
6027#[derive(Clone, Default, PartialEq)]
6028#[non_exhaustive]
6029pub struct SqlAclEntry {
6030    /// The allowlisted value for the access control list.
6031    pub value: std::string::String,
6032
6033    /// A label to identify this entry.
6034    pub label: std::string::String,
6035
6036    /// The access control entry entry expiration.
6037    pub expiration: std::option::Option<crate::model::sql_acl_entry::Expiration>,
6038
6039    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6040}
6041
6042impl SqlAclEntry {
6043    pub fn new() -> Self {
6044        std::default::Default::default()
6045    }
6046
6047    /// Sets the value of [value][crate::model::SqlAclEntry::value].
6048    ///
6049    /// # Example
6050    /// ```ignore,no_run
6051    /// # use google_cloud_clouddms_v1::model::SqlAclEntry;
6052    /// let x = SqlAclEntry::new().set_value("example");
6053    /// ```
6054    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6055        self.value = v.into();
6056        self
6057    }
6058
6059    /// Sets the value of [label][crate::model::SqlAclEntry::label].
6060    ///
6061    /// # Example
6062    /// ```ignore,no_run
6063    /// # use google_cloud_clouddms_v1::model::SqlAclEntry;
6064    /// let x = SqlAclEntry::new().set_label("example");
6065    /// ```
6066    pub fn set_label<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6067        self.label = v.into();
6068        self
6069    }
6070
6071    /// Sets the value of [expiration][crate::model::SqlAclEntry::expiration].
6072    ///
6073    /// Note that all the setters affecting `expiration` are mutually
6074    /// exclusive.
6075    ///
6076    /// # Example
6077    /// ```ignore,no_run
6078    /// # use google_cloud_clouddms_v1::model::SqlAclEntry;
6079    /// use wkt::Timestamp;
6080    /// let x = SqlAclEntry::new().set_expiration(Some(
6081    ///     google_cloud_clouddms_v1::model::sql_acl_entry::Expiration::ExpireTime(Timestamp::default().into())));
6082    /// ```
6083    pub fn set_expiration<
6084        T: std::convert::Into<std::option::Option<crate::model::sql_acl_entry::Expiration>>,
6085    >(
6086        mut self,
6087        v: T,
6088    ) -> Self {
6089        self.expiration = v.into();
6090        self
6091    }
6092
6093    /// The value of [expiration][crate::model::SqlAclEntry::expiration]
6094    /// if it holds a `ExpireTime`, `None` if the field is not set or
6095    /// holds a different branch.
6096    pub fn expire_time(&self) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
6097        #[allow(unreachable_patterns)]
6098        self.expiration.as_ref().and_then(|v| match v {
6099            crate::model::sql_acl_entry::Expiration::ExpireTime(v) => std::option::Option::Some(v),
6100            _ => std::option::Option::None,
6101        })
6102    }
6103
6104    /// Sets the value of [expiration][crate::model::SqlAclEntry::expiration]
6105    /// to hold a `ExpireTime`.
6106    ///
6107    /// Note that all the setters affecting `expiration` are
6108    /// mutually exclusive.
6109    ///
6110    /// # Example
6111    /// ```ignore,no_run
6112    /// # use google_cloud_clouddms_v1::model::SqlAclEntry;
6113    /// use wkt::Timestamp;
6114    /// let x = SqlAclEntry::new().set_expire_time(Timestamp::default()/* use setters */);
6115    /// assert!(x.expire_time().is_some());
6116    /// assert!(x.ttl().is_none());
6117    /// ```
6118    pub fn set_expire_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
6119        mut self,
6120        v: T,
6121    ) -> Self {
6122        self.expiration = std::option::Option::Some(
6123            crate::model::sql_acl_entry::Expiration::ExpireTime(v.into()),
6124        );
6125        self
6126    }
6127
6128    /// The value of [expiration][crate::model::SqlAclEntry::expiration]
6129    /// if it holds a `Ttl`, `None` if the field is not set or
6130    /// holds a different branch.
6131    pub fn ttl(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
6132        #[allow(unreachable_patterns)]
6133        self.expiration.as_ref().and_then(|v| match v {
6134            crate::model::sql_acl_entry::Expiration::Ttl(v) => std::option::Option::Some(v),
6135            _ => std::option::Option::None,
6136        })
6137    }
6138
6139    /// Sets the value of [expiration][crate::model::SqlAclEntry::expiration]
6140    /// to hold a `Ttl`.
6141    ///
6142    /// Note that all the setters affecting `expiration` are
6143    /// mutually exclusive.
6144    ///
6145    /// # Example
6146    /// ```ignore,no_run
6147    /// # use google_cloud_clouddms_v1::model::SqlAclEntry;
6148    /// use wkt::Duration;
6149    /// let x = SqlAclEntry::new().set_ttl(Duration::default()/* use setters */);
6150    /// assert!(x.ttl().is_some());
6151    /// assert!(x.expire_time().is_none());
6152    /// ```
6153    pub fn set_ttl<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(mut self, v: T) -> Self {
6154        self.expiration =
6155            std::option::Option::Some(crate::model::sql_acl_entry::Expiration::Ttl(v.into()));
6156        self
6157    }
6158}
6159
6160impl wkt::message::Message for SqlAclEntry {
6161    fn typename() -> &'static str {
6162        "type.googleapis.com/google.cloud.clouddms.v1.SqlAclEntry"
6163    }
6164}
6165
6166/// Defines additional types related to [SqlAclEntry].
6167pub mod sql_acl_entry {
6168    #[allow(unused_imports)]
6169    use super::*;
6170
6171    /// The access control entry entry expiration.
6172    #[derive(Clone, Debug, PartialEq)]
6173    #[non_exhaustive]
6174    pub enum Expiration {
6175        /// The time when this access control entry expires in
6176        /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example:
6177        /// `2012-11-15T16:19:00.094Z`.
6178        ExpireTime(std::boxed::Box<wkt::Timestamp>),
6179        /// Input only. The time-to-leave of this access control entry.
6180        Ttl(std::boxed::Box<wkt::Duration>),
6181    }
6182}
6183
6184/// IP Management configuration.
6185#[derive(Clone, Default, PartialEq)]
6186#[non_exhaustive]
6187pub struct SqlIpConfig {
6188    /// Whether the instance should be assigned an IPv4 address or not.
6189    pub enable_ipv4: std::option::Option<wkt::BoolValue>,
6190
6191    /// The resource link for the VPC network from which the Cloud SQL instance is
6192    /// accessible for private IP. For example,
6193    /// `projects/myProject/global/networks/default`. This setting can
6194    /// be updated, but it cannot be removed after it is set.
6195    pub private_network: std::string::String,
6196
6197    /// Optional. The name of the allocated IP address range for the private IP
6198    /// Cloud SQL instance. This name refers to an already allocated IP range
6199    /// address. If set, the instance IP address will be created in the allocated
6200    /// range. Note that this IP address range can't be modified after the instance
6201    /// is created. If you change the VPC when configuring connectivity settings
6202    /// for the migration job, this field is not relevant.
6203    pub allocated_ip_range: std::string::String,
6204
6205    /// Whether SSL connections over IP should be enforced or not.
6206    pub require_ssl: std::option::Option<wkt::BoolValue>,
6207
6208    /// The list of external networks that are allowed to connect to the instance
6209    /// using the IP. See
6210    /// <https://en.wikipedia.org/wiki/CIDR_notation#CIDR_notation>, also known as
6211    /// 'slash' notation (e.g. `192.168.100.0/24`).
6212    pub authorized_networks: std::vec::Vec<crate::model::SqlAclEntry>,
6213
6214    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6215}
6216
6217impl SqlIpConfig {
6218    pub fn new() -> Self {
6219        std::default::Default::default()
6220    }
6221
6222    /// Sets the value of [enable_ipv4][crate::model::SqlIpConfig::enable_ipv4].
6223    ///
6224    /// # Example
6225    /// ```ignore,no_run
6226    /// # use google_cloud_clouddms_v1::model::SqlIpConfig;
6227    /// use wkt::BoolValue;
6228    /// let x = SqlIpConfig::new().set_enable_ipv4(BoolValue::default()/* use setters */);
6229    /// ```
6230    pub fn set_enable_ipv4<T>(mut self, v: T) -> Self
6231    where
6232        T: std::convert::Into<wkt::BoolValue>,
6233    {
6234        self.enable_ipv4 = std::option::Option::Some(v.into());
6235        self
6236    }
6237
6238    /// Sets or clears the value of [enable_ipv4][crate::model::SqlIpConfig::enable_ipv4].
6239    ///
6240    /// # Example
6241    /// ```ignore,no_run
6242    /// # use google_cloud_clouddms_v1::model::SqlIpConfig;
6243    /// use wkt::BoolValue;
6244    /// let x = SqlIpConfig::new().set_or_clear_enable_ipv4(Some(BoolValue::default()/* use setters */));
6245    /// let x = SqlIpConfig::new().set_or_clear_enable_ipv4(None::<BoolValue>);
6246    /// ```
6247    pub fn set_or_clear_enable_ipv4<T>(mut self, v: std::option::Option<T>) -> Self
6248    where
6249        T: std::convert::Into<wkt::BoolValue>,
6250    {
6251        self.enable_ipv4 = v.map(|x| x.into());
6252        self
6253    }
6254
6255    /// Sets the value of [private_network][crate::model::SqlIpConfig::private_network].
6256    ///
6257    /// # Example
6258    /// ```ignore,no_run
6259    /// # use google_cloud_clouddms_v1::model::SqlIpConfig;
6260    /// let x = SqlIpConfig::new().set_private_network("example");
6261    /// ```
6262    pub fn set_private_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6263        self.private_network = v.into();
6264        self
6265    }
6266
6267    /// Sets the value of [allocated_ip_range][crate::model::SqlIpConfig::allocated_ip_range].
6268    ///
6269    /// # Example
6270    /// ```ignore,no_run
6271    /// # use google_cloud_clouddms_v1::model::SqlIpConfig;
6272    /// let x = SqlIpConfig::new().set_allocated_ip_range("example");
6273    /// ```
6274    pub fn set_allocated_ip_range<T: std::convert::Into<std::string::String>>(
6275        mut self,
6276        v: T,
6277    ) -> Self {
6278        self.allocated_ip_range = v.into();
6279        self
6280    }
6281
6282    /// Sets the value of [require_ssl][crate::model::SqlIpConfig::require_ssl].
6283    ///
6284    /// # Example
6285    /// ```ignore,no_run
6286    /// # use google_cloud_clouddms_v1::model::SqlIpConfig;
6287    /// use wkt::BoolValue;
6288    /// let x = SqlIpConfig::new().set_require_ssl(BoolValue::default()/* use setters */);
6289    /// ```
6290    pub fn set_require_ssl<T>(mut self, v: T) -> Self
6291    where
6292        T: std::convert::Into<wkt::BoolValue>,
6293    {
6294        self.require_ssl = std::option::Option::Some(v.into());
6295        self
6296    }
6297
6298    /// Sets or clears the value of [require_ssl][crate::model::SqlIpConfig::require_ssl].
6299    ///
6300    /// # Example
6301    /// ```ignore,no_run
6302    /// # use google_cloud_clouddms_v1::model::SqlIpConfig;
6303    /// use wkt::BoolValue;
6304    /// let x = SqlIpConfig::new().set_or_clear_require_ssl(Some(BoolValue::default()/* use setters */));
6305    /// let x = SqlIpConfig::new().set_or_clear_require_ssl(None::<BoolValue>);
6306    /// ```
6307    pub fn set_or_clear_require_ssl<T>(mut self, v: std::option::Option<T>) -> Self
6308    where
6309        T: std::convert::Into<wkt::BoolValue>,
6310    {
6311        self.require_ssl = v.map(|x| x.into());
6312        self
6313    }
6314
6315    /// Sets the value of [authorized_networks][crate::model::SqlIpConfig::authorized_networks].
6316    ///
6317    /// # Example
6318    /// ```ignore,no_run
6319    /// # use google_cloud_clouddms_v1::model::SqlIpConfig;
6320    /// use google_cloud_clouddms_v1::model::SqlAclEntry;
6321    /// let x = SqlIpConfig::new()
6322    ///     .set_authorized_networks([
6323    ///         SqlAclEntry::default()/* use setters */,
6324    ///         SqlAclEntry::default()/* use (different) setters */,
6325    ///     ]);
6326    /// ```
6327    pub fn set_authorized_networks<T, V>(mut self, v: T) -> Self
6328    where
6329        T: std::iter::IntoIterator<Item = V>,
6330        V: std::convert::Into<crate::model::SqlAclEntry>,
6331    {
6332        use std::iter::Iterator;
6333        self.authorized_networks = v.into_iter().map(|i| i.into()).collect();
6334        self
6335    }
6336}
6337
6338impl wkt::message::Message for SqlIpConfig {
6339    fn typename() -> &'static str {
6340        "type.googleapis.com/google.cloud.clouddms.v1.SqlIpConfig"
6341    }
6342}
6343
6344/// Settings for creating a Cloud SQL database instance.
6345#[derive(Clone, Default, PartialEq)]
6346#[non_exhaustive]
6347pub struct CloudSqlSettings {
6348    /// The database engine type and version.
6349    pub database_version: crate::model::cloud_sql_settings::SqlDatabaseVersion,
6350
6351    /// The resource labels for a Cloud SQL instance to use to annotate any related
6352    /// underlying resources such as Compute Engine VMs.
6353    /// An object containing a list of "key": "value" pairs.
6354    ///
6355    /// Example: `{ "name": "wrench", "mass": "18kg", "count": "3" }`.
6356    pub user_labels: std::collections::HashMap<std::string::String, std::string::String>,
6357
6358    /// The tier (or machine type) for this instance, for example:
6359    /// `db-n1-standard-1` (MySQL instances) or
6360    /// `db-custom-1-3840` (PostgreSQL instances).
6361    /// For more information, see
6362    /// [Cloud SQL Instance
6363    /// Settings](https://cloud.google.com/sql/docs/mysql/instance-settings).
6364    pub tier: std::string::String,
6365
6366    /// The maximum size to which storage capacity can be automatically increased.
6367    /// The default value is 0, which specifies that there is no limit.
6368    pub storage_auto_resize_limit: std::option::Option<wkt::Int64Value>,
6369
6370    /// The activation policy specifies when the instance is activated; it is
6371    /// applicable only when the instance state is 'RUNNABLE'. Valid values:
6372    ///
6373    /// 'ALWAYS': The instance is on, and remains so even in
6374    /// the absence of connection requests.
6375    ///
6376    /// `NEVER`: The instance is off; it is not activated, even if a
6377    /// connection request arrives.
6378    pub activation_policy: crate::model::cloud_sql_settings::SqlActivationPolicy,
6379
6380    /// The settings for IP Management. This allows to enable or disable the
6381    /// instance IP and manage which external networks can connect to the instance.
6382    /// The IPv4 address cannot be disabled.
6383    pub ip_config: std::option::Option<crate::model::SqlIpConfig>,
6384
6385    /// [default: ON] If you enable this setting, Cloud SQL checks your available
6386    /// storage every 30 seconds. If the available storage falls below a threshold
6387    /// size, Cloud SQL automatically adds additional storage capacity. If the
6388    /// available storage repeatedly falls below the threshold size, Cloud SQL
6389    /// continues to add storage until it reaches the maximum of 30 TB.
6390    pub auto_storage_increase: std::option::Option<wkt::BoolValue>,
6391
6392    /// The database flags passed to the Cloud SQL instance at startup.
6393    /// An object containing a list of "key": value pairs.
6394    /// Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
6395    pub database_flags: std::collections::HashMap<std::string::String, std::string::String>,
6396
6397    /// The type of storage: `PD_SSD` (default) or `PD_HDD`.
6398    pub data_disk_type: crate::model::cloud_sql_settings::SqlDataDiskType,
6399
6400    /// The storage capacity available to the database, in GB.
6401    /// The minimum (and default) size is 10GB.
6402    pub data_disk_size_gb: std::option::Option<wkt::Int64Value>,
6403
6404    /// The Google Cloud Platform zone where your Cloud SQL database instance is
6405    /// located.
6406    pub zone: std::string::String,
6407
6408    /// Optional. The Google Cloud Platform zone where the failover Cloud SQL
6409    /// database instance is located. Used when the Cloud SQL database availability
6410    /// type is REGIONAL (i.e. multiple zones / highly available).
6411    pub secondary_zone: std::string::String,
6412
6413    /// The Database Migration Service source connection profile ID,
6414    /// in the format:
6415    /// `projects/my_project_name/locations/us-central1/connectionProfiles/connection_profile_ID`
6416    pub source_id: std::string::String,
6417
6418    /// Input only. Initial root password.
6419    pub root_password: std::string::String,
6420
6421    /// Output only. Indicates If this connection profile root password is stored.
6422    pub root_password_set: bool,
6423
6424    /// The Cloud SQL default instance level collation.
6425    pub collation: std::string::String,
6426
6427    /// The KMS key name used for the csql instance.
6428    pub cmek_key_name: std::string::String,
6429
6430    /// Optional. Availability type. Potential values:
6431    ///
6432    /// * `ZONAL`: The instance serves data from only one zone. Outages in that
6433    ///   zone affect data availability.
6434    /// * `REGIONAL`: The instance can serve data from more than one zone in a
6435    ///   region (it is highly available).
6436    pub availability_type: crate::model::cloud_sql_settings::SqlAvailabilityType,
6437
6438    /// Optional. The edition of the given Cloud SQL instance.
6439    pub edition: crate::model::cloud_sql_settings::Edition,
6440
6441    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6442}
6443
6444impl CloudSqlSettings {
6445    pub fn new() -> Self {
6446        std::default::Default::default()
6447    }
6448
6449    /// Sets the value of [database_version][crate::model::CloudSqlSettings::database_version].
6450    ///
6451    /// # Example
6452    /// ```ignore,no_run
6453    /// # use google_cloud_clouddms_v1::model::CloudSqlSettings;
6454    /// use google_cloud_clouddms_v1::model::cloud_sql_settings::SqlDatabaseVersion;
6455    /// let x0 = CloudSqlSettings::new().set_database_version(SqlDatabaseVersion::Mysql56);
6456    /// let x1 = CloudSqlSettings::new().set_database_version(SqlDatabaseVersion::Mysql57);
6457    /// let x2 = CloudSqlSettings::new().set_database_version(SqlDatabaseVersion::Postgres96);
6458    /// ```
6459    pub fn set_database_version<
6460        T: std::convert::Into<crate::model::cloud_sql_settings::SqlDatabaseVersion>,
6461    >(
6462        mut self,
6463        v: T,
6464    ) -> Self {
6465        self.database_version = v.into();
6466        self
6467    }
6468
6469    /// Sets the value of [user_labels][crate::model::CloudSqlSettings::user_labels].
6470    ///
6471    /// # Example
6472    /// ```ignore,no_run
6473    /// # use google_cloud_clouddms_v1::model::CloudSqlSettings;
6474    /// let x = CloudSqlSettings::new().set_user_labels([
6475    ///     ("key0", "abc"),
6476    ///     ("key1", "xyz"),
6477    /// ]);
6478    /// ```
6479    pub fn set_user_labels<T, K, V>(mut self, v: T) -> Self
6480    where
6481        T: std::iter::IntoIterator<Item = (K, V)>,
6482        K: std::convert::Into<std::string::String>,
6483        V: std::convert::Into<std::string::String>,
6484    {
6485        use std::iter::Iterator;
6486        self.user_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6487        self
6488    }
6489
6490    /// Sets the value of [tier][crate::model::CloudSqlSettings::tier].
6491    ///
6492    /// # Example
6493    /// ```ignore,no_run
6494    /// # use google_cloud_clouddms_v1::model::CloudSqlSettings;
6495    /// let x = CloudSqlSettings::new().set_tier("example");
6496    /// ```
6497    pub fn set_tier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6498        self.tier = v.into();
6499        self
6500    }
6501
6502    /// Sets the value of [storage_auto_resize_limit][crate::model::CloudSqlSettings::storage_auto_resize_limit].
6503    ///
6504    /// # Example
6505    /// ```ignore,no_run
6506    /// # use google_cloud_clouddms_v1::model::CloudSqlSettings;
6507    /// use wkt::Int64Value;
6508    /// let x = CloudSqlSettings::new().set_storage_auto_resize_limit(Int64Value::default()/* use setters */);
6509    /// ```
6510    pub fn set_storage_auto_resize_limit<T>(mut self, v: T) -> Self
6511    where
6512        T: std::convert::Into<wkt::Int64Value>,
6513    {
6514        self.storage_auto_resize_limit = std::option::Option::Some(v.into());
6515        self
6516    }
6517
6518    /// Sets or clears the value of [storage_auto_resize_limit][crate::model::CloudSqlSettings::storage_auto_resize_limit].
6519    ///
6520    /// # Example
6521    /// ```ignore,no_run
6522    /// # use google_cloud_clouddms_v1::model::CloudSqlSettings;
6523    /// use wkt::Int64Value;
6524    /// let x = CloudSqlSettings::new().set_or_clear_storage_auto_resize_limit(Some(Int64Value::default()/* use setters */));
6525    /// let x = CloudSqlSettings::new().set_or_clear_storage_auto_resize_limit(None::<Int64Value>);
6526    /// ```
6527    pub fn set_or_clear_storage_auto_resize_limit<T>(mut self, v: std::option::Option<T>) -> Self
6528    where
6529        T: std::convert::Into<wkt::Int64Value>,
6530    {
6531        self.storage_auto_resize_limit = v.map(|x| x.into());
6532        self
6533    }
6534
6535    /// Sets the value of [activation_policy][crate::model::CloudSqlSettings::activation_policy].
6536    ///
6537    /// # Example
6538    /// ```ignore,no_run
6539    /// # use google_cloud_clouddms_v1::model::CloudSqlSettings;
6540    /// use google_cloud_clouddms_v1::model::cloud_sql_settings::SqlActivationPolicy;
6541    /// let x0 = CloudSqlSettings::new().set_activation_policy(SqlActivationPolicy::Always);
6542    /// let x1 = CloudSqlSettings::new().set_activation_policy(SqlActivationPolicy::Never);
6543    /// ```
6544    pub fn set_activation_policy<
6545        T: std::convert::Into<crate::model::cloud_sql_settings::SqlActivationPolicy>,
6546    >(
6547        mut self,
6548        v: T,
6549    ) -> Self {
6550        self.activation_policy = v.into();
6551        self
6552    }
6553
6554    /// Sets the value of [ip_config][crate::model::CloudSqlSettings::ip_config].
6555    ///
6556    /// # Example
6557    /// ```ignore,no_run
6558    /// # use google_cloud_clouddms_v1::model::CloudSqlSettings;
6559    /// use google_cloud_clouddms_v1::model::SqlIpConfig;
6560    /// let x = CloudSqlSettings::new().set_ip_config(SqlIpConfig::default()/* use setters */);
6561    /// ```
6562    pub fn set_ip_config<T>(mut self, v: T) -> Self
6563    where
6564        T: std::convert::Into<crate::model::SqlIpConfig>,
6565    {
6566        self.ip_config = std::option::Option::Some(v.into());
6567        self
6568    }
6569
6570    /// Sets or clears the value of [ip_config][crate::model::CloudSqlSettings::ip_config].
6571    ///
6572    /// # Example
6573    /// ```ignore,no_run
6574    /// # use google_cloud_clouddms_v1::model::CloudSqlSettings;
6575    /// use google_cloud_clouddms_v1::model::SqlIpConfig;
6576    /// let x = CloudSqlSettings::new().set_or_clear_ip_config(Some(SqlIpConfig::default()/* use setters */));
6577    /// let x = CloudSqlSettings::new().set_or_clear_ip_config(None::<SqlIpConfig>);
6578    /// ```
6579    pub fn set_or_clear_ip_config<T>(mut self, v: std::option::Option<T>) -> Self
6580    where
6581        T: std::convert::Into<crate::model::SqlIpConfig>,
6582    {
6583        self.ip_config = v.map(|x| x.into());
6584        self
6585    }
6586
6587    /// Sets the value of [auto_storage_increase][crate::model::CloudSqlSettings::auto_storage_increase].
6588    ///
6589    /// # Example
6590    /// ```ignore,no_run
6591    /// # use google_cloud_clouddms_v1::model::CloudSqlSettings;
6592    /// use wkt::BoolValue;
6593    /// let x = CloudSqlSettings::new().set_auto_storage_increase(BoolValue::default()/* use setters */);
6594    /// ```
6595    pub fn set_auto_storage_increase<T>(mut self, v: T) -> Self
6596    where
6597        T: std::convert::Into<wkt::BoolValue>,
6598    {
6599        self.auto_storage_increase = std::option::Option::Some(v.into());
6600        self
6601    }
6602
6603    /// Sets or clears the value of [auto_storage_increase][crate::model::CloudSqlSettings::auto_storage_increase].
6604    ///
6605    /// # Example
6606    /// ```ignore,no_run
6607    /// # use google_cloud_clouddms_v1::model::CloudSqlSettings;
6608    /// use wkt::BoolValue;
6609    /// let x = CloudSqlSettings::new().set_or_clear_auto_storage_increase(Some(BoolValue::default()/* use setters */));
6610    /// let x = CloudSqlSettings::new().set_or_clear_auto_storage_increase(None::<BoolValue>);
6611    /// ```
6612    pub fn set_or_clear_auto_storage_increase<T>(mut self, v: std::option::Option<T>) -> Self
6613    where
6614        T: std::convert::Into<wkt::BoolValue>,
6615    {
6616        self.auto_storage_increase = v.map(|x| x.into());
6617        self
6618    }
6619
6620    /// Sets the value of [database_flags][crate::model::CloudSqlSettings::database_flags].
6621    ///
6622    /// # Example
6623    /// ```ignore,no_run
6624    /// # use google_cloud_clouddms_v1::model::CloudSqlSettings;
6625    /// let x = CloudSqlSettings::new().set_database_flags([
6626    ///     ("key0", "abc"),
6627    ///     ("key1", "xyz"),
6628    /// ]);
6629    /// ```
6630    pub fn set_database_flags<T, K, V>(mut self, v: T) -> Self
6631    where
6632        T: std::iter::IntoIterator<Item = (K, V)>,
6633        K: std::convert::Into<std::string::String>,
6634        V: std::convert::Into<std::string::String>,
6635    {
6636        use std::iter::Iterator;
6637        self.database_flags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6638        self
6639    }
6640
6641    /// Sets the value of [data_disk_type][crate::model::CloudSqlSettings::data_disk_type].
6642    ///
6643    /// # Example
6644    /// ```ignore,no_run
6645    /// # use google_cloud_clouddms_v1::model::CloudSqlSettings;
6646    /// use google_cloud_clouddms_v1::model::cloud_sql_settings::SqlDataDiskType;
6647    /// let x0 = CloudSqlSettings::new().set_data_disk_type(SqlDataDiskType::PdSsd);
6648    /// let x1 = CloudSqlSettings::new().set_data_disk_type(SqlDataDiskType::PdHdd);
6649    /// ```
6650    pub fn set_data_disk_type<
6651        T: std::convert::Into<crate::model::cloud_sql_settings::SqlDataDiskType>,
6652    >(
6653        mut self,
6654        v: T,
6655    ) -> Self {
6656        self.data_disk_type = v.into();
6657        self
6658    }
6659
6660    /// Sets the value of [data_disk_size_gb][crate::model::CloudSqlSettings::data_disk_size_gb].
6661    ///
6662    /// # Example
6663    /// ```ignore,no_run
6664    /// # use google_cloud_clouddms_v1::model::CloudSqlSettings;
6665    /// use wkt::Int64Value;
6666    /// let x = CloudSqlSettings::new().set_data_disk_size_gb(Int64Value::default()/* use setters */);
6667    /// ```
6668    pub fn set_data_disk_size_gb<T>(mut self, v: T) -> Self
6669    where
6670        T: std::convert::Into<wkt::Int64Value>,
6671    {
6672        self.data_disk_size_gb = std::option::Option::Some(v.into());
6673        self
6674    }
6675
6676    /// Sets or clears the value of [data_disk_size_gb][crate::model::CloudSqlSettings::data_disk_size_gb].
6677    ///
6678    /// # Example
6679    /// ```ignore,no_run
6680    /// # use google_cloud_clouddms_v1::model::CloudSqlSettings;
6681    /// use wkt::Int64Value;
6682    /// let x = CloudSqlSettings::new().set_or_clear_data_disk_size_gb(Some(Int64Value::default()/* use setters */));
6683    /// let x = CloudSqlSettings::new().set_or_clear_data_disk_size_gb(None::<Int64Value>);
6684    /// ```
6685    pub fn set_or_clear_data_disk_size_gb<T>(mut self, v: std::option::Option<T>) -> Self
6686    where
6687        T: std::convert::Into<wkt::Int64Value>,
6688    {
6689        self.data_disk_size_gb = v.map(|x| x.into());
6690        self
6691    }
6692
6693    /// Sets the value of [zone][crate::model::CloudSqlSettings::zone].
6694    ///
6695    /// # Example
6696    /// ```ignore,no_run
6697    /// # use google_cloud_clouddms_v1::model::CloudSqlSettings;
6698    /// let x = CloudSqlSettings::new().set_zone("example");
6699    /// ```
6700    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6701        self.zone = v.into();
6702        self
6703    }
6704
6705    /// Sets the value of [secondary_zone][crate::model::CloudSqlSettings::secondary_zone].
6706    ///
6707    /// # Example
6708    /// ```ignore,no_run
6709    /// # use google_cloud_clouddms_v1::model::CloudSqlSettings;
6710    /// let x = CloudSqlSettings::new().set_secondary_zone("example");
6711    /// ```
6712    pub fn set_secondary_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6713        self.secondary_zone = v.into();
6714        self
6715    }
6716
6717    /// Sets the value of [source_id][crate::model::CloudSqlSettings::source_id].
6718    ///
6719    /// # Example
6720    /// ```ignore,no_run
6721    /// # use google_cloud_clouddms_v1::model::CloudSqlSettings;
6722    /// let x = CloudSqlSettings::new().set_source_id("example");
6723    /// ```
6724    pub fn set_source_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6725        self.source_id = v.into();
6726        self
6727    }
6728
6729    /// Sets the value of [root_password][crate::model::CloudSqlSettings::root_password].
6730    ///
6731    /// # Example
6732    /// ```ignore,no_run
6733    /// # use google_cloud_clouddms_v1::model::CloudSqlSettings;
6734    /// let x = CloudSqlSettings::new().set_root_password("example");
6735    /// ```
6736    pub fn set_root_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6737        self.root_password = v.into();
6738        self
6739    }
6740
6741    /// Sets the value of [root_password_set][crate::model::CloudSqlSettings::root_password_set].
6742    ///
6743    /// # Example
6744    /// ```ignore,no_run
6745    /// # use google_cloud_clouddms_v1::model::CloudSqlSettings;
6746    /// let x = CloudSqlSettings::new().set_root_password_set(true);
6747    /// ```
6748    pub fn set_root_password_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6749        self.root_password_set = v.into();
6750        self
6751    }
6752
6753    /// Sets the value of [collation][crate::model::CloudSqlSettings::collation].
6754    ///
6755    /// # Example
6756    /// ```ignore,no_run
6757    /// # use google_cloud_clouddms_v1::model::CloudSqlSettings;
6758    /// let x = CloudSqlSettings::new().set_collation("example");
6759    /// ```
6760    pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6761        self.collation = v.into();
6762        self
6763    }
6764
6765    /// Sets the value of [cmek_key_name][crate::model::CloudSqlSettings::cmek_key_name].
6766    ///
6767    /// # Example
6768    /// ```ignore,no_run
6769    /// # use google_cloud_clouddms_v1::model::CloudSqlSettings;
6770    /// let x = CloudSqlSettings::new().set_cmek_key_name("example");
6771    /// ```
6772    pub fn set_cmek_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6773        self.cmek_key_name = v.into();
6774        self
6775    }
6776
6777    /// Sets the value of [availability_type][crate::model::CloudSqlSettings::availability_type].
6778    ///
6779    /// # Example
6780    /// ```ignore,no_run
6781    /// # use google_cloud_clouddms_v1::model::CloudSqlSettings;
6782    /// use google_cloud_clouddms_v1::model::cloud_sql_settings::SqlAvailabilityType;
6783    /// let x0 = CloudSqlSettings::new().set_availability_type(SqlAvailabilityType::Zonal);
6784    /// let x1 = CloudSqlSettings::new().set_availability_type(SqlAvailabilityType::Regional);
6785    /// ```
6786    pub fn set_availability_type<
6787        T: std::convert::Into<crate::model::cloud_sql_settings::SqlAvailabilityType>,
6788    >(
6789        mut self,
6790        v: T,
6791    ) -> Self {
6792        self.availability_type = v.into();
6793        self
6794    }
6795
6796    /// Sets the value of [edition][crate::model::CloudSqlSettings::edition].
6797    ///
6798    /// # Example
6799    /// ```ignore,no_run
6800    /// # use google_cloud_clouddms_v1::model::CloudSqlSettings;
6801    /// use google_cloud_clouddms_v1::model::cloud_sql_settings::Edition;
6802    /// let x0 = CloudSqlSettings::new().set_edition(Edition::Enterprise);
6803    /// let x1 = CloudSqlSettings::new().set_edition(Edition::EnterprisePlus);
6804    /// ```
6805    pub fn set_edition<T: std::convert::Into<crate::model::cloud_sql_settings::Edition>>(
6806        mut self,
6807        v: T,
6808    ) -> Self {
6809        self.edition = v.into();
6810        self
6811    }
6812}
6813
6814impl wkt::message::Message for CloudSqlSettings {
6815    fn typename() -> &'static str {
6816        "type.googleapis.com/google.cloud.clouddms.v1.CloudSqlSettings"
6817    }
6818}
6819
6820/// Defines additional types related to [CloudSqlSettings].
6821pub mod cloud_sql_settings {
6822    #[allow(unused_imports)]
6823    use super::*;
6824
6825    /// Specifies when the instance should be activated.
6826    ///
6827    /// # Working with unknown values
6828    ///
6829    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6830    /// additional enum variants at any time. Adding new variants is not considered
6831    /// a breaking change. Applications should write their code in anticipation of:
6832    ///
6833    /// - New values appearing in future releases of the client library, **and**
6834    /// - New values received dynamically, without application changes.
6835    ///
6836    /// Please consult the [Working with enums] section in the user guide for some
6837    /// guidelines.
6838    ///
6839    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6840    #[derive(Clone, Debug, PartialEq)]
6841    #[non_exhaustive]
6842    pub enum SqlActivationPolicy {
6843        /// unspecified policy.
6844        Unspecified,
6845        /// The instance is always up and running.
6846        Always,
6847        /// The instance should never spin up.
6848        Never,
6849        /// If set, the enum was initialized with an unknown value.
6850        ///
6851        /// Applications can examine the value using [SqlActivationPolicy::value] or
6852        /// [SqlActivationPolicy::name].
6853        UnknownValue(sql_activation_policy::UnknownValue),
6854    }
6855
6856    #[doc(hidden)]
6857    pub mod sql_activation_policy {
6858        #[allow(unused_imports)]
6859        use super::*;
6860        #[derive(Clone, Debug, PartialEq)]
6861        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6862    }
6863
6864    impl SqlActivationPolicy {
6865        /// Gets the enum value.
6866        ///
6867        /// Returns `None` if the enum contains an unknown value deserialized from
6868        /// the string representation of enums.
6869        pub fn value(&self) -> std::option::Option<i32> {
6870            match self {
6871                Self::Unspecified => std::option::Option::Some(0),
6872                Self::Always => std::option::Option::Some(1),
6873                Self::Never => std::option::Option::Some(2),
6874                Self::UnknownValue(u) => u.0.value(),
6875            }
6876        }
6877
6878        /// Gets the enum value as a string.
6879        ///
6880        /// Returns `None` if the enum contains an unknown value deserialized from
6881        /// the integer representation of enums.
6882        pub fn name(&self) -> std::option::Option<&str> {
6883            match self {
6884                Self::Unspecified => std::option::Option::Some("SQL_ACTIVATION_POLICY_UNSPECIFIED"),
6885                Self::Always => std::option::Option::Some("ALWAYS"),
6886                Self::Never => std::option::Option::Some("NEVER"),
6887                Self::UnknownValue(u) => u.0.name(),
6888            }
6889        }
6890    }
6891
6892    impl std::default::Default for SqlActivationPolicy {
6893        fn default() -> Self {
6894            use std::convert::From;
6895            Self::from(0)
6896        }
6897    }
6898
6899    impl std::fmt::Display for SqlActivationPolicy {
6900        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6901            wkt::internal::display_enum(f, self.name(), self.value())
6902        }
6903    }
6904
6905    impl std::convert::From<i32> for SqlActivationPolicy {
6906        fn from(value: i32) -> Self {
6907            match value {
6908                0 => Self::Unspecified,
6909                1 => Self::Always,
6910                2 => Self::Never,
6911                _ => Self::UnknownValue(sql_activation_policy::UnknownValue(
6912                    wkt::internal::UnknownEnumValue::Integer(value),
6913                )),
6914            }
6915        }
6916    }
6917
6918    impl std::convert::From<&str> for SqlActivationPolicy {
6919        fn from(value: &str) -> Self {
6920            use std::string::ToString;
6921            match value {
6922                "SQL_ACTIVATION_POLICY_UNSPECIFIED" => Self::Unspecified,
6923                "ALWAYS" => Self::Always,
6924                "NEVER" => Self::Never,
6925                _ => Self::UnknownValue(sql_activation_policy::UnknownValue(
6926                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6927                )),
6928            }
6929        }
6930    }
6931
6932    impl serde::ser::Serialize for SqlActivationPolicy {
6933        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6934        where
6935            S: serde::Serializer,
6936        {
6937            match self {
6938                Self::Unspecified => serializer.serialize_i32(0),
6939                Self::Always => serializer.serialize_i32(1),
6940                Self::Never => serializer.serialize_i32(2),
6941                Self::UnknownValue(u) => u.0.serialize(serializer),
6942            }
6943        }
6944    }
6945
6946    impl<'de> serde::de::Deserialize<'de> for SqlActivationPolicy {
6947        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6948        where
6949            D: serde::Deserializer<'de>,
6950        {
6951            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlActivationPolicy>::new(
6952                ".google.cloud.clouddms.v1.CloudSqlSettings.SqlActivationPolicy",
6953            ))
6954        }
6955    }
6956
6957    /// The storage options for Cloud SQL databases.
6958    ///
6959    /// # Working with unknown values
6960    ///
6961    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6962    /// additional enum variants at any time. Adding new variants is not considered
6963    /// a breaking change. Applications should write their code in anticipation of:
6964    ///
6965    /// - New values appearing in future releases of the client library, **and**
6966    /// - New values received dynamically, without application changes.
6967    ///
6968    /// Please consult the [Working with enums] section in the user guide for some
6969    /// guidelines.
6970    ///
6971    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6972    #[derive(Clone, Debug, PartialEq)]
6973    #[non_exhaustive]
6974    pub enum SqlDataDiskType {
6975        /// Unspecified.
6976        Unspecified,
6977        /// SSD disk.
6978        PdSsd,
6979        /// HDD disk.
6980        PdHdd,
6981        /// If set, the enum was initialized with an unknown value.
6982        ///
6983        /// Applications can examine the value using [SqlDataDiskType::value] or
6984        /// [SqlDataDiskType::name].
6985        UnknownValue(sql_data_disk_type::UnknownValue),
6986    }
6987
6988    #[doc(hidden)]
6989    pub mod sql_data_disk_type {
6990        #[allow(unused_imports)]
6991        use super::*;
6992        #[derive(Clone, Debug, PartialEq)]
6993        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6994    }
6995
6996    impl SqlDataDiskType {
6997        /// Gets the enum value.
6998        ///
6999        /// Returns `None` if the enum contains an unknown value deserialized from
7000        /// the string representation of enums.
7001        pub fn value(&self) -> std::option::Option<i32> {
7002            match self {
7003                Self::Unspecified => std::option::Option::Some(0),
7004                Self::PdSsd => std::option::Option::Some(1),
7005                Self::PdHdd => std::option::Option::Some(2),
7006                Self::UnknownValue(u) => u.0.value(),
7007            }
7008        }
7009
7010        /// Gets the enum value as a string.
7011        ///
7012        /// Returns `None` if the enum contains an unknown value deserialized from
7013        /// the integer representation of enums.
7014        pub fn name(&self) -> std::option::Option<&str> {
7015            match self {
7016                Self::Unspecified => std::option::Option::Some("SQL_DATA_DISK_TYPE_UNSPECIFIED"),
7017                Self::PdSsd => std::option::Option::Some("PD_SSD"),
7018                Self::PdHdd => std::option::Option::Some("PD_HDD"),
7019                Self::UnknownValue(u) => u.0.name(),
7020            }
7021        }
7022    }
7023
7024    impl std::default::Default for SqlDataDiskType {
7025        fn default() -> Self {
7026            use std::convert::From;
7027            Self::from(0)
7028        }
7029    }
7030
7031    impl std::fmt::Display for SqlDataDiskType {
7032        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7033            wkt::internal::display_enum(f, self.name(), self.value())
7034        }
7035    }
7036
7037    impl std::convert::From<i32> for SqlDataDiskType {
7038        fn from(value: i32) -> Self {
7039            match value {
7040                0 => Self::Unspecified,
7041                1 => Self::PdSsd,
7042                2 => Self::PdHdd,
7043                _ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
7044                    wkt::internal::UnknownEnumValue::Integer(value),
7045                )),
7046            }
7047        }
7048    }
7049
7050    impl std::convert::From<&str> for SqlDataDiskType {
7051        fn from(value: &str) -> Self {
7052            use std::string::ToString;
7053            match value {
7054                "SQL_DATA_DISK_TYPE_UNSPECIFIED" => Self::Unspecified,
7055                "PD_SSD" => Self::PdSsd,
7056                "PD_HDD" => Self::PdHdd,
7057                _ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
7058                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7059                )),
7060            }
7061        }
7062    }
7063
7064    impl serde::ser::Serialize for SqlDataDiskType {
7065        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7066        where
7067            S: serde::Serializer,
7068        {
7069            match self {
7070                Self::Unspecified => serializer.serialize_i32(0),
7071                Self::PdSsd => serializer.serialize_i32(1),
7072                Self::PdHdd => serializer.serialize_i32(2),
7073                Self::UnknownValue(u) => u.0.serialize(serializer),
7074            }
7075        }
7076    }
7077
7078    impl<'de> serde::de::Deserialize<'de> for SqlDataDiskType {
7079        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7080        where
7081            D: serde::Deserializer<'de>,
7082        {
7083            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDataDiskType>::new(
7084                ".google.cloud.clouddms.v1.CloudSqlSettings.SqlDataDiskType",
7085            ))
7086        }
7087    }
7088
7089    /// The database engine type and version.
7090    ///
7091    /// # Working with unknown values
7092    ///
7093    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7094    /// additional enum variants at any time. Adding new variants is not considered
7095    /// a breaking change. Applications should write their code in anticipation of:
7096    ///
7097    /// - New values appearing in future releases of the client library, **and**
7098    /// - New values received dynamically, without application changes.
7099    ///
7100    /// Please consult the [Working with enums] section in the user guide for some
7101    /// guidelines.
7102    ///
7103    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7104    #[derive(Clone, Debug, PartialEq)]
7105    #[non_exhaustive]
7106    pub enum SqlDatabaseVersion {
7107        /// Unspecified version.
7108        Unspecified,
7109        /// MySQL 5.6.
7110        Mysql56,
7111        /// MySQL 5.7.
7112        Mysql57,
7113        /// PostgreSQL 9.6.
7114        Postgres96,
7115        /// PostgreSQL 11.
7116        Postgres11,
7117        /// PostgreSQL 10.
7118        Postgres10,
7119        /// MySQL 8.0.
7120        Mysql80,
7121        /// PostgreSQL 12.
7122        Postgres12,
7123        /// PostgreSQL 13.
7124        Postgres13,
7125        /// PostgreSQL 14.
7126        Postgres14,
7127        /// PostgreSQL 15.
7128        Postgres15,
7129        /// If set, the enum was initialized with an unknown value.
7130        ///
7131        /// Applications can examine the value using [SqlDatabaseVersion::value] or
7132        /// [SqlDatabaseVersion::name].
7133        UnknownValue(sql_database_version::UnknownValue),
7134    }
7135
7136    #[doc(hidden)]
7137    pub mod sql_database_version {
7138        #[allow(unused_imports)]
7139        use super::*;
7140        #[derive(Clone, Debug, PartialEq)]
7141        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7142    }
7143
7144    impl SqlDatabaseVersion {
7145        /// Gets the enum value.
7146        ///
7147        /// Returns `None` if the enum contains an unknown value deserialized from
7148        /// the string representation of enums.
7149        pub fn value(&self) -> std::option::Option<i32> {
7150            match self {
7151                Self::Unspecified => std::option::Option::Some(0),
7152                Self::Mysql56 => std::option::Option::Some(1),
7153                Self::Mysql57 => std::option::Option::Some(2),
7154                Self::Postgres96 => std::option::Option::Some(3),
7155                Self::Postgres11 => std::option::Option::Some(4),
7156                Self::Postgres10 => std::option::Option::Some(5),
7157                Self::Mysql80 => std::option::Option::Some(6),
7158                Self::Postgres12 => std::option::Option::Some(7),
7159                Self::Postgres13 => std::option::Option::Some(8),
7160                Self::Postgres14 => std::option::Option::Some(17),
7161                Self::Postgres15 => std::option::Option::Some(18),
7162                Self::UnknownValue(u) => u.0.value(),
7163            }
7164        }
7165
7166        /// Gets the enum value as a string.
7167        ///
7168        /// Returns `None` if the enum contains an unknown value deserialized from
7169        /// the integer representation of enums.
7170        pub fn name(&self) -> std::option::Option<&str> {
7171            match self {
7172                Self::Unspecified => std::option::Option::Some("SQL_DATABASE_VERSION_UNSPECIFIED"),
7173                Self::Mysql56 => std::option::Option::Some("MYSQL_5_6"),
7174                Self::Mysql57 => std::option::Option::Some("MYSQL_5_7"),
7175                Self::Postgres96 => std::option::Option::Some("POSTGRES_9_6"),
7176                Self::Postgres11 => std::option::Option::Some("POSTGRES_11"),
7177                Self::Postgres10 => std::option::Option::Some("POSTGRES_10"),
7178                Self::Mysql80 => std::option::Option::Some("MYSQL_8_0"),
7179                Self::Postgres12 => std::option::Option::Some("POSTGRES_12"),
7180                Self::Postgres13 => std::option::Option::Some("POSTGRES_13"),
7181                Self::Postgres14 => std::option::Option::Some("POSTGRES_14"),
7182                Self::Postgres15 => std::option::Option::Some("POSTGRES_15"),
7183                Self::UnknownValue(u) => u.0.name(),
7184            }
7185        }
7186    }
7187
7188    impl std::default::Default for SqlDatabaseVersion {
7189        fn default() -> Self {
7190            use std::convert::From;
7191            Self::from(0)
7192        }
7193    }
7194
7195    impl std::fmt::Display for SqlDatabaseVersion {
7196        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7197            wkt::internal::display_enum(f, self.name(), self.value())
7198        }
7199    }
7200
7201    impl std::convert::From<i32> for SqlDatabaseVersion {
7202        fn from(value: i32) -> Self {
7203            match value {
7204                0 => Self::Unspecified,
7205                1 => Self::Mysql56,
7206                2 => Self::Mysql57,
7207                3 => Self::Postgres96,
7208                4 => Self::Postgres11,
7209                5 => Self::Postgres10,
7210                6 => Self::Mysql80,
7211                7 => Self::Postgres12,
7212                8 => Self::Postgres13,
7213                17 => Self::Postgres14,
7214                18 => Self::Postgres15,
7215                _ => Self::UnknownValue(sql_database_version::UnknownValue(
7216                    wkt::internal::UnknownEnumValue::Integer(value),
7217                )),
7218            }
7219        }
7220    }
7221
7222    impl std::convert::From<&str> for SqlDatabaseVersion {
7223        fn from(value: &str) -> Self {
7224            use std::string::ToString;
7225            match value {
7226                "SQL_DATABASE_VERSION_UNSPECIFIED" => Self::Unspecified,
7227                "MYSQL_5_6" => Self::Mysql56,
7228                "MYSQL_5_7" => Self::Mysql57,
7229                "POSTGRES_9_6" => Self::Postgres96,
7230                "POSTGRES_11" => Self::Postgres11,
7231                "POSTGRES_10" => Self::Postgres10,
7232                "MYSQL_8_0" => Self::Mysql80,
7233                "POSTGRES_12" => Self::Postgres12,
7234                "POSTGRES_13" => Self::Postgres13,
7235                "POSTGRES_14" => Self::Postgres14,
7236                "POSTGRES_15" => Self::Postgres15,
7237                _ => Self::UnknownValue(sql_database_version::UnknownValue(
7238                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7239                )),
7240            }
7241        }
7242    }
7243
7244    impl serde::ser::Serialize for SqlDatabaseVersion {
7245        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7246        where
7247            S: serde::Serializer,
7248        {
7249            match self {
7250                Self::Unspecified => serializer.serialize_i32(0),
7251                Self::Mysql56 => serializer.serialize_i32(1),
7252                Self::Mysql57 => serializer.serialize_i32(2),
7253                Self::Postgres96 => serializer.serialize_i32(3),
7254                Self::Postgres11 => serializer.serialize_i32(4),
7255                Self::Postgres10 => serializer.serialize_i32(5),
7256                Self::Mysql80 => serializer.serialize_i32(6),
7257                Self::Postgres12 => serializer.serialize_i32(7),
7258                Self::Postgres13 => serializer.serialize_i32(8),
7259                Self::Postgres14 => serializer.serialize_i32(17),
7260                Self::Postgres15 => serializer.serialize_i32(18),
7261                Self::UnknownValue(u) => u.0.serialize(serializer),
7262            }
7263        }
7264    }
7265
7266    impl<'de> serde::de::Deserialize<'de> for SqlDatabaseVersion {
7267        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7268        where
7269            D: serde::Deserializer<'de>,
7270        {
7271            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDatabaseVersion>::new(
7272                ".google.cloud.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion",
7273            ))
7274        }
7275    }
7276
7277    /// The availability type of the given Cloud SQL instance.
7278    ///
7279    /// # Working with unknown values
7280    ///
7281    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7282    /// additional enum variants at any time. Adding new variants is not considered
7283    /// a breaking change. Applications should write their code in anticipation of:
7284    ///
7285    /// - New values appearing in future releases of the client library, **and**
7286    /// - New values received dynamically, without application changes.
7287    ///
7288    /// Please consult the [Working with enums] section in the user guide for some
7289    /// guidelines.
7290    ///
7291    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7292    #[derive(Clone, Debug, PartialEq)]
7293    #[non_exhaustive]
7294    pub enum SqlAvailabilityType {
7295        /// This is an unknown Availability type.
7296        Unspecified,
7297        /// Zonal availablility instance.
7298        Zonal,
7299        /// Regional availability instance.
7300        Regional,
7301        /// If set, the enum was initialized with an unknown value.
7302        ///
7303        /// Applications can examine the value using [SqlAvailabilityType::value] or
7304        /// [SqlAvailabilityType::name].
7305        UnknownValue(sql_availability_type::UnknownValue),
7306    }
7307
7308    #[doc(hidden)]
7309    pub mod sql_availability_type {
7310        #[allow(unused_imports)]
7311        use super::*;
7312        #[derive(Clone, Debug, PartialEq)]
7313        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7314    }
7315
7316    impl SqlAvailabilityType {
7317        /// Gets the enum value.
7318        ///
7319        /// Returns `None` if the enum contains an unknown value deserialized from
7320        /// the string representation of enums.
7321        pub fn value(&self) -> std::option::Option<i32> {
7322            match self {
7323                Self::Unspecified => std::option::Option::Some(0),
7324                Self::Zonal => std::option::Option::Some(1),
7325                Self::Regional => std::option::Option::Some(2),
7326                Self::UnknownValue(u) => u.0.value(),
7327            }
7328        }
7329
7330        /// Gets the enum value as a string.
7331        ///
7332        /// Returns `None` if the enum contains an unknown value deserialized from
7333        /// the integer representation of enums.
7334        pub fn name(&self) -> std::option::Option<&str> {
7335            match self {
7336                Self::Unspecified => std::option::Option::Some("SQL_AVAILABILITY_TYPE_UNSPECIFIED"),
7337                Self::Zonal => std::option::Option::Some("ZONAL"),
7338                Self::Regional => std::option::Option::Some("REGIONAL"),
7339                Self::UnknownValue(u) => u.0.name(),
7340            }
7341        }
7342    }
7343
7344    impl std::default::Default for SqlAvailabilityType {
7345        fn default() -> Self {
7346            use std::convert::From;
7347            Self::from(0)
7348        }
7349    }
7350
7351    impl std::fmt::Display for SqlAvailabilityType {
7352        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7353            wkt::internal::display_enum(f, self.name(), self.value())
7354        }
7355    }
7356
7357    impl std::convert::From<i32> for SqlAvailabilityType {
7358        fn from(value: i32) -> Self {
7359            match value {
7360                0 => Self::Unspecified,
7361                1 => Self::Zonal,
7362                2 => Self::Regional,
7363                _ => Self::UnknownValue(sql_availability_type::UnknownValue(
7364                    wkt::internal::UnknownEnumValue::Integer(value),
7365                )),
7366            }
7367        }
7368    }
7369
7370    impl std::convert::From<&str> for SqlAvailabilityType {
7371        fn from(value: &str) -> Self {
7372            use std::string::ToString;
7373            match value {
7374                "SQL_AVAILABILITY_TYPE_UNSPECIFIED" => Self::Unspecified,
7375                "ZONAL" => Self::Zonal,
7376                "REGIONAL" => Self::Regional,
7377                _ => Self::UnknownValue(sql_availability_type::UnknownValue(
7378                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7379                )),
7380            }
7381        }
7382    }
7383
7384    impl serde::ser::Serialize for SqlAvailabilityType {
7385        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7386        where
7387            S: serde::Serializer,
7388        {
7389            match self {
7390                Self::Unspecified => serializer.serialize_i32(0),
7391                Self::Zonal => serializer.serialize_i32(1),
7392                Self::Regional => serializer.serialize_i32(2),
7393                Self::UnknownValue(u) => u.0.serialize(serializer),
7394            }
7395        }
7396    }
7397
7398    impl<'de> serde::de::Deserialize<'de> for SqlAvailabilityType {
7399        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7400        where
7401            D: serde::Deserializer<'de>,
7402        {
7403            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlAvailabilityType>::new(
7404                ".google.cloud.clouddms.v1.CloudSqlSettings.SqlAvailabilityType",
7405            ))
7406        }
7407    }
7408
7409    /// The edition of the given Cloud SQL instance.
7410    /// Can be ENTERPRISE or ENTERPRISE_PLUS.
7411    ///
7412    /// # Working with unknown values
7413    ///
7414    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7415    /// additional enum variants at any time. Adding new variants is not considered
7416    /// a breaking change. Applications should write their code in anticipation of:
7417    ///
7418    /// - New values appearing in future releases of the client library, **and**
7419    /// - New values received dynamically, without application changes.
7420    ///
7421    /// Please consult the [Working with enums] section in the user guide for some
7422    /// guidelines.
7423    ///
7424    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7425    #[derive(Clone, Debug, PartialEq)]
7426    #[non_exhaustive]
7427    pub enum Edition {
7428        /// The instance did not specify the edition.
7429        Unspecified,
7430        /// The instance is an enterprise edition.
7431        Enterprise,
7432        /// The instance is an enterprise plus edition.
7433        EnterprisePlus,
7434        /// If set, the enum was initialized with an unknown value.
7435        ///
7436        /// Applications can examine the value using [Edition::value] or
7437        /// [Edition::name].
7438        UnknownValue(edition::UnknownValue),
7439    }
7440
7441    #[doc(hidden)]
7442    pub mod edition {
7443        #[allow(unused_imports)]
7444        use super::*;
7445        #[derive(Clone, Debug, PartialEq)]
7446        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7447    }
7448
7449    impl Edition {
7450        /// Gets the enum value.
7451        ///
7452        /// Returns `None` if the enum contains an unknown value deserialized from
7453        /// the string representation of enums.
7454        pub fn value(&self) -> std::option::Option<i32> {
7455            match self {
7456                Self::Unspecified => std::option::Option::Some(0),
7457                Self::Enterprise => std::option::Option::Some(2),
7458                Self::EnterprisePlus => std::option::Option::Some(3),
7459                Self::UnknownValue(u) => u.0.value(),
7460            }
7461        }
7462
7463        /// Gets the enum value as a string.
7464        ///
7465        /// Returns `None` if the enum contains an unknown value deserialized from
7466        /// the integer representation of enums.
7467        pub fn name(&self) -> std::option::Option<&str> {
7468            match self {
7469                Self::Unspecified => std::option::Option::Some("EDITION_UNSPECIFIED"),
7470                Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
7471                Self::EnterprisePlus => std::option::Option::Some("ENTERPRISE_PLUS"),
7472                Self::UnknownValue(u) => u.0.name(),
7473            }
7474        }
7475    }
7476
7477    impl std::default::Default for Edition {
7478        fn default() -> Self {
7479            use std::convert::From;
7480            Self::from(0)
7481        }
7482    }
7483
7484    impl std::fmt::Display for Edition {
7485        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7486            wkt::internal::display_enum(f, self.name(), self.value())
7487        }
7488    }
7489
7490    impl std::convert::From<i32> for Edition {
7491        fn from(value: i32) -> Self {
7492            match value {
7493                0 => Self::Unspecified,
7494                2 => Self::Enterprise,
7495                3 => Self::EnterprisePlus,
7496                _ => Self::UnknownValue(edition::UnknownValue(
7497                    wkt::internal::UnknownEnumValue::Integer(value),
7498                )),
7499            }
7500        }
7501    }
7502
7503    impl std::convert::From<&str> for Edition {
7504        fn from(value: &str) -> Self {
7505            use std::string::ToString;
7506            match value {
7507                "EDITION_UNSPECIFIED" => Self::Unspecified,
7508                "ENTERPRISE" => Self::Enterprise,
7509                "ENTERPRISE_PLUS" => Self::EnterprisePlus,
7510                _ => Self::UnknownValue(edition::UnknownValue(
7511                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7512                )),
7513            }
7514        }
7515    }
7516
7517    impl serde::ser::Serialize for Edition {
7518        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7519        where
7520            S: serde::Serializer,
7521        {
7522            match self {
7523                Self::Unspecified => serializer.serialize_i32(0),
7524                Self::Enterprise => serializer.serialize_i32(2),
7525                Self::EnterprisePlus => serializer.serialize_i32(3),
7526                Self::UnknownValue(u) => u.0.serialize(serializer),
7527            }
7528        }
7529    }
7530
7531    impl<'de> serde::de::Deserialize<'de> for Edition {
7532        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7533        where
7534            D: serde::Deserializer<'de>,
7535        {
7536            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Edition>::new(
7537                ".google.cloud.clouddms.v1.CloudSqlSettings.Edition",
7538            ))
7539        }
7540    }
7541}
7542
7543/// Settings for creating an AlloyDB cluster.
7544#[derive(Clone, Default, PartialEq)]
7545#[non_exhaustive]
7546pub struct AlloyDbSettings {
7547    /// Required. Input only. Initial user to setup during cluster creation.
7548    /// Required.
7549    pub initial_user: std::option::Option<crate::model::alloy_db_settings::UserPassword>,
7550
7551    /// Required. The resource link for the VPC network in which cluster resources
7552    /// are created and from which they are accessible via Private IP. The network
7553    /// must belong to the same project as the cluster. It is specified in the
7554    /// form: "projects/{project_number}/global/networks/{network_id}". This is
7555    /// required to create a cluster.
7556    pub vpc_network: std::string::String,
7557
7558    /// Labels for the AlloyDB cluster created by DMS. An object containing a list
7559    /// of 'key', 'value' pairs.
7560    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7561
7562    pub primary_instance_settings:
7563        std::option::Option<crate::model::alloy_db_settings::PrimaryInstanceSettings>,
7564
7565    /// Optional. The encryption config can be specified to encrypt the data disks
7566    /// and other persistent data resources of a cluster with a
7567    /// customer-managed encryption key (CMEK). When this field is not
7568    /// specified, the cluster will then use default encryption scheme to
7569    /// protect the user data.
7570    pub encryption_config: std::option::Option<crate::model::alloy_db_settings::EncryptionConfig>,
7571
7572    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7573}
7574
7575impl AlloyDbSettings {
7576    pub fn new() -> Self {
7577        std::default::Default::default()
7578    }
7579
7580    /// Sets the value of [initial_user][crate::model::AlloyDbSettings::initial_user].
7581    ///
7582    /// # Example
7583    /// ```ignore,no_run
7584    /// # use google_cloud_clouddms_v1::model::AlloyDbSettings;
7585    /// use google_cloud_clouddms_v1::model::alloy_db_settings::UserPassword;
7586    /// let x = AlloyDbSettings::new().set_initial_user(UserPassword::default()/* use setters */);
7587    /// ```
7588    pub fn set_initial_user<T>(mut self, v: T) -> Self
7589    where
7590        T: std::convert::Into<crate::model::alloy_db_settings::UserPassword>,
7591    {
7592        self.initial_user = std::option::Option::Some(v.into());
7593        self
7594    }
7595
7596    /// Sets or clears the value of [initial_user][crate::model::AlloyDbSettings::initial_user].
7597    ///
7598    /// # Example
7599    /// ```ignore,no_run
7600    /// # use google_cloud_clouddms_v1::model::AlloyDbSettings;
7601    /// use google_cloud_clouddms_v1::model::alloy_db_settings::UserPassword;
7602    /// let x = AlloyDbSettings::new().set_or_clear_initial_user(Some(UserPassword::default()/* use setters */));
7603    /// let x = AlloyDbSettings::new().set_or_clear_initial_user(None::<UserPassword>);
7604    /// ```
7605    pub fn set_or_clear_initial_user<T>(mut self, v: std::option::Option<T>) -> Self
7606    where
7607        T: std::convert::Into<crate::model::alloy_db_settings::UserPassword>,
7608    {
7609        self.initial_user = v.map(|x| x.into());
7610        self
7611    }
7612
7613    /// Sets the value of [vpc_network][crate::model::AlloyDbSettings::vpc_network].
7614    ///
7615    /// # Example
7616    /// ```ignore,no_run
7617    /// # use google_cloud_clouddms_v1::model::AlloyDbSettings;
7618    /// let x = AlloyDbSettings::new().set_vpc_network("example");
7619    /// ```
7620    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7621        self.vpc_network = v.into();
7622        self
7623    }
7624
7625    /// Sets the value of [labels][crate::model::AlloyDbSettings::labels].
7626    ///
7627    /// # Example
7628    /// ```ignore,no_run
7629    /// # use google_cloud_clouddms_v1::model::AlloyDbSettings;
7630    /// let x = AlloyDbSettings::new().set_labels([
7631    ///     ("key0", "abc"),
7632    ///     ("key1", "xyz"),
7633    /// ]);
7634    /// ```
7635    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7636    where
7637        T: std::iter::IntoIterator<Item = (K, V)>,
7638        K: std::convert::Into<std::string::String>,
7639        V: std::convert::Into<std::string::String>,
7640    {
7641        use std::iter::Iterator;
7642        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7643        self
7644    }
7645
7646    /// Sets the value of [primary_instance_settings][crate::model::AlloyDbSettings::primary_instance_settings].
7647    ///
7648    /// # Example
7649    /// ```ignore,no_run
7650    /// # use google_cloud_clouddms_v1::model::AlloyDbSettings;
7651    /// use google_cloud_clouddms_v1::model::alloy_db_settings::PrimaryInstanceSettings;
7652    /// let x = AlloyDbSettings::new().set_primary_instance_settings(PrimaryInstanceSettings::default()/* use setters */);
7653    /// ```
7654    pub fn set_primary_instance_settings<T>(mut self, v: T) -> Self
7655    where
7656        T: std::convert::Into<crate::model::alloy_db_settings::PrimaryInstanceSettings>,
7657    {
7658        self.primary_instance_settings = std::option::Option::Some(v.into());
7659        self
7660    }
7661
7662    /// Sets or clears the value of [primary_instance_settings][crate::model::AlloyDbSettings::primary_instance_settings].
7663    ///
7664    /// # Example
7665    /// ```ignore,no_run
7666    /// # use google_cloud_clouddms_v1::model::AlloyDbSettings;
7667    /// use google_cloud_clouddms_v1::model::alloy_db_settings::PrimaryInstanceSettings;
7668    /// let x = AlloyDbSettings::new().set_or_clear_primary_instance_settings(Some(PrimaryInstanceSettings::default()/* use setters */));
7669    /// let x = AlloyDbSettings::new().set_or_clear_primary_instance_settings(None::<PrimaryInstanceSettings>);
7670    /// ```
7671    pub fn set_or_clear_primary_instance_settings<T>(mut self, v: std::option::Option<T>) -> Self
7672    where
7673        T: std::convert::Into<crate::model::alloy_db_settings::PrimaryInstanceSettings>,
7674    {
7675        self.primary_instance_settings = v.map(|x| x.into());
7676        self
7677    }
7678
7679    /// Sets the value of [encryption_config][crate::model::AlloyDbSettings::encryption_config].
7680    ///
7681    /// # Example
7682    /// ```ignore,no_run
7683    /// # use google_cloud_clouddms_v1::model::AlloyDbSettings;
7684    /// use google_cloud_clouddms_v1::model::alloy_db_settings::EncryptionConfig;
7685    /// let x = AlloyDbSettings::new().set_encryption_config(EncryptionConfig::default()/* use setters */);
7686    /// ```
7687    pub fn set_encryption_config<T>(mut self, v: T) -> Self
7688    where
7689        T: std::convert::Into<crate::model::alloy_db_settings::EncryptionConfig>,
7690    {
7691        self.encryption_config = std::option::Option::Some(v.into());
7692        self
7693    }
7694
7695    /// Sets or clears the value of [encryption_config][crate::model::AlloyDbSettings::encryption_config].
7696    ///
7697    /// # Example
7698    /// ```ignore,no_run
7699    /// # use google_cloud_clouddms_v1::model::AlloyDbSettings;
7700    /// use google_cloud_clouddms_v1::model::alloy_db_settings::EncryptionConfig;
7701    /// let x = AlloyDbSettings::new().set_or_clear_encryption_config(Some(EncryptionConfig::default()/* use setters */));
7702    /// let x = AlloyDbSettings::new().set_or_clear_encryption_config(None::<EncryptionConfig>);
7703    /// ```
7704    pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
7705    where
7706        T: std::convert::Into<crate::model::alloy_db_settings::EncryptionConfig>,
7707    {
7708        self.encryption_config = v.map(|x| x.into());
7709        self
7710    }
7711}
7712
7713impl wkt::message::Message for AlloyDbSettings {
7714    fn typename() -> &'static str {
7715        "type.googleapis.com/google.cloud.clouddms.v1.AlloyDbSettings"
7716    }
7717}
7718
7719/// Defines additional types related to [AlloyDbSettings].
7720pub mod alloy_db_settings {
7721    #[allow(unused_imports)]
7722    use super::*;
7723
7724    /// The username/password for a database user. Used for specifying initial
7725    /// users at cluster creation time.
7726    #[derive(Clone, Default, PartialEq)]
7727    #[non_exhaustive]
7728    pub struct UserPassword {
7729        /// The database username.
7730        pub user: std::string::String,
7731
7732        /// The initial password for the user.
7733        pub password: std::string::String,
7734
7735        /// Output only. Indicates if the initial_user.password field has been set.
7736        pub password_set: bool,
7737
7738        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7739    }
7740
7741    impl UserPassword {
7742        pub fn new() -> Self {
7743            std::default::Default::default()
7744        }
7745
7746        /// Sets the value of [user][crate::model::alloy_db_settings::UserPassword::user].
7747        ///
7748        /// # Example
7749        /// ```ignore,no_run
7750        /// # use google_cloud_clouddms_v1::model::alloy_db_settings::UserPassword;
7751        /// let x = UserPassword::new().set_user("example");
7752        /// ```
7753        pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7754            self.user = v.into();
7755            self
7756        }
7757
7758        /// Sets the value of [password][crate::model::alloy_db_settings::UserPassword::password].
7759        ///
7760        /// # Example
7761        /// ```ignore,no_run
7762        /// # use google_cloud_clouddms_v1::model::alloy_db_settings::UserPassword;
7763        /// let x = UserPassword::new().set_password("example");
7764        /// ```
7765        pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7766            self.password = v.into();
7767            self
7768        }
7769
7770        /// Sets the value of [password_set][crate::model::alloy_db_settings::UserPassword::password_set].
7771        ///
7772        /// # Example
7773        /// ```ignore,no_run
7774        /// # use google_cloud_clouddms_v1::model::alloy_db_settings::UserPassword;
7775        /// let x = UserPassword::new().set_password_set(true);
7776        /// ```
7777        pub fn set_password_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7778            self.password_set = v.into();
7779            self
7780        }
7781    }
7782
7783    impl wkt::message::Message for UserPassword {
7784        fn typename() -> &'static str {
7785            "type.googleapis.com/google.cloud.clouddms.v1.AlloyDbSettings.UserPassword"
7786        }
7787    }
7788
7789    /// Settings for the cluster's primary instance
7790    #[derive(Clone, Default, PartialEq)]
7791    #[non_exhaustive]
7792    pub struct PrimaryInstanceSettings {
7793        /// Required. The ID of the AlloyDB primary instance. The ID must satisfy the
7794        /// regex expression "[a-z0-9-]+".
7795        pub id: std::string::String,
7796
7797        /// Configuration for the machines that host the underlying
7798        /// database engine.
7799        pub machine_config: std::option::Option<
7800            crate::model::alloy_db_settings::primary_instance_settings::MachineConfig,
7801        >,
7802
7803        /// Database flags to pass to AlloyDB when DMS is creating the AlloyDB
7804        /// cluster and instances. See the AlloyDB documentation for how these can be
7805        /// used.
7806        pub database_flags: std::collections::HashMap<std::string::String, std::string::String>,
7807
7808        /// Labels for the AlloyDB primary instance created by DMS. An object
7809        /// containing a list of 'key', 'value' pairs.
7810        pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7811
7812        /// Output only. The private IP address for the Instance.
7813        /// This is the connection endpoint for an end-user application.
7814        pub private_ip: std::string::String,
7815
7816        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7817    }
7818
7819    impl PrimaryInstanceSettings {
7820        pub fn new() -> Self {
7821            std::default::Default::default()
7822        }
7823
7824        /// Sets the value of [id][crate::model::alloy_db_settings::PrimaryInstanceSettings::id].
7825        ///
7826        /// # Example
7827        /// ```ignore,no_run
7828        /// # use google_cloud_clouddms_v1::model::alloy_db_settings::PrimaryInstanceSettings;
7829        /// let x = PrimaryInstanceSettings::new().set_id("example");
7830        /// ```
7831        pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7832            self.id = v.into();
7833            self
7834        }
7835
7836        /// Sets the value of [machine_config][crate::model::alloy_db_settings::PrimaryInstanceSettings::machine_config].
7837        ///
7838        /// # Example
7839        /// ```ignore,no_run
7840        /// # use google_cloud_clouddms_v1::model::alloy_db_settings::PrimaryInstanceSettings;
7841        /// use google_cloud_clouddms_v1::model::alloy_db_settings::primary_instance_settings::MachineConfig;
7842        /// let x = PrimaryInstanceSettings::new().set_machine_config(MachineConfig::default()/* use setters */);
7843        /// ```
7844        pub fn set_machine_config<T>(mut self, v: T) -> Self
7845        where
7846            T: std::convert::Into<
7847                    crate::model::alloy_db_settings::primary_instance_settings::MachineConfig,
7848                >,
7849        {
7850            self.machine_config = std::option::Option::Some(v.into());
7851            self
7852        }
7853
7854        /// Sets or clears the value of [machine_config][crate::model::alloy_db_settings::PrimaryInstanceSettings::machine_config].
7855        ///
7856        /// # Example
7857        /// ```ignore,no_run
7858        /// # use google_cloud_clouddms_v1::model::alloy_db_settings::PrimaryInstanceSettings;
7859        /// use google_cloud_clouddms_v1::model::alloy_db_settings::primary_instance_settings::MachineConfig;
7860        /// let x = PrimaryInstanceSettings::new().set_or_clear_machine_config(Some(MachineConfig::default()/* use setters */));
7861        /// let x = PrimaryInstanceSettings::new().set_or_clear_machine_config(None::<MachineConfig>);
7862        /// ```
7863        pub fn set_or_clear_machine_config<T>(mut self, v: std::option::Option<T>) -> Self
7864        where
7865            T: std::convert::Into<
7866                    crate::model::alloy_db_settings::primary_instance_settings::MachineConfig,
7867                >,
7868        {
7869            self.machine_config = v.map(|x| x.into());
7870            self
7871        }
7872
7873        /// Sets the value of [database_flags][crate::model::alloy_db_settings::PrimaryInstanceSettings::database_flags].
7874        ///
7875        /// # Example
7876        /// ```ignore,no_run
7877        /// # use google_cloud_clouddms_v1::model::alloy_db_settings::PrimaryInstanceSettings;
7878        /// let x = PrimaryInstanceSettings::new().set_database_flags([
7879        ///     ("key0", "abc"),
7880        ///     ("key1", "xyz"),
7881        /// ]);
7882        /// ```
7883        pub fn set_database_flags<T, K, V>(mut self, v: T) -> Self
7884        where
7885            T: std::iter::IntoIterator<Item = (K, V)>,
7886            K: std::convert::Into<std::string::String>,
7887            V: std::convert::Into<std::string::String>,
7888        {
7889            use std::iter::Iterator;
7890            self.database_flags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7891            self
7892        }
7893
7894        /// Sets the value of [labels][crate::model::alloy_db_settings::PrimaryInstanceSettings::labels].
7895        ///
7896        /// # Example
7897        /// ```ignore,no_run
7898        /// # use google_cloud_clouddms_v1::model::alloy_db_settings::PrimaryInstanceSettings;
7899        /// let x = PrimaryInstanceSettings::new().set_labels([
7900        ///     ("key0", "abc"),
7901        ///     ("key1", "xyz"),
7902        /// ]);
7903        /// ```
7904        pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7905        where
7906            T: std::iter::IntoIterator<Item = (K, V)>,
7907            K: std::convert::Into<std::string::String>,
7908            V: std::convert::Into<std::string::String>,
7909        {
7910            use std::iter::Iterator;
7911            self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7912            self
7913        }
7914
7915        /// Sets the value of [private_ip][crate::model::alloy_db_settings::PrimaryInstanceSettings::private_ip].
7916        ///
7917        /// # Example
7918        /// ```ignore,no_run
7919        /// # use google_cloud_clouddms_v1::model::alloy_db_settings::PrimaryInstanceSettings;
7920        /// let x = PrimaryInstanceSettings::new().set_private_ip("example");
7921        /// ```
7922        pub fn set_private_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7923            self.private_ip = v.into();
7924            self
7925        }
7926    }
7927
7928    impl wkt::message::Message for PrimaryInstanceSettings {
7929        fn typename() -> &'static str {
7930            "type.googleapis.com/google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings"
7931        }
7932    }
7933
7934    /// Defines additional types related to [PrimaryInstanceSettings].
7935    pub mod primary_instance_settings {
7936        #[allow(unused_imports)]
7937        use super::*;
7938
7939        /// MachineConfig describes the configuration of a machine.
7940        #[derive(Clone, Default, PartialEq)]
7941        #[non_exhaustive]
7942        pub struct MachineConfig {
7943            /// The number of CPU's in the VM instance.
7944            pub cpu_count: i32,
7945
7946            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7947        }
7948
7949        impl MachineConfig {
7950            pub fn new() -> Self {
7951                std::default::Default::default()
7952            }
7953
7954            /// Sets the value of [cpu_count][crate::model::alloy_db_settings::primary_instance_settings::MachineConfig::cpu_count].
7955            ///
7956            /// # Example
7957            /// ```ignore,no_run
7958            /// # use google_cloud_clouddms_v1::model::alloy_db_settings::primary_instance_settings::MachineConfig;
7959            /// let x = MachineConfig::new().set_cpu_count(42);
7960            /// ```
7961            pub fn set_cpu_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7962                self.cpu_count = v.into();
7963                self
7964            }
7965        }
7966
7967        impl wkt::message::Message for MachineConfig {
7968            fn typename() -> &'static str {
7969                "type.googleapis.com/google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig"
7970            }
7971        }
7972    }
7973
7974    /// EncryptionConfig describes the encryption config of a cluster that is
7975    /// encrypted with a CMEK (customer-managed encryption key).
7976    #[derive(Clone, Default, PartialEq)]
7977    #[non_exhaustive]
7978    pub struct EncryptionConfig {
7979        /// The fully-qualified resource name of the KMS key.
7980        /// Each Cloud KMS key is regionalized and has the following format:
7981        /// projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
7982        pub kms_key_name: std::string::String,
7983
7984        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7985    }
7986
7987    impl EncryptionConfig {
7988        pub fn new() -> Self {
7989            std::default::Default::default()
7990        }
7991
7992        /// Sets the value of [kms_key_name][crate::model::alloy_db_settings::EncryptionConfig::kms_key_name].
7993        ///
7994        /// # Example
7995        /// ```ignore,no_run
7996        /// # use google_cloud_clouddms_v1::model::alloy_db_settings::EncryptionConfig;
7997        /// let x = EncryptionConfig::new().set_kms_key_name("example");
7998        /// ```
7999        pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(
8000            mut self,
8001            v: T,
8002        ) -> Self {
8003            self.kms_key_name = v.into();
8004            self
8005        }
8006    }
8007
8008    impl wkt::message::Message for EncryptionConfig {
8009        fn typename() -> &'static str {
8010            "type.googleapis.com/google.cloud.clouddms.v1.AlloyDbSettings.EncryptionConfig"
8011        }
8012    }
8013}
8014
8015/// The source database will allow incoming connections from the public IP of the
8016/// destination database. You can retrieve the public IP of the Cloud SQL
8017/// instance from the Cloud SQL console or using Cloud SQL APIs. No additional
8018/// configuration is required.
8019#[derive(Clone, Default, PartialEq)]
8020#[non_exhaustive]
8021pub struct StaticIpConnectivity {
8022    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8023}
8024
8025impl StaticIpConnectivity {
8026    pub fn new() -> Self {
8027        std::default::Default::default()
8028    }
8029}
8030
8031impl wkt::message::Message for StaticIpConnectivity {
8032    fn typename() -> &'static str {
8033        "type.googleapis.com/google.cloud.clouddms.v1.StaticIpConnectivity"
8034    }
8035}
8036
8037/// [Private Service Connect
8038/// connectivity](https://cloud.google.com/vpc/docs/private-service-connect#service-attachments)
8039#[derive(Clone, Default, PartialEq)]
8040#[non_exhaustive]
8041pub struct PrivateServiceConnectConnectivity {
8042    /// Required. A service attachment that exposes a database, and has the
8043    /// following format:
8044    /// projects/{project}/regions/{region}/serviceAttachments/{service_attachment_name}
8045    pub service_attachment: std::string::String,
8046
8047    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8048}
8049
8050impl PrivateServiceConnectConnectivity {
8051    pub fn new() -> Self {
8052        std::default::Default::default()
8053    }
8054
8055    /// Sets the value of [service_attachment][crate::model::PrivateServiceConnectConnectivity::service_attachment].
8056    ///
8057    /// # Example
8058    /// ```ignore,no_run
8059    /// # use google_cloud_clouddms_v1::model::PrivateServiceConnectConnectivity;
8060    /// let x = PrivateServiceConnectConnectivity::new().set_service_attachment("example");
8061    /// ```
8062    pub fn set_service_attachment<T: std::convert::Into<std::string::String>>(
8063        mut self,
8064        v: T,
8065    ) -> Self {
8066        self.service_attachment = v.into();
8067        self
8068    }
8069}
8070
8071impl wkt::message::Message for PrivateServiceConnectConnectivity {
8072    fn typename() -> &'static str {
8073        "type.googleapis.com/google.cloud.clouddms.v1.PrivateServiceConnectConnectivity"
8074    }
8075}
8076
8077/// The details needed to configure a reverse SSH tunnel between the source and
8078/// destination databases. These details will be used when calling the
8079/// generateSshScript method (see
8080/// <https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.migrationJobs/generateSshScript>)
8081/// to produce the script that will help set up the reverse SSH tunnel, and to
8082/// set up the VPC peering between the Cloud SQL private network and the VPC.
8083#[derive(Clone, Default, PartialEq)]
8084#[non_exhaustive]
8085pub struct ReverseSshConnectivity {
8086    /// Required. The IP of the virtual machine (Compute Engine) used as the
8087    /// bastion server for the SSH tunnel.
8088    pub vm_ip: std::string::String,
8089
8090    /// Required. The forwarding port of the virtual machine (Compute Engine) used
8091    /// as the bastion server for the SSH tunnel.
8092    pub vm_port: i32,
8093
8094    /// The name of the virtual machine (Compute Engine) used as the bastion server
8095    /// for the SSH tunnel.
8096    pub vm: std::string::String,
8097
8098    /// The name of the VPC to peer with the Cloud SQL private network.
8099    pub vpc: std::string::String,
8100
8101    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8102}
8103
8104impl ReverseSshConnectivity {
8105    pub fn new() -> Self {
8106        std::default::Default::default()
8107    }
8108
8109    /// Sets the value of [vm_ip][crate::model::ReverseSshConnectivity::vm_ip].
8110    ///
8111    /// # Example
8112    /// ```ignore,no_run
8113    /// # use google_cloud_clouddms_v1::model::ReverseSshConnectivity;
8114    /// let x = ReverseSshConnectivity::new().set_vm_ip("example");
8115    /// ```
8116    pub fn set_vm_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8117        self.vm_ip = v.into();
8118        self
8119    }
8120
8121    /// Sets the value of [vm_port][crate::model::ReverseSshConnectivity::vm_port].
8122    ///
8123    /// # Example
8124    /// ```ignore,no_run
8125    /// # use google_cloud_clouddms_v1::model::ReverseSshConnectivity;
8126    /// let x = ReverseSshConnectivity::new().set_vm_port(42);
8127    /// ```
8128    pub fn set_vm_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8129        self.vm_port = v.into();
8130        self
8131    }
8132
8133    /// Sets the value of [vm][crate::model::ReverseSshConnectivity::vm].
8134    ///
8135    /// # Example
8136    /// ```ignore,no_run
8137    /// # use google_cloud_clouddms_v1::model::ReverseSshConnectivity;
8138    /// let x = ReverseSshConnectivity::new().set_vm("example");
8139    /// ```
8140    pub fn set_vm<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8141        self.vm = v.into();
8142        self
8143    }
8144
8145    /// Sets the value of [vpc][crate::model::ReverseSshConnectivity::vpc].
8146    ///
8147    /// # Example
8148    /// ```ignore,no_run
8149    /// # use google_cloud_clouddms_v1::model::ReverseSshConnectivity;
8150    /// let x = ReverseSshConnectivity::new().set_vpc("example");
8151    /// ```
8152    pub fn set_vpc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8153        self.vpc = v.into();
8154        self
8155    }
8156}
8157
8158impl wkt::message::Message for ReverseSshConnectivity {
8159    fn typename() -> &'static str {
8160        "type.googleapis.com/google.cloud.clouddms.v1.ReverseSshConnectivity"
8161    }
8162}
8163
8164/// The details of the VPC where the source database is located in Google Cloud.
8165/// We will use this information to set up the VPC peering connection between
8166/// Cloud SQL and this VPC.
8167#[derive(Clone, Default, PartialEq)]
8168#[non_exhaustive]
8169pub struct VpcPeeringConnectivity {
8170    /// The name of the VPC network to peer with the Cloud SQL private network.
8171    pub vpc: std::string::String,
8172
8173    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8174}
8175
8176impl VpcPeeringConnectivity {
8177    pub fn new() -> Self {
8178        std::default::Default::default()
8179    }
8180
8181    /// Sets the value of [vpc][crate::model::VpcPeeringConnectivity::vpc].
8182    ///
8183    /// # Example
8184    /// ```ignore,no_run
8185    /// # use google_cloud_clouddms_v1::model::VpcPeeringConnectivity;
8186    /// let x = VpcPeeringConnectivity::new().set_vpc("example");
8187    /// ```
8188    pub fn set_vpc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8189        self.vpc = v.into();
8190        self
8191    }
8192}
8193
8194impl wkt::message::Message for VpcPeeringConnectivity {
8195    fn typename() -> &'static str {
8196        "type.googleapis.com/google.cloud.clouddms.v1.VpcPeeringConnectivity"
8197    }
8198}
8199
8200/// Forward SSH Tunnel connectivity.
8201#[derive(Clone, Default, PartialEq)]
8202#[non_exhaustive]
8203pub struct ForwardSshTunnelConnectivity {
8204    /// Required. Hostname for the SSH tunnel.
8205    pub hostname: std::string::String,
8206
8207    /// Required. Username for the SSH tunnel.
8208    pub username: std::string::String,
8209
8210    /// Port for the SSH tunnel, default value is 22.
8211    pub port: i32,
8212
8213    pub authentication_method:
8214        std::option::Option<crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod>,
8215
8216    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8217}
8218
8219impl ForwardSshTunnelConnectivity {
8220    pub fn new() -> Self {
8221        std::default::Default::default()
8222    }
8223
8224    /// Sets the value of [hostname][crate::model::ForwardSshTunnelConnectivity::hostname].
8225    ///
8226    /// # Example
8227    /// ```ignore,no_run
8228    /// # use google_cloud_clouddms_v1::model::ForwardSshTunnelConnectivity;
8229    /// let x = ForwardSshTunnelConnectivity::new().set_hostname("example");
8230    /// ```
8231    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8232        self.hostname = v.into();
8233        self
8234    }
8235
8236    /// Sets the value of [username][crate::model::ForwardSshTunnelConnectivity::username].
8237    ///
8238    /// # Example
8239    /// ```ignore,no_run
8240    /// # use google_cloud_clouddms_v1::model::ForwardSshTunnelConnectivity;
8241    /// let x = ForwardSshTunnelConnectivity::new().set_username("example");
8242    /// ```
8243    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8244        self.username = v.into();
8245        self
8246    }
8247
8248    /// Sets the value of [port][crate::model::ForwardSshTunnelConnectivity::port].
8249    ///
8250    /// # Example
8251    /// ```ignore,no_run
8252    /// # use google_cloud_clouddms_v1::model::ForwardSshTunnelConnectivity;
8253    /// let x = ForwardSshTunnelConnectivity::new().set_port(42);
8254    /// ```
8255    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8256        self.port = v.into();
8257        self
8258    }
8259
8260    /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method].
8261    ///
8262    /// Note that all the setters affecting `authentication_method` are mutually
8263    /// exclusive.
8264    ///
8265    /// # Example
8266    /// ```ignore,no_run
8267    /// # use google_cloud_clouddms_v1::model::ForwardSshTunnelConnectivity;
8268    /// use google_cloud_clouddms_v1::model::forward_ssh_tunnel_connectivity::AuthenticationMethod;
8269    /// let x = ForwardSshTunnelConnectivity::new().set_authentication_method(Some(AuthenticationMethod::Password("example".to_string())));
8270    /// ```
8271    pub fn set_authentication_method<
8272        T: std::convert::Into<
8273                std::option::Option<
8274                    crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod,
8275                >,
8276            >,
8277    >(
8278        mut self,
8279        v: T,
8280    ) -> Self {
8281        self.authentication_method = v.into();
8282        self
8283    }
8284
8285    /// The value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
8286    /// if it holds a `Password`, `None` if the field is not set or
8287    /// holds a different branch.
8288    pub fn password(&self) -> std::option::Option<&std::string::String> {
8289        #[allow(unreachable_patterns)]
8290        self.authentication_method.as_ref().and_then(|v| match v {
8291            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::Password(v) => {
8292                std::option::Option::Some(v)
8293            }
8294            _ => std::option::Option::None,
8295        })
8296    }
8297
8298    /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
8299    /// to hold a `Password`.
8300    ///
8301    /// Note that all the setters affecting `authentication_method` are
8302    /// mutually exclusive.
8303    ///
8304    /// # Example
8305    /// ```ignore,no_run
8306    /// # use google_cloud_clouddms_v1::model::ForwardSshTunnelConnectivity;
8307    /// let x = ForwardSshTunnelConnectivity::new().set_password("example");
8308    /// assert!(x.password().is_some());
8309    /// assert!(x.private_key().is_none());
8310    /// ```
8311    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8312        self.authentication_method = std::option::Option::Some(
8313            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::Password(v.into()),
8314        );
8315        self
8316    }
8317
8318    /// The value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
8319    /// if it holds a `PrivateKey`, `None` if the field is not set or
8320    /// holds a different branch.
8321    pub fn private_key(&self) -> std::option::Option<&std::string::String> {
8322        #[allow(unreachable_patterns)]
8323        self.authentication_method.as_ref().and_then(|v| match v {
8324            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::PrivateKey(v) => {
8325                std::option::Option::Some(v)
8326            }
8327            _ => std::option::Option::None,
8328        })
8329    }
8330
8331    /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
8332    /// to hold a `PrivateKey`.
8333    ///
8334    /// Note that all the setters affecting `authentication_method` are
8335    /// mutually exclusive.
8336    ///
8337    /// # Example
8338    /// ```ignore,no_run
8339    /// # use google_cloud_clouddms_v1::model::ForwardSshTunnelConnectivity;
8340    /// let x = ForwardSshTunnelConnectivity::new().set_private_key("example");
8341    /// assert!(x.private_key().is_some());
8342    /// assert!(x.password().is_none());
8343    /// ```
8344    pub fn set_private_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8345        self.authentication_method = std::option::Option::Some(
8346            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::PrivateKey(
8347                v.into(),
8348            ),
8349        );
8350        self
8351    }
8352}
8353
8354impl wkt::message::Message for ForwardSshTunnelConnectivity {
8355    fn typename() -> &'static str {
8356        "type.googleapis.com/google.cloud.clouddms.v1.ForwardSshTunnelConnectivity"
8357    }
8358}
8359
8360/// Defines additional types related to [ForwardSshTunnelConnectivity].
8361pub mod forward_ssh_tunnel_connectivity {
8362    #[allow(unused_imports)]
8363    use super::*;
8364
8365    #[derive(Clone, Debug, PartialEq)]
8366    #[non_exhaustive]
8367    pub enum AuthenticationMethod {
8368        /// Input only. SSH password.
8369        Password(std::string::String),
8370        /// Input only. SSH private key.
8371        PrivateKey(std::string::String),
8372    }
8373}
8374
8375/// Static IP address connectivity configured on service project.
8376#[derive(Clone, Default, PartialEq)]
8377#[non_exhaustive]
8378pub struct StaticServiceIpConnectivity {
8379    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8380}
8381
8382impl StaticServiceIpConnectivity {
8383    pub fn new() -> Self {
8384        std::default::Default::default()
8385    }
8386}
8387
8388impl wkt::message::Message for StaticServiceIpConnectivity {
8389    fn typename() -> &'static str {
8390        "type.googleapis.com/google.cloud.clouddms.v1.StaticServiceIpConnectivity"
8391    }
8392}
8393
8394/// Private Connectivity.
8395#[derive(Clone, Default, PartialEq)]
8396#[non_exhaustive]
8397pub struct PrivateConnectivity {
8398    /// Required. The resource name (URI) of the private connection.
8399    pub private_connection: std::string::String,
8400
8401    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8402}
8403
8404impl PrivateConnectivity {
8405    pub fn new() -> Self {
8406        std::default::Default::default()
8407    }
8408
8409    /// Sets the value of [private_connection][crate::model::PrivateConnectivity::private_connection].
8410    ///
8411    /// # Example
8412    /// ```ignore,no_run
8413    /// # use google_cloud_clouddms_v1::model::PrivateConnectivity;
8414    /// let x = PrivateConnectivity::new().set_private_connection("example");
8415    /// ```
8416    pub fn set_private_connection<T: std::convert::Into<std::string::String>>(
8417        mut self,
8418        v: T,
8419    ) -> Self {
8420        self.private_connection = v.into();
8421        self
8422    }
8423}
8424
8425impl wkt::message::Message for PrivateConnectivity {
8426    fn typename() -> &'static str {
8427        "type.googleapis.com/google.cloud.clouddms.v1.PrivateConnectivity"
8428    }
8429}
8430
8431/// A message defining the database engine and provider.
8432#[derive(Clone, Default, PartialEq)]
8433#[non_exhaustive]
8434pub struct DatabaseType {
8435    /// The database provider.
8436    pub provider: crate::model::DatabaseProvider,
8437
8438    /// The database engine.
8439    pub engine: crate::model::DatabaseEngine,
8440
8441    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8442}
8443
8444impl DatabaseType {
8445    pub fn new() -> Self {
8446        std::default::Default::default()
8447    }
8448
8449    /// Sets the value of [provider][crate::model::DatabaseType::provider].
8450    ///
8451    /// # Example
8452    /// ```ignore,no_run
8453    /// # use google_cloud_clouddms_v1::model::DatabaseType;
8454    /// use google_cloud_clouddms_v1::model::DatabaseProvider;
8455    /// let x0 = DatabaseType::new().set_provider(DatabaseProvider::Cloudsql);
8456    /// let x1 = DatabaseType::new().set_provider(DatabaseProvider::Rds);
8457    /// let x2 = DatabaseType::new().set_provider(DatabaseProvider::Aurora);
8458    /// ```
8459    pub fn set_provider<T: std::convert::Into<crate::model::DatabaseProvider>>(
8460        mut self,
8461        v: T,
8462    ) -> Self {
8463        self.provider = v.into();
8464        self
8465    }
8466
8467    /// Sets the value of [engine][crate::model::DatabaseType::engine].
8468    ///
8469    /// # Example
8470    /// ```ignore,no_run
8471    /// # use google_cloud_clouddms_v1::model::DatabaseType;
8472    /// use google_cloud_clouddms_v1::model::DatabaseEngine;
8473    /// let x0 = DatabaseType::new().set_engine(DatabaseEngine::Mysql);
8474    /// let x1 = DatabaseType::new().set_engine(DatabaseEngine::Postgresql);
8475    /// let x2 = DatabaseType::new().set_engine(DatabaseEngine::Oracle);
8476    /// ```
8477    pub fn set_engine<T: std::convert::Into<crate::model::DatabaseEngine>>(mut self, v: T) -> Self {
8478        self.engine = v.into();
8479        self
8480    }
8481}
8482
8483impl wkt::message::Message for DatabaseType {
8484    fn typename() -> &'static str {
8485        "type.googleapis.com/google.cloud.clouddms.v1.DatabaseType"
8486    }
8487}
8488
8489/// Represents a Database Migration Service migration job object.
8490#[derive(Clone, Default, PartialEq)]
8491#[non_exhaustive]
8492pub struct MigrationJob {
8493    /// The name (URI) of this migration job resource, in the form of:
8494    /// projects/{project}/locations/{location}/migrationJobs/{migrationJob}.
8495    pub name: std::string::String,
8496
8497    /// Output only. The timestamp when the migration job resource was created.
8498    /// A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds.
8499    /// Example: "2014-10-02T15:01:23.045123456Z".
8500    pub create_time: std::option::Option<wkt::Timestamp>,
8501
8502    /// Output only. The timestamp when the migration job resource was last
8503    /// updated. A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds.
8504    /// Example: "2014-10-02T15:01:23.045123456Z".
8505    pub update_time: std::option::Option<wkt::Timestamp>,
8506
8507    /// The resource labels for migration job to use to annotate any related
8508    /// underlying resources such as Compute Engine VMs. An object containing a
8509    /// list of "key": "value" pairs.
8510    ///
8511    /// Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`.
8512    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8513
8514    /// The migration job display name.
8515    pub display_name: std::string::String,
8516
8517    /// The current migration job state.
8518    pub state: crate::model::migration_job::State,
8519
8520    /// Output only. The current migration job phase.
8521    pub phase: crate::model::migration_job::Phase,
8522
8523    /// Required. The migration job type.
8524    pub r#type: crate::model::migration_job::Type,
8525
8526    /// The path to the dump file in Google Cloud Storage,
8527    /// in the format: (gs://[BUCKET_NAME]/[OBJECT_NAME]).
8528    /// This field and the "dump_flags" field are mutually exclusive.
8529    pub dump_path: std::string::String,
8530
8531    /// The initial dump flags.
8532    /// This field and the "dump_path" field are mutually exclusive.
8533    pub dump_flags: std::option::Option<crate::model::migration_job::DumpFlags>,
8534
8535    /// Required. The resource name (URI) of the source connection profile.
8536    pub source: std::string::String,
8537
8538    /// Required. The resource name (URI) of the destination connection profile.
8539    pub destination: std::string::String,
8540
8541    /// Output only. The duration of the migration job (in seconds). A duration in
8542    /// seconds with up to nine fractional digits, terminated by 's'. Example:
8543    /// "3.5s".
8544    pub duration: std::option::Option<wkt::Duration>,
8545
8546    /// Output only. The error details in case of state FAILED.
8547    pub error: std::option::Option<google_cloud_rpc::model::Status>,
8548
8549    /// The database engine type and provider of the source.
8550    pub source_database: std::option::Option<crate::model::DatabaseType>,
8551
8552    /// The database engine type and provider of the destination.
8553    pub destination_database: std::option::Option<crate::model::DatabaseType>,
8554
8555    /// Output only. If the migration job is completed, the time when it was
8556    /// completed.
8557    pub end_time: std::option::Option<wkt::Timestamp>,
8558
8559    /// The conversion workspace used by the migration.
8560    pub conversion_workspace: std::option::Option<crate::model::ConversionWorkspaceInfo>,
8561
8562    /// This field can be used to select the entities to migrate as part of
8563    /// the migration job. It uses AIP-160 notation to select a subset of the
8564    /// entities configured on the associated conversion-workspace. This field
8565    /// should not be set on migration-jobs that are not associated with a
8566    /// conversion workspace.
8567    pub filter: std::string::String,
8568
8569    /// The CMEK (customer-managed encryption key) fully qualified key name used
8570    /// for the migration job.
8571    /// This field supports all migration jobs types except for:
8572    ///
8573    /// * Mysql to Mysql (use the cmek field in the cloudsql connection profile
8574    ///   instead).
8575    /// * PostrgeSQL to PostgreSQL (use the cmek field in the cloudsql
8576    ///   connection profile instead).
8577    /// * PostgreSQL to AlloyDB (use the kms_key_name field in the alloydb
8578    ///   connection profile instead).
8579    ///   Each Cloud CMEK key has the following format:
8580    ///   projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
8581    pub cmek_key_name: std::string::String,
8582
8583    /// Optional. Data dump parallelism settings used by the migration.
8584    /// Currently applicable only for MySQL to Cloud SQL for MySQL migrations only.
8585    pub performance_config: std::option::Option<crate::model::migration_job::PerformanceConfig>,
8586
8587    /// The connectivity method.
8588    pub connectivity: std::option::Option<crate::model::migration_job::Connectivity>,
8589
8590    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8591}
8592
8593impl MigrationJob {
8594    pub fn new() -> Self {
8595        std::default::Default::default()
8596    }
8597
8598    /// Sets the value of [name][crate::model::MigrationJob::name].
8599    ///
8600    /// # Example
8601    /// ```ignore,no_run
8602    /// # use google_cloud_clouddms_v1::model::MigrationJob;
8603    /// let x = MigrationJob::new().set_name("example");
8604    /// ```
8605    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8606        self.name = v.into();
8607        self
8608    }
8609
8610    /// Sets the value of [create_time][crate::model::MigrationJob::create_time].
8611    ///
8612    /// # Example
8613    /// ```ignore,no_run
8614    /// # use google_cloud_clouddms_v1::model::MigrationJob;
8615    /// use wkt::Timestamp;
8616    /// let x = MigrationJob::new().set_create_time(Timestamp::default()/* use setters */);
8617    /// ```
8618    pub fn set_create_time<T>(mut self, v: T) -> Self
8619    where
8620        T: std::convert::Into<wkt::Timestamp>,
8621    {
8622        self.create_time = std::option::Option::Some(v.into());
8623        self
8624    }
8625
8626    /// Sets or clears the value of [create_time][crate::model::MigrationJob::create_time].
8627    ///
8628    /// # Example
8629    /// ```ignore,no_run
8630    /// # use google_cloud_clouddms_v1::model::MigrationJob;
8631    /// use wkt::Timestamp;
8632    /// let x = MigrationJob::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
8633    /// let x = MigrationJob::new().set_or_clear_create_time(None::<Timestamp>);
8634    /// ```
8635    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8636    where
8637        T: std::convert::Into<wkt::Timestamp>,
8638    {
8639        self.create_time = v.map(|x| x.into());
8640        self
8641    }
8642
8643    /// Sets the value of [update_time][crate::model::MigrationJob::update_time].
8644    ///
8645    /// # Example
8646    /// ```ignore,no_run
8647    /// # use google_cloud_clouddms_v1::model::MigrationJob;
8648    /// use wkt::Timestamp;
8649    /// let x = MigrationJob::new().set_update_time(Timestamp::default()/* use setters */);
8650    /// ```
8651    pub fn set_update_time<T>(mut self, v: T) -> Self
8652    where
8653        T: std::convert::Into<wkt::Timestamp>,
8654    {
8655        self.update_time = std::option::Option::Some(v.into());
8656        self
8657    }
8658
8659    /// Sets or clears the value of [update_time][crate::model::MigrationJob::update_time].
8660    ///
8661    /// # Example
8662    /// ```ignore,no_run
8663    /// # use google_cloud_clouddms_v1::model::MigrationJob;
8664    /// use wkt::Timestamp;
8665    /// let x = MigrationJob::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
8666    /// let x = MigrationJob::new().set_or_clear_update_time(None::<Timestamp>);
8667    /// ```
8668    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8669    where
8670        T: std::convert::Into<wkt::Timestamp>,
8671    {
8672        self.update_time = v.map(|x| x.into());
8673        self
8674    }
8675
8676    /// Sets the value of [labels][crate::model::MigrationJob::labels].
8677    ///
8678    /// # Example
8679    /// ```ignore,no_run
8680    /// # use google_cloud_clouddms_v1::model::MigrationJob;
8681    /// let x = MigrationJob::new().set_labels([
8682    ///     ("key0", "abc"),
8683    ///     ("key1", "xyz"),
8684    /// ]);
8685    /// ```
8686    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8687    where
8688        T: std::iter::IntoIterator<Item = (K, V)>,
8689        K: std::convert::Into<std::string::String>,
8690        V: std::convert::Into<std::string::String>,
8691    {
8692        use std::iter::Iterator;
8693        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8694        self
8695    }
8696
8697    /// Sets the value of [display_name][crate::model::MigrationJob::display_name].
8698    ///
8699    /// # Example
8700    /// ```ignore,no_run
8701    /// # use google_cloud_clouddms_v1::model::MigrationJob;
8702    /// let x = MigrationJob::new().set_display_name("example");
8703    /// ```
8704    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8705        self.display_name = v.into();
8706        self
8707    }
8708
8709    /// Sets the value of [state][crate::model::MigrationJob::state].
8710    ///
8711    /// # Example
8712    /// ```ignore,no_run
8713    /// # use google_cloud_clouddms_v1::model::MigrationJob;
8714    /// use google_cloud_clouddms_v1::model::migration_job::State;
8715    /// let x0 = MigrationJob::new().set_state(State::Maintenance);
8716    /// let x1 = MigrationJob::new().set_state(State::Draft);
8717    /// let x2 = MigrationJob::new().set_state(State::Creating);
8718    /// ```
8719    pub fn set_state<T: std::convert::Into<crate::model::migration_job::State>>(
8720        mut self,
8721        v: T,
8722    ) -> Self {
8723        self.state = v.into();
8724        self
8725    }
8726
8727    /// Sets the value of [phase][crate::model::MigrationJob::phase].
8728    ///
8729    /// # Example
8730    /// ```ignore,no_run
8731    /// # use google_cloud_clouddms_v1::model::MigrationJob;
8732    /// use google_cloud_clouddms_v1::model::migration_job::Phase;
8733    /// let x0 = MigrationJob::new().set_phase(Phase::FullDump);
8734    /// let x1 = MigrationJob::new().set_phase(Phase::Cdc);
8735    /// let x2 = MigrationJob::new().set_phase(Phase::PromoteInProgress);
8736    /// ```
8737    pub fn set_phase<T: std::convert::Into<crate::model::migration_job::Phase>>(
8738        mut self,
8739        v: T,
8740    ) -> Self {
8741        self.phase = v.into();
8742        self
8743    }
8744
8745    /// Sets the value of [r#type][crate::model::MigrationJob::type].
8746    ///
8747    /// # Example
8748    /// ```ignore,no_run
8749    /// # use google_cloud_clouddms_v1::model::MigrationJob;
8750    /// use google_cloud_clouddms_v1::model::migration_job::Type;
8751    /// let x0 = MigrationJob::new().set_type(Type::OneTime);
8752    /// let x1 = MigrationJob::new().set_type(Type::Continuous);
8753    /// ```
8754    pub fn set_type<T: std::convert::Into<crate::model::migration_job::Type>>(
8755        mut self,
8756        v: T,
8757    ) -> Self {
8758        self.r#type = v.into();
8759        self
8760    }
8761
8762    /// Sets the value of [dump_path][crate::model::MigrationJob::dump_path].
8763    ///
8764    /// # Example
8765    /// ```ignore,no_run
8766    /// # use google_cloud_clouddms_v1::model::MigrationJob;
8767    /// let x = MigrationJob::new().set_dump_path("example");
8768    /// ```
8769    pub fn set_dump_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8770        self.dump_path = v.into();
8771        self
8772    }
8773
8774    /// Sets the value of [dump_flags][crate::model::MigrationJob::dump_flags].
8775    ///
8776    /// # Example
8777    /// ```ignore,no_run
8778    /// # use google_cloud_clouddms_v1::model::MigrationJob;
8779    /// use google_cloud_clouddms_v1::model::migration_job::DumpFlags;
8780    /// let x = MigrationJob::new().set_dump_flags(DumpFlags::default()/* use setters */);
8781    /// ```
8782    pub fn set_dump_flags<T>(mut self, v: T) -> Self
8783    where
8784        T: std::convert::Into<crate::model::migration_job::DumpFlags>,
8785    {
8786        self.dump_flags = std::option::Option::Some(v.into());
8787        self
8788    }
8789
8790    /// Sets or clears the value of [dump_flags][crate::model::MigrationJob::dump_flags].
8791    ///
8792    /// # Example
8793    /// ```ignore,no_run
8794    /// # use google_cloud_clouddms_v1::model::MigrationJob;
8795    /// use google_cloud_clouddms_v1::model::migration_job::DumpFlags;
8796    /// let x = MigrationJob::new().set_or_clear_dump_flags(Some(DumpFlags::default()/* use setters */));
8797    /// let x = MigrationJob::new().set_or_clear_dump_flags(None::<DumpFlags>);
8798    /// ```
8799    pub fn set_or_clear_dump_flags<T>(mut self, v: std::option::Option<T>) -> Self
8800    where
8801        T: std::convert::Into<crate::model::migration_job::DumpFlags>,
8802    {
8803        self.dump_flags = v.map(|x| x.into());
8804        self
8805    }
8806
8807    /// Sets the value of [source][crate::model::MigrationJob::source].
8808    ///
8809    /// # Example
8810    /// ```ignore,no_run
8811    /// # use google_cloud_clouddms_v1::model::MigrationJob;
8812    /// let x = MigrationJob::new().set_source("example");
8813    /// ```
8814    pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8815        self.source = v.into();
8816        self
8817    }
8818
8819    /// Sets the value of [destination][crate::model::MigrationJob::destination].
8820    ///
8821    /// # Example
8822    /// ```ignore,no_run
8823    /// # use google_cloud_clouddms_v1::model::MigrationJob;
8824    /// let x = MigrationJob::new().set_destination("example");
8825    /// ```
8826    pub fn set_destination<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8827        self.destination = v.into();
8828        self
8829    }
8830
8831    /// Sets the value of [duration][crate::model::MigrationJob::duration].
8832    ///
8833    /// # Example
8834    /// ```ignore,no_run
8835    /// # use google_cloud_clouddms_v1::model::MigrationJob;
8836    /// use wkt::Duration;
8837    /// let x = MigrationJob::new().set_duration(Duration::default()/* use setters */);
8838    /// ```
8839    pub fn set_duration<T>(mut self, v: T) -> Self
8840    where
8841        T: std::convert::Into<wkt::Duration>,
8842    {
8843        self.duration = std::option::Option::Some(v.into());
8844        self
8845    }
8846
8847    /// Sets or clears the value of [duration][crate::model::MigrationJob::duration].
8848    ///
8849    /// # Example
8850    /// ```ignore,no_run
8851    /// # use google_cloud_clouddms_v1::model::MigrationJob;
8852    /// use wkt::Duration;
8853    /// let x = MigrationJob::new().set_or_clear_duration(Some(Duration::default()/* use setters */));
8854    /// let x = MigrationJob::new().set_or_clear_duration(None::<Duration>);
8855    /// ```
8856    pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
8857    where
8858        T: std::convert::Into<wkt::Duration>,
8859    {
8860        self.duration = v.map(|x| x.into());
8861        self
8862    }
8863
8864    /// Sets the value of [error][crate::model::MigrationJob::error].
8865    ///
8866    /// # Example
8867    /// ```ignore,no_run
8868    /// # use google_cloud_clouddms_v1::model::MigrationJob;
8869    /// use google_cloud_rpc::model::Status;
8870    /// let x = MigrationJob::new().set_error(Status::default()/* use setters */);
8871    /// ```
8872    pub fn set_error<T>(mut self, v: T) -> Self
8873    where
8874        T: std::convert::Into<google_cloud_rpc::model::Status>,
8875    {
8876        self.error = std::option::Option::Some(v.into());
8877        self
8878    }
8879
8880    /// Sets or clears the value of [error][crate::model::MigrationJob::error].
8881    ///
8882    /// # Example
8883    /// ```ignore,no_run
8884    /// # use google_cloud_clouddms_v1::model::MigrationJob;
8885    /// use google_cloud_rpc::model::Status;
8886    /// let x = MigrationJob::new().set_or_clear_error(Some(Status::default()/* use setters */));
8887    /// let x = MigrationJob::new().set_or_clear_error(None::<Status>);
8888    /// ```
8889    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
8890    where
8891        T: std::convert::Into<google_cloud_rpc::model::Status>,
8892    {
8893        self.error = v.map(|x| x.into());
8894        self
8895    }
8896
8897    /// Sets the value of [source_database][crate::model::MigrationJob::source_database].
8898    ///
8899    /// # Example
8900    /// ```ignore,no_run
8901    /// # use google_cloud_clouddms_v1::model::MigrationJob;
8902    /// use google_cloud_clouddms_v1::model::DatabaseType;
8903    /// let x = MigrationJob::new().set_source_database(DatabaseType::default()/* use setters */);
8904    /// ```
8905    pub fn set_source_database<T>(mut self, v: T) -> Self
8906    where
8907        T: std::convert::Into<crate::model::DatabaseType>,
8908    {
8909        self.source_database = std::option::Option::Some(v.into());
8910        self
8911    }
8912
8913    /// Sets or clears the value of [source_database][crate::model::MigrationJob::source_database].
8914    ///
8915    /// # Example
8916    /// ```ignore,no_run
8917    /// # use google_cloud_clouddms_v1::model::MigrationJob;
8918    /// use google_cloud_clouddms_v1::model::DatabaseType;
8919    /// let x = MigrationJob::new().set_or_clear_source_database(Some(DatabaseType::default()/* use setters */));
8920    /// let x = MigrationJob::new().set_or_clear_source_database(None::<DatabaseType>);
8921    /// ```
8922    pub fn set_or_clear_source_database<T>(mut self, v: std::option::Option<T>) -> Self
8923    where
8924        T: std::convert::Into<crate::model::DatabaseType>,
8925    {
8926        self.source_database = v.map(|x| x.into());
8927        self
8928    }
8929
8930    /// Sets the value of [destination_database][crate::model::MigrationJob::destination_database].
8931    ///
8932    /// # Example
8933    /// ```ignore,no_run
8934    /// # use google_cloud_clouddms_v1::model::MigrationJob;
8935    /// use google_cloud_clouddms_v1::model::DatabaseType;
8936    /// let x = MigrationJob::new().set_destination_database(DatabaseType::default()/* use setters */);
8937    /// ```
8938    pub fn set_destination_database<T>(mut self, v: T) -> Self
8939    where
8940        T: std::convert::Into<crate::model::DatabaseType>,
8941    {
8942        self.destination_database = std::option::Option::Some(v.into());
8943        self
8944    }
8945
8946    /// Sets or clears the value of [destination_database][crate::model::MigrationJob::destination_database].
8947    ///
8948    /// # Example
8949    /// ```ignore,no_run
8950    /// # use google_cloud_clouddms_v1::model::MigrationJob;
8951    /// use google_cloud_clouddms_v1::model::DatabaseType;
8952    /// let x = MigrationJob::new().set_or_clear_destination_database(Some(DatabaseType::default()/* use setters */));
8953    /// let x = MigrationJob::new().set_or_clear_destination_database(None::<DatabaseType>);
8954    /// ```
8955    pub fn set_or_clear_destination_database<T>(mut self, v: std::option::Option<T>) -> Self
8956    where
8957        T: std::convert::Into<crate::model::DatabaseType>,
8958    {
8959        self.destination_database = v.map(|x| x.into());
8960        self
8961    }
8962
8963    /// Sets the value of [end_time][crate::model::MigrationJob::end_time].
8964    ///
8965    /// # Example
8966    /// ```ignore,no_run
8967    /// # use google_cloud_clouddms_v1::model::MigrationJob;
8968    /// use wkt::Timestamp;
8969    /// let x = MigrationJob::new().set_end_time(Timestamp::default()/* use setters */);
8970    /// ```
8971    pub fn set_end_time<T>(mut self, v: T) -> Self
8972    where
8973        T: std::convert::Into<wkt::Timestamp>,
8974    {
8975        self.end_time = std::option::Option::Some(v.into());
8976        self
8977    }
8978
8979    /// Sets or clears the value of [end_time][crate::model::MigrationJob::end_time].
8980    ///
8981    /// # Example
8982    /// ```ignore,no_run
8983    /// # use google_cloud_clouddms_v1::model::MigrationJob;
8984    /// use wkt::Timestamp;
8985    /// let x = MigrationJob::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
8986    /// let x = MigrationJob::new().set_or_clear_end_time(None::<Timestamp>);
8987    /// ```
8988    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8989    where
8990        T: std::convert::Into<wkt::Timestamp>,
8991    {
8992        self.end_time = v.map(|x| x.into());
8993        self
8994    }
8995
8996    /// Sets the value of [conversion_workspace][crate::model::MigrationJob::conversion_workspace].
8997    ///
8998    /// # Example
8999    /// ```ignore,no_run
9000    /// # use google_cloud_clouddms_v1::model::MigrationJob;
9001    /// use google_cloud_clouddms_v1::model::ConversionWorkspaceInfo;
9002    /// let x = MigrationJob::new().set_conversion_workspace(ConversionWorkspaceInfo::default()/* use setters */);
9003    /// ```
9004    pub fn set_conversion_workspace<T>(mut self, v: T) -> Self
9005    where
9006        T: std::convert::Into<crate::model::ConversionWorkspaceInfo>,
9007    {
9008        self.conversion_workspace = std::option::Option::Some(v.into());
9009        self
9010    }
9011
9012    /// Sets or clears the value of [conversion_workspace][crate::model::MigrationJob::conversion_workspace].
9013    ///
9014    /// # Example
9015    /// ```ignore,no_run
9016    /// # use google_cloud_clouddms_v1::model::MigrationJob;
9017    /// use google_cloud_clouddms_v1::model::ConversionWorkspaceInfo;
9018    /// let x = MigrationJob::new().set_or_clear_conversion_workspace(Some(ConversionWorkspaceInfo::default()/* use setters */));
9019    /// let x = MigrationJob::new().set_or_clear_conversion_workspace(None::<ConversionWorkspaceInfo>);
9020    /// ```
9021    pub fn set_or_clear_conversion_workspace<T>(mut self, v: std::option::Option<T>) -> Self
9022    where
9023        T: std::convert::Into<crate::model::ConversionWorkspaceInfo>,
9024    {
9025        self.conversion_workspace = v.map(|x| x.into());
9026        self
9027    }
9028
9029    /// Sets the value of [filter][crate::model::MigrationJob::filter].
9030    ///
9031    /// # Example
9032    /// ```ignore,no_run
9033    /// # use google_cloud_clouddms_v1::model::MigrationJob;
9034    /// let x = MigrationJob::new().set_filter("example");
9035    /// ```
9036    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9037        self.filter = v.into();
9038        self
9039    }
9040
9041    /// Sets the value of [cmek_key_name][crate::model::MigrationJob::cmek_key_name].
9042    ///
9043    /// # Example
9044    /// ```ignore,no_run
9045    /// # use google_cloud_clouddms_v1::model::MigrationJob;
9046    /// let x = MigrationJob::new().set_cmek_key_name("example");
9047    /// ```
9048    pub fn set_cmek_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9049        self.cmek_key_name = v.into();
9050        self
9051    }
9052
9053    /// Sets the value of [performance_config][crate::model::MigrationJob::performance_config].
9054    ///
9055    /// # Example
9056    /// ```ignore,no_run
9057    /// # use google_cloud_clouddms_v1::model::MigrationJob;
9058    /// use google_cloud_clouddms_v1::model::migration_job::PerformanceConfig;
9059    /// let x = MigrationJob::new().set_performance_config(PerformanceConfig::default()/* use setters */);
9060    /// ```
9061    pub fn set_performance_config<T>(mut self, v: T) -> Self
9062    where
9063        T: std::convert::Into<crate::model::migration_job::PerformanceConfig>,
9064    {
9065        self.performance_config = std::option::Option::Some(v.into());
9066        self
9067    }
9068
9069    /// Sets or clears the value of [performance_config][crate::model::MigrationJob::performance_config].
9070    ///
9071    /// # Example
9072    /// ```ignore,no_run
9073    /// # use google_cloud_clouddms_v1::model::MigrationJob;
9074    /// use google_cloud_clouddms_v1::model::migration_job::PerformanceConfig;
9075    /// let x = MigrationJob::new().set_or_clear_performance_config(Some(PerformanceConfig::default()/* use setters */));
9076    /// let x = MigrationJob::new().set_or_clear_performance_config(None::<PerformanceConfig>);
9077    /// ```
9078    pub fn set_or_clear_performance_config<T>(mut self, v: std::option::Option<T>) -> Self
9079    where
9080        T: std::convert::Into<crate::model::migration_job::PerformanceConfig>,
9081    {
9082        self.performance_config = v.map(|x| x.into());
9083        self
9084    }
9085
9086    /// Sets the value of [connectivity][crate::model::MigrationJob::connectivity].
9087    ///
9088    /// Note that all the setters affecting `connectivity` are mutually
9089    /// exclusive.
9090    ///
9091    /// # Example
9092    /// ```ignore,no_run
9093    /// # use google_cloud_clouddms_v1::model::MigrationJob;
9094    /// use google_cloud_clouddms_v1::model::ReverseSshConnectivity;
9095    /// let x = MigrationJob::new().set_connectivity(Some(
9096    ///     google_cloud_clouddms_v1::model::migration_job::Connectivity::ReverseSshConnectivity(ReverseSshConnectivity::default().into())));
9097    /// ```
9098    pub fn set_connectivity<
9099        T: std::convert::Into<std::option::Option<crate::model::migration_job::Connectivity>>,
9100    >(
9101        mut self,
9102        v: T,
9103    ) -> Self {
9104        self.connectivity = v.into();
9105        self
9106    }
9107
9108    /// The value of [connectivity][crate::model::MigrationJob::connectivity]
9109    /// if it holds a `ReverseSshConnectivity`, `None` if the field is not set or
9110    /// holds a different branch.
9111    pub fn reverse_ssh_connectivity(
9112        &self,
9113    ) -> std::option::Option<&std::boxed::Box<crate::model::ReverseSshConnectivity>> {
9114        #[allow(unreachable_patterns)]
9115        self.connectivity.as_ref().and_then(|v| match v {
9116            crate::model::migration_job::Connectivity::ReverseSshConnectivity(v) => {
9117                std::option::Option::Some(v)
9118            }
9119            _ => std::option::Option::None,
9120        })
9121    }
9122
9123    /// Sets the value of [connectivity][crate::model::MigrationJob::connectivity]
9124    /// to hold a `ReverseSshConnectivity`.
9125    ///
9126    /// Note that all the setters affecting `connectivity` are
9127    /// mutually exclusive.
9128    ///
9129    /// # Example
9130    /// ```ignore,no_run
9131    /// # use google_cloud_clouddms_v1::model::MigrationJob;
9132    /// use google_cloud_clouddms_v1::model::ReverseSshConnectivity;
9133    /// let x = MigrationJob::new().set_reverse_ssh_connectivity(ReverseSshConnectivity::default()/* use setters */);
9134    /// assert!(x.reverse_ssh_connectivity().is_some());
9135    /// assert!(x.vpc_peering_connectivity().is_none());
9136    /// assert!(x.static_ip_connectivity().is_none());
9137    /// ```
9138    pub fn set_reverse_ssh_connectivity<
9139        T: std::convert::Into<std::boxed::Box<crate::model::ReverseSshConnectivity>>,
9140    >(
9141        mut self,
9142        v: T,
9143    ) -> Self {
9144        self.connectivity = std::option::Option::Some(
9145            crate::model::migration_job::Connectivity::ReverseSshConnectivity(v.into()),
9146        );
9147        self
9148    }
9149
9150    /// The value of [connectivity][crate::model::MigrationJob::connectivity]
9151    /// if it holds a `VpcPeeringConnectivity`, `None` if the field is not set or
9152    /// holds a different branch.
9153    pub fn vpc_peering_connectivity(
9154        &self,
9155    ) -> std::option::Option<&std::boxed::Box<crate::model::VpcPeeringConnectivity>> {
9156        #[allow(unreachable_patterns)]
9157        self.connectivity.as_ref().and_then(|v| match v {
9158            crate::model::migration_job::Connectivity::VpcPeeringConnectivity(v) => {
9159                std::option::Option::Some(v)
9160            }
9161            _ => std::option::Option::None,
9162        })
9163    }
9164
9165    /// Sets the value of [connectivity][crate::model::MigrationJob::connectivity]
9166    /// to hold a `VpcPeeringConnectivity`.
9167    ///
9168    /// Note that all the setters affecting `connectivity` are
9169    /// mutually exclusive.
9170    ///
9171    /// # Example
9172    /// ```ignore,no_run
9173    /// # use google_cloud_clouddms_v1::model::MigrationJob;
9174    /// use google_cloud_clouddms_v1::model::VpcPeeringConnectivity;
9175    /// let x = MigrationJob::new().set_vpc_peering_connectivity(VpcPeeringConnectivity::default()/* use setters */);
9176    /// assert!(x.vpc_peering_connectivity().is_some());
9177    /// assert!(x.reverse_ssh_connectivity().is_none());
9178    /// assert!(x.static_ip_connectivity().is_none());
9179    /// ```
9180    pub fn set_vpc_peering_connectivity<
9181        T: std::convert::Into<std::boxed::Box<crate::model::VpcPeeringConnectivity>>,
9182    >(
9183        mut self,
9184        v: T,
9185    ) -> Self {
9186        self.connectivity = std::option::Option::Some(
9187            crate::model::migration_job::Connectivity::VpcPeeringConnectivity(v.into()),
9188        );
9189        self
9190    }
9191
9192    /// The value of [connectivity][crate::model::MigrationJob::connectivity]
9193    /// if it holds a `StaticIpConnectivity`, `None` if the field is not set or
9194    /// holds a different branch.
9195    pub fn static_ip_connectivity(
9196        &self,
9197    ) -> std::option::Option<&std::boxed::Box<crate::model::StaticIpConnectivity>> {
9198        #[allow(unreachable_patterns)]
9199        self.connectivity.as_ref().and_then(|v| match v {
9200            crate::model::migration_job::Connectivity::StaticIpConnectivity(v) => {
9201                std::option::Option::Some(v)
9202            }
9203            _ => std::option::Option::None,
9204        })
9205    }
9206
9207    /// Sets the value of [connectivity][crate::model::MigrationJob::connectivity]
9208    /// to hold a `StaticIpConnectivity`.
9209    ///
9210    /// Note that all the setters affecting `connectivity` are
9211    /// mutually exclusive.
9212    ///
9213    /// # Example
9214    /// ```ignore,no_run
9215    /// # use google_cloud_clouddms_v1::model::MigrationJob;
9216    /// use google_cloud_clouddms_v1::model::StaticIpConnectivity;
9217    /// let x = MigrationJob::new().set_static_ip_connectivity(StaticIpConnectivity::default()/* use setters */);
9218    /// assert!(x.static_ip_connectivity().is_some());
9219    /// assert!(x.reverse_ssh_connectivity().is_none());
9220    /// assert!(x.vpc_peering_connectivity().is_none());
9221    /// ```
9222    pub fn set_static_ip_connectivity<
9223        T: std::convert::Into<std::boxed::Box<crate::model::StaticIpConnectivity>>,
9224    >(
9225        mut self,
9226        v: T,
9227    ) -> Self {
9228        self.connectivity = std::option::Option::Some(
9229            crate::model::migration_job::Connectivity::StaticIpConnectivity(v.into()),
9230        );
9231        self
9232    }
9233}
9234
9235impl wkt::message::Message for MigrationJob {
9236    fn typename() -> &'static str {
9237        "type.googleapis.com/google.cloud.clouddms.v1.MigrationJob"
9238    }
9239}
9240
9241/// Defines additional types related to [MigrationJob].
9242pub mod migration_job {
9243    #[allow(unused_imports)]
9244    use super::*;
9245
9246    /// Dump flag definition.
9247    #[derive(Clone, Default, PartialEq)]
9248    #[non_exhaustive]
9249    pub struct DumpFlag {
9250        /// The name of the flag
9251        pub name: std::string::String,
9252
9253        /// The value of the flag.
9254        pub value: std::string::String,
9255
9256        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9257    }
9258
9259    impl DumpFlag {
9260        pub fn new() -> Self {
9261            std::default::Default::default()
9262        }
9263
9264        /// Sets the value of [name][crate::model::migration_job::DumpFlag::name].
9265        ///
9266        /// # Example
9267        /// ```ignore,no_run
9268        /// # use google_cloud_clouddms_v1::model::migration_job::DumpFlag;
9269        /// let x = DumpFlag::new().set_name("example");
9270        /// ```
9271        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9272            self.name = v.into();
9273            self
9274        }
9275
9276        /// Sets the value of [value][crate::model::migration_job::DumpFlag::value].
9277        ///
9278        /// # Example
9279        /// ```ignore,no_run
9280        /// # use google_cloud_clouddms_v1::model::migration_job::DumpFlag;
9281        /// let x = DumpFlag::new().set_value("example");
9282        /// ```
9283        pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9284            self.value = v.into();
9285            self
9286        }
9287    }
9288
9289    impl wkt::message::Message for DumpFlag {
9290        fn typename() -> &'static str {
9291            "type.googleapis.com/google.cloud.clouddms.v1.MigrationJob.DumpFlag"
9292        }
9293    }
9294
9295    /// Dump flags definition.
9296    #[derive(Clone, Default, PartialEq)]
9297    #[non_exhaustive]
9298    pub struct DumpFlags {
9299        /// The flags for the initial dump.
9300        pub dump_flags: std::vec::Vec<crate::model::migration_job::DumpFlag>,
9301
9302        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9303    }
9304
9305    impl DumpFlags {
9306        pub fn new() -> Self {
9307            std::default::Default::default()
9308        }
9309
9310        /// Sets the value of [dump_flags][crate::model::migration_job::DumpFlags::dump_flags].
9311        ///
9312        /// # Example
9313        /// ```ignore,no_run
9314        /// # use google_cloud_clouddms_v1::model::migration_job::DumpFlags;
9315        /// use google_cloud_clouddms_v1::model::migration_job::DumpFlag;
9316        /// let x = DumpFlags::new()
9317        ///     .set_dump_flags([
9318        ///         DumpFlag::default()/* use setters */,
9319        ///         DumpFlag::default()/* use (different) setters */,
9320        ///     ]);
9321        /// ```
9322        pub fn set_dump_flags<T, V>(mut self, v: T) -> Self
9323        where
9324            T: std::iter::IntoIterator<Item = V>,
9325            V: std::convert::Into<crate::model::migration_job::DumpFlag>,
9326        {
9327            use std::iter::Iterator;
9328            self.dump_flags = v.into_iter().map(|i| i.into()).collect();
9329            self
9330        }
9331    }
9332
9333    impl wkt::message::Message for DumpFlags {
9334        fn typename() -> &'static str {
9335            "type.googleapis.com/google.cloud.clouddms.v1.MigrationJob.DumpFlags"
9336        }
9337    }
9338
9339    /// Performance configuration definition.
9340    #[derive(Clone, Default, PartialEq)]
9341    #[non_exhaustive]
9342    pub struct PerformanceConfig {
9343        /// Initial dump parallelism level.
9344        pub dump_parallel_level: crate::model::migration_job::performance_config::DumpParallelLevel,
9345
9346        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9347    }
9348
9349    impl PerformanceConfig {
9350        pub fn new() -> Self {
9351            std::default::Default::default()
9352        }
9353
9354        /// Sets the value of [dump_parallel_level][crate::model::migration_job::PerformanceConfig::dump_parallel_level].
9355        ///
9356        /// # Example
9357        /// ```ignore,no_run
9358        /// # use google_cloud_clouddms_v1::model::migration_job::PerformanceConfig;
9359        /// use google_cloud_clouddms_v1::model::migration_job::performance_config::DumpParallelLevel;
9360        /// let x0 = PerformanceConfig::new().set_dump_parallel_level(DumpParallelLevel::Min);
9361        /// let x1 = PerformanceConfig::new().set_dump_parallel_level(DumpParallelLevel::Optimal);
9362        /// let x2 = PerformanceConfig::new().set_dump_parallel_level(DumpParallelLevel::Max);
9363        /// ```
9364        pub fn set_dump_parallel_level<
9365            T: std::convert::Into<crate::model::migration_job::performance_config::DumpParallelLevel>,
9366        >(
9367            mut self,
9368            v: T,
9369        ) -> Self {
9370            self.dump_parallel_level = v.into();
9371            self
9372        }
9373    }
9374
9375    impl wkt::message::Message for PerformanceConfig {
9376        fn typename() -> &'static str {
9377            "type.googleapis.com/google.cloud.clouddms.v1.MigrationJob.PerformanceConfig"
9378        }
9379    }
9380
9381    /// Defines additional types related to [PerformanceConfig].
9382    pub mod performance_config {
9383        #[allow(unused_imports)]
9384        use super::*;
9385
9386        /// Describes the parallelism level during initial dump.
9387        ///
9388        /// # Working with unknown values
9389        ///
9390        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9391        /// additional enum variants at any time. Adding new variants is not considered
9392        /// a breaking change. Applications should write their code in anticipation of:
9393        ///
9394        /// - New values appearing in future releases of the client library, **and**
9395        /// - New values received dynamically, without application changes.
9396        ///
9397        /// Please consult the [Working with enums] section in the user guide for some
9398        /// guidelines.
9399        ///
9400        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9401        #[derive(Clone, Debug, PartialEq)]
9402        #[non_exhaustive]
9403        pub enum DumpParallelLevel {
9404            /// Unknown dump parallel level. Will be defaulted to OPTIMAL.
9405            Unspecified,
9406            /// Minimal parallel level.
9407            Min,
9408            /// Optimal parallel level.
9409            Optimal,
9410            /// Maximum parallel level.
9411            Max,
9412            /// If set, the enum was initialized with an unknown value.
9413            ///
9414            /// Applications can examine the value using [DumpParallelLevel::value] or
9415            /// [DumpParallelLevel::name].
9416            UnknownValue(dump_parallel_level::UnknownValue),
9417        }
9418
9419        #[doc(hidden)]
9420        pub mod dump_parallel_level {
9421            #[allow(unused_imports)]
9422            use super::*;
9423            #[derive(Clone, Debug, PartialEq)]
9424            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9425        }
9426
9427        impl DumpParallelLevel {
9428            /// Gets the enum value.
9429            ///
9430            /// Returns `None` if the enum contains an unknown value deserialized from
9431            /// the string representation of enums.
9432            pub fn value(&self) -> std::option::Option<i32> {
9433                match self {
9434                    Self::Unspecified => std::option::Option::Some(0),
9435                    Self::Min => std::option::Option::Some(1),
9436                    Self::Optimal => std::option::Option::Some(2),
9437                    Self::Max => std::option::Option::Some(3),
9438                    Self::UnknownValue(u) => u.0.value(),
9439                }
9440            }
9441
9442            /// Gets the enum value as a string.
9443            ///
9444            /// Returns `None` if the enum contains an unknown value deserialized from
9445            /// the integer representation of enums.
9446            pub fn name(&self) -> std::option::Option<&str> {
9447                match self {
9448                    Self::Unspecified => {
9449                        std::option::Option::Some("DUMP_PARALLEL_LEVEL_UNSPECIFIED")
9450                    }
9451                    Self::Min => std::option::Option::Some("MIN"),
9452                    Self::Optimal => std::option::Option::Some("OPTIMAL"),
9453                    Self::Max => std::option::Option::Some("MAX"),
9454                    Self::UnknownValue(u) => u.0.name(),
9455                }
9456            }
9457        }
9458
9459        impl std::default::Default for DumpParallelLevel {
9460            fn default() -> Self {
9461                use std::convert::From;
9462                Self::from(0)
9463            }
9464        }
9465
9466        impl std::fmt::Display for DumpParallelLevel {
9467            fn fmt(
9468                &self,
9469                f: &mut std::fmt::Formatter<'_>,
9470            ) -> std::result::Result<(), std::fmt::Error> {
9471                wkt::internal::display_enum(f, self.name(), self.value())
9472            }
9473        }
9474
9475        impl std::convert::From<i32> for DumpParallelLevel {
9476            fn from(value: i32) -> Self {
9477                match value {
9478                    0 => Self::Unspecified,
9479                    1 => Self::Min,
9480                    2 => Self::Optimal,
9481                    3 => Self::Max,
9482                    _ => Self::UnknownValue(dump_parallel_level::UnknownValue(
9483                        wkt::internal::UnknownEnumValue::Integer(value),
9484                    )),
9485                }
9486            }
9487        }
9488
9489        impl std::convert::From<&str> for DumpParallelLevel {
9490            fn from(value: &str) -> Self {
9491                use std::string::ToString;
9492                match value {
9493                    "DUMP_PARALLEL_LEVEL_UNSPECIFIED" => Self::Unspecified,
9494                    "MIN" => Self::Min,
9495                    "OPTIMAL" => Self::Optimal,
9496                    "MAX" => Self::Max,
9497                    _ => Self::UnknownValue(dump_parallel_level::UnknownValue(
9498                        wkt::internal::UnknownEnumValue::String(value.to_string()),
9499                    )),
9500                }
9501            }
9502        }
9503
9504        impl serde::ser::Serialize for DumpParallelLevel {
9505            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9506            where
9507                S: serde::Serializer,
9508            {
9509                match self {
9510                    Self::Unspecified => serializer.serialize_i32(0),
9511                    Self::Min => serializer.serialize_i32(1),
9512                    Self::Optimal => serializer.serialize_i32(2),
9513                    Self::Max => serializer.serialize_i32(3),
9514                    Self::UnknownValue(u) => u.0.serialize(serializer),
9515                }
9516            }
9517        }
9518
9519        impl<'de> serde::de::Deserialize<'de> for DumpParallelLevel {
9520            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9521            where
9522                D: serde::Deserializer<'de>,
9523            {
9524                deserializer.deserialize_any(wkt::internal::EnumVisitor::<DumpParallelLevel>::new(
9525                    ".google.cloud.clouddms.v1.MigrationJob.PerformanceConfig.DumpParallelLevel",
9526                ))
9527            }
9528        }
9529    }
9530
9531    /// The current migration job states.
9532    ///
9533    /// # Working with unknown values
9534    ///
9535    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9536    /// additional enum variants at any time. Adding new variants is not considered
9537    /// a breaking change. Applications should write their code in anticipation of:
9538    ///
9539    /// - New values appearing in future releases of the client library, **and**
9540    /// - New values received dynamically, without application changes.
9541    ///
9542    /// Please consult the [Working with enums] section in the user guide for some
9543    /// guidelines.
9544    ///
9545    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9546    #[derive(Clone, Debug, PartialEq)]
9547    #[non_exhaustive]
9548    pub enum State {
9549        /// The state of the migration job is unknown.
9550        Unspecified,
9551        /// The migration job is down for maintenance.
9552        Maintenance,
9553        /// The migration job is in draft mode and no resources are created.
9554        Draft,
9555        /// The migration job is being created.
9556        Creating,
9557        /// The migration job is created and not started.
9558        NotStarted,
9559        /// The migration job is running.
9560        Running,
9561        /// The migration job failed.
9562        Failed,
9563        /// The migration job has been completed.
9564        Completed,
9565        /// The migration job is being deleted.
9566        Deleting,
9567        /// The migration job is being stopped.
9568        Stopping,
9569        /// The migration job is currently stopped.
9570        Stopped,
9571        /// The migration job has been deleted.
9572        Deleted,
9573        /// The migration job is being updated.
9574        Updating,
9575        /// The migration job is starting.
9576        Starting,
9577        /// The migration job is restarting.
9578        Restarting,
9579        /// The migration job is resuming.
9580        Resuming,
9581        /// If set, the enum was initialized with an unknown value.
9582        ///
9583        /// Applications can examine the value using [State::value] or
9584        /// [State::name].
9585        UnknownValue(state::UnknownValue),
9586    }
9587
9588    #[doc(hidden)]
9589    pub mod state {
9590        #[allow(unused_imports)]
9591        use super::*;
9592        #[derive(Clone, Debug, PartialEq)]
9593        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9594    }
9595
9596    impl State {
9597        /// Gets the enum value.
9598        ///
9599        /// Returns `None` if the enum contains an unknown value deserialized from
9600        /// the string representation of enums.
9601        pub fn value(&self) -> std::option::Option<i32> {
9602            match self {
9603                Self::Unspecified => std::option::Option::Some(0),
9604                Self::Maintenance => std::option::Option::Some(1),
9605                Self::Draft => std::option::Option::Some(2),
9606                Self::Creating => std::option::Option::Some(3),
9607                Self::NotStarted => std::option::Option::Some(4),
9608                Self::Running => std::option::Option::Some(5),
9609                Self::Failed => std::option::Option::Some(6),
9610                Self::Completed => std::option::Option::Some(7),
9611                Self::Deleting => std::option::Option::Some(8),
9612                Self::Stopping => std::option::Option::Some(9),
9613                Self::Stopped => std::option::Option::Some(10),
9614                Self::Deleted => std::option::Option::Some(11),
9615                Self::Updating => std::option::Option::Some(12),
9616                Self::Starting => std::option::Option::Some(13),
9617                Self::Restarting => std::option::Option::Some(14),
9618                Self::Resuming => std::option::Option::Some(15),
9619                Self::UnknownValue(u) => u.0.value(),
9620            }
9621        }
9622
9623        /// Gets the enum value as a string.
9624        ///
9625        /// Returns `None` if the enum contains an unknown value deserialized from
9626        /// the integer representation of enums.
9627        pub fn name(&self) -> std::option::Option<&str> {
9628            match self {
9629                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9630                Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
9631                Self::Draft => std::option::Option::Some("DRAFT"),
9632                Self::Creating => std::option::Option::Some("CREATING"),
9633                Self::NotStarted => std::option::Option::Some("NOT_STARTED"),
9634                Self::Running => std::option::Option::Some("RUNNING"),
9635                Self::Failed => std::option::Option::Some("FAILED"),
9636                Self::Completed => std::option::Option::Some("COMPLETED"),
9637                Self::Deleting => std::option::Option::Some("DELETING"),
9638                Self::Stopping => std::option::Option::Some("STOPPING"),
9639                Self::Stopped => std::option::Option::Some("STOPPED"),
9640                Self::Deleted => std::option::Option::Some("DELETED"),
9641                Self::Updating => std::option::Option::Some("UPDATING"),
9642                Self::Starting => std::option::Option::Some("STARTING"),
9643                Self::Restarting => std::option::Option::Some("RESTARTING"),
9644                Self::Resuming => std::option::Option::Some("RESUMING"),
9645                Self::UnknownValue(u) => u.0.name(),
9646            }
9647        }
9648    }
9649
9650    impl std::default::Default for State {
9651        fn default() -> Self {
9652            use std::convert::From;
9653            Self::from(0)
9654        }
9655    }
9656
9657    impl std::fmt::Display for State {
9658        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9659            wkt::internal::display_enum(f, self.name(), self.value())
9660        }
9661    }
9662
9663    impl std::convert::From<i32> for State {
9664        fn from(value: i32) -> Self {
9665            match value {
9666                0 => Self::Unspecified,
9667                1 => Self::Maintenance,
9668                2 => Self::Draft,
9669                3 => Self::Creating,
9670                4 => Self::NotStarted,
9671                5 => Self::Running,
9672                6 => Self::Failed,
9673                7 => Self::Completed,
9674                8 => Self::Deleting,
9675                9 => Self::Stopping,
9676                10 => Self::Stopped,
9677                11 => Self::Deleted,
9678                12 => Self::Updating,
9679                13 => Self::Starting,
9680                14 => Self::Restarting,
9681                15 => Self::Resuming,
9682                _ => Self::UnknownValue(state::UnknownValue(
9683                    wkt::internal::UnknownEnumValue::Integer(value),
9684                )),
9685            }
9686        }
9687    }
9688
9689    impl std::convert::From<&str> for State {
9690        fn from(value: &str) -> Self {
9691            use std::string::ToString;
9692            match value {
9693                "STATE_UNSPECIFIED" => Self::Unspecified,
9694                "MAINTENANCE" => Self::Maintenance,
9695                "DRAFT" => Self::Draft,
9696                "CREATING" => Self::Creating,
9697                "NOT_STARTED" => Self::NotStarted,
9698                "RUNNING" => Self::Running,
9699                "FAILED" => Self::Failed,
9700                "COMPLETED" => Self::Completed,
9701                "DELETING" => Self::Deleting,
9702                "STOPPING" => Self::Stopping,
9703                "STOPPED" => Self::Stopped,
9704                "DELETED" => Self::Deleted,
9705                "UPDATING" => Self::Updating,
9706                "STARTING" => Self::Starting,
9707                "RESTARTING" => Self::Restarting,
9708                "RESUMING" => Self::Resuming,
9709                _ => Self::UnknownValue(state::UnknownValue(
9710                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9711                )),
9712            }
9713        }
9714    }
9715
9716    impl serde::ser::Serialize for State {
9717        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9718        where
9719            S: serde::Serializer,
9720        {
9721            match self {
9722                Self::Unspecified => serializer.serialize_i32(0),
9723                Self::Maintenance => serializer.serialize_i32(1),
9724                Self::Draft => serializer.serialize_i32(2),
9725                Self::Creating => serializer.serialize_i32(3),
9726                Self::NotStarted => serializer.serialize_i32(4),
9727                Self::Running => serializer.serialize_i32(5),
9728                Self::Failed => serializer.serialize_i32(6),
9729                Self::Completed => serializer.serialize_i32(7),
9730                Self::Deleting => serializer.serialize_i32(8),
9731                Self::Stopping => serializer.serialize_i32(9),
9732                Self::Stopped => serializer.serialize_i32(10),
9733                Self::Deleted => serializer.serialize_i32(11),
9734                Self::Updating => serializer.serialize_i32(12),
9735                Self::Starting => serializer.serialize_i32(13),
9736                Self::Restarting => serializer.serialize_i32(14),
9737                Self::Resuming => serializer.serialize_i32(15),
9738                Self::UnknownValue(u) => u.0.serialize(serializer),
9739            }
9740        }
9741    }
9742
9743    impl<'de> serde::de::Deserialize<'de> for State {
9744        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9745        where
9746            D: serde::Deserializer<'de>,
9747        {
9748            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9749                ".google.cloud.clouddms.v1.MigrationJob.State",
9750            ))
9751        }
9752    }
9753
9754    /// The current migration job phase.
9755    ///
9756    /// # Working with unknown values
9757    ///
9758    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9759    /// additional enum variants at any time. Adding new variants is not considered
9760    /// a breaking change. Applications should write their code in anticipation of:
9761    ///
9762    /// - New values appearing in future releases of the client library, **and**
9763    /// - New values received dynamically, without application changes.
9764    ///
9765    /// Please consult the [Working with enums] section in the user guide for some
9766    /// guidelines.
9767    ///
9768    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9769    #[derive(Clone, Debug, PartialEq)]
9770    #[non_exhaustive]
9771    pub enum Phase {
9772        /// The phase of the migration job is unknown.
9773        Unspecified,
9774        /// The migration job is in the full dump phase.
9775        FullDump,
9776        /// The migration job is CDC phase.
9777        Cdc,
9778        /// The migration job is running the promote phase.
9779        PromoteInProgress,
9780        /// Only RDS flow - waiting for source writes to stop
9781        WaitingForSourceWritesToStop,
9782        /// Only RDS flow - the sources writes stopped, waiting for dump to begin
9783        PreparingTheDump,
9784        /// If set, the enum was initialized with an unknown value.
9785        ///
9786        /// Applications can examine the value using [Phase::value] or
9787        /// [Phase::name].
9788        UnknownValue(phase::UnknownValue),
9789    }
9790
9791    #[doc(hidden)]
9792    pub mod phase {
9793        #[allow(unused_imports)]
9794        use super::*;
9795        #[derive(Clone, Debug, PartialEq)]
9796        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9797    }
9798
9799    impl Phase {
9800        /// Gets the enum value.
9801        ///
9802        /// Returns `None` if the enum contains an unknown value deserialized from
9803        /// the string representation of enums.
9804        pub fn value(&self) -> std::option::Option<i32> {
9805            match self {
9806                Self::Unspecified => std::option::Option::Some(0),
9807                Self::FullDump => std::option::Option::Some(1),
9808                Self::Cdc => std::option::Option::Some(2),
9809                Self::PromoteInProgress => std::option::Option::Some(3),
9810                Self::WaitingForSourceWritesToStop => std::option::Option::Some(4),
9811                Self::PreparingTheDump => std::option::Option::Some(5),
9812                Self::UnknownValue(u) => u.0.value(),
9813            }
9814        }
9815
9816        /// Gets the enum value as a string.
9817        ///
9818        /// Returns `None` if the enum contains an unknown value deserialized from
9819        /// the integer representation of enums.
9820        pub fn name(&self) -> std::option::Option<&str> {
9821            match self {
9822                Self::Unspecified => std::option::Option::Some("PHASE_UNSPECIFIED"),
9823                Self::FullDump => std::option::Option::Some("FULL_DUMP"),
9824                Self::Cdc => std::option::Option::Some("CDC"),
9825                Self::PromoteInProgress => std::option::Option::Some("PROMOTE_IN_PROGRESS"),
9826                Self::WaitingForSourceWritesToStop => {
9827                    std::option::Option::Some("WAITING_FOR_SOURCE_WRITES_TO_STOP")
9828                }
9829                Self::PreparingTheDump => std::option::Option::Some("PREPARING_THE_DUMP"),
9830                Self::UnknownValue(u) => u.0.name(),
9831            }
9832        }
9833    }
9834
9835    impl std::default::Default for Phase {
9836        fn default() -> Self {
9837            use std::convert::From;
9838            Self::from(0)
9839        }
9840    }
9841
9842    impl std::fmt::Display for Phase {
9843        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9844            wkt::internal::display_enum(f, self.name(), self.value())
9845        }
9846    }
9847
9848    impl std::convert::From<i32> for Phase {
9849        fn from(value: i32) -> Self {
9850            match value {
9851                0 => Self::Unspecified,
9852                1 => Self::FullDump,
9853                2 => Self::Cdc,
9854                3 => Self::PromoteInProgress,
9855                4 => Self::WaitingForSourceWritesToStop,
9856                5 => Self::PreparingTheDump,
9857                _ => Self::UnknownValue(phase::UnknownValue(
9858                    wkt::internal::UnknownEnumValue::Integer(value),
9859                )),
9860            }
9861        }
9862    }
9863
9864    impl std::convert::From<&str> for Phase {
9865        fn from(value: &str) -> Self {
9866            use std::string::ToString;
9867            match value {
9868                "PHASE_UNSPECIFIED" => Self::Unspecified,
9869                "FULL_DUMP" => Self::FullDump,
9870                "CDC" => Self::Cdc,
9871                "PROMOTE_IN_PROGRESS" => Self::PromoteInProgress,
9872                "WAITING_FOR_SOURCE_WRITES_TO_STOP" => Self::WaitingForSourceWritesToStop,
9873                "PREPARING_THE_DUMP" => Self::PreparingTheDump,
9874                _ => Self::UnknownValue(phase::UnknownValue(
9875                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9876                )),
9877            }
9878        }
9879    }
9880
9881    impl serde::ser::Serialize for Phase {
9882        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9883        where
9884            S: serde::Serializer,
9885        {
9886            match self {
9887                Self::Unspecified => serializer.serialize_i32(0),
9888                Self::FullDump => serializer.serialize_i32(1),
9889                Self::Cdc => serializer.serialize_i32(2),
9890                Self::PromoteInProgress => serializer.serialize_i32(3),
9891                Self::WaitingForSourceWritesToStop => serializer.serialize_i32(4),
9892                Self::PreparingTheDump => serializer.serialize_i32(5),
9893                Self::UnknownValue(u) => u.0.serialize(serializer),
9894            }
9895        }
9896    }
9897
9898    impl<'de> serde::de::Deserialize<'de> for Phase {
9899        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9900        where
9901            D: serde::Deserializer<'de>,
9902        {
9903            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Phase>::new(
9904                ".google.cloud.clouddms.v1.MigrationJob.Phase",
9905            ))
9906        }
9907    }
9908
9909    /// The type of migration job (one-time or continuous).
9910    ///
9911    /// # Working with unknown values
9912    ///
9913    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9914    /// additional enum variants at any time. Adding new variants is not considered
9915    /// a breaking change. Applications should write their code in anticipation of:
9916    ///
9917    /// - New values appearing in future releases of the client library, **and**
9918    /// - New values received dynamically, without application changes.
9919    ///
9920    /// Please consult the [Working with enums] section in the user guide for some
9921    /// guidelines.
9922    ///
9923    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9924    #[derive(Clone, Debug, PartialEq)]
9925    #[non_exhaustive]
9926    pub enum Type {
9927        /// The type of the migration job is unknown.
9928        Unspecified,
9929        /// The migration job is a one time migration.
9930        OneTime,
9931        /// The migration job is a continuous migration.
9932        Continuous,
9933        /// If set, the enum was initialized with an unknown value.
9934        ///
9935        /// Applications can examine the value using [Type::value] or
9936        /// [Type::name].
9937        UnknownValue(r#type::UnknownValue),
9938    }
9939
9940    #[doc(hidden)]
9941    pub mod r#type {
9942        #[allow(unused_imports)]
9943        use super::*;
9944        #[derive(Clone, Debug, PartialEq)]
9945        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9946    }
9947
9948    impl Type {
9949        /// Gets the enum value.
9950        ///
9951        /// Returns `None` if the enum contains an unknown value deserialized from
9952        /// the string representation of enums.
9953        pub fn value(&self) -> std::option::Option<i32> {
9954            match self {
9955                Self::Unspecified => std::option::Option::Some(0),
9956                Self::OneTime => std::option::Option::Some(1),
9957                Self::Continuous => std::option::Option::Some(2),
9958                Self::UnknownValue(u) => u.0.value(),
9959            }
9960        }
9961
9962        /// Gets the enum value as a string.
9963        ///
9964        /// Returns `None` if the enum contains an unknown value deserialized from
9965        /// the integer representation of enums.
9966        pub fn name(&self) -> std::option::Option<&str> {
9967            match self {
9968                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
9969                Self::OneTime => std::option::Option::Some("ONE_TIME"),
9970                Self::Continuous => std::option::Option::Some("CONTINUOUS"),
9971                Self::UnknownValue(u) => u.0.name(),
9972            }
9973        }
9974    }
9975
9976    impl std::default::Default for Type {
9977        fn default() -> Self {
9978            use std::convert::From;
9979            Self::from(0)
9980        }
9981    }
9982
9983    impl std::fmt::Display for Type {
9984        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9985            wkt::internal::display_enum(f, self.name(), self.value())
9986        }
9987    }
9988
9989    impl std::convert::From<i32> for Type {
9990        fn from(value: i32) -> Self {
9991            match value {
9992                0 => Self::Unspecified,
9993                1 => Self::OneTime,
9994                2 => Self::Continuous,
9995                _ => Self::UnknownValue(r#type::UnknownValue(
9996                    wkt::internal::UnknownEnumValue::Integer(value),
9997                )),
9998            }
9999        }
10000    }
10001
10002    impl std::convert::From<&str> for Type {
10003        fn from(value: &str) -> Self {
10004            use std::string::ToString;
10005            match value {
10006                "TYPE_UNSPECIFIED" => Self::Unspecified,
10007                "ONE_TIME" => Self::OneTime,
10008                "CONTINUOUS" => Self::Continuous,
10009                _ => Self::UnknownValue(r#type::UnknownValue(
10010                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10011                )),
10012            }
10013        }
10014    }
10015
10016    impl serde::ser::Serialize for Type {
10017        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10018        where
10019            S: serde::Serializer,
10020        {
10021            match self {
10022                Self::Unspecified => serializer.serialize_i32(0),
10023                Self::OneTime => serializer.serialize_i32(1),
10024                Self::Continuous => serializer.serialize_i32(2),
10025                Self::UnknownValue(u) => u.0.serialize(serializer),
10026            }
10027        }
10028    }
10029
10030    impl<'de> serde::de::Deserialize<'de> for Type {
10031        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10032        where
10033            D: serde::Deserializer<'de>,
10034        {
10035            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
10036                ".google.cloud.clouddms.v1.MigrationJob.Type",
10037            ))
10038        }
10039    }
10040
10041    /// The connectivity method.
10042    #[derive(Clone, Debug, PartialEq)]
10043    #[non_exhaustive]
10044    pub enum Connectivity {
10045        /// The details needed to communicate to the source over Reverse SSH
10046        /// tunnel connectivity.
10047        ReverseSshConnectivity(std::boxed::Box<crate::model::ReverseSshConnectivity>),
10048        /// The details of the VPC network that the source database is located in.
10049        VpcPeeringConnectivity(std::boxed::Box<crate::model::VpcPeeringConnectivity>),
10050        /// static ip connectivity data (default, no additional details needed).
10051        StaticIpConnectivity(std::boxed::Box<crate::model::StaticIpConnectivity>),
10052    }
10053}
10054
10055/// A conversion workspace's version.
10056#[derive(Clone, Default, PartialEq)]
10057#[non_exhaustive]
10058pub struct ConversionWorkspaceInfo {
10059    /// The resource name (URI) of the conversion workspace.
10060    pub name: std::string::String,
10061
10062    /// The commit ID of the conversion workspace.
10063    pub commit_id: std::string::String,
10064
10065    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10066}
10067
10068impl ConversionWorkspaceInfo {
10069    pub fn new() -> Self {
10070        std::default::Default::default()
10071    }
10072
10073    /// Sets the value of [name][crate::model::ConversionWorkspaceInfo::name].
10074    ///
10075    /// # Example
10076    /// ```ignore,no_run
10077    /// # use google_cloud_clouddms_v1::model::ConversionWorkspaceInfo;
10078    /// let x = ConversionWorkspaceInfo::new().set_name("example");
10079    /// ```
10080    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10081        self.name = v.into();
10082        self
10083    }
10084
10085    /// Sets the value of [commit_id][crate::model::ConversionWorkspaceInfo::commit_id].
10086    ///
10087    /// # Example
10088    /// ```ignore,no_run
10089    /// # use google_cloud_clouddms_v1::model::ConversionWorkspaceInfo;
10090    /// let x = ConversionWorkspaceInfo::new().set_commit_id("example");
10091    /// ```
10092    pub fn set_commit_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10093        self.commit_id = v.into();
10094        self
10095    }
10096}
10097
10098impl wkt::message::Message for ConversionWorkspaceInfo {
10099    fn typename() -> &'static str {
10100        "type.googleapis.com/google.cloud.clouddms.v1.ConversionWorkspaceInfo"
10101    }
10102}
10103
10104/// A connection profile definition.
10105#[derive(Clone, Default, PartialEq)]
10106#[non_exhaustive]
10107pub struct ConnectionProfile {
10108    /// The name of this connection profile resource in the form of
10109    /// projects/{project}/locations/{location}/connectionProfiles/{connectionProfile}.
10110    pub name: std::string::String,
10111
10112    /// Output only. The timestamp when the resource was created.
10113    /// A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds.
10114    /// Example: "2014-10-02T15:01:23.045123456Z".
10115    pub create_time: std::option::Option<wkt::Timestamp>,
10116
10117    /// Output only. The timestamp when the resource was last updated.
10118    /// A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds.
10119    /// Example: "2014-10-02T15:01:23.045123456Z".
10120    pub update_time: std::option::Option<wkt::Timestamp>,
10121
10122    /// The resource labels for connection profile to use to annotate any related
10123    /// underlying resources such as Compute Engine VMs. An object containing a
10124    /// list of "key": "value" pairs.
10125    ///
10126    /// Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`.
10127    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
10128
10129    /// The current connection profile state (e.g. DRAFT, READY, or FAILED).
10130    pub state: crate::model::connection_profile::State,
10131
10132    /// The connection profile display name.
10133    pub display_name: std::string::String,
10134
10135    /// Output only. The error details in case of state FAILED.
10136    pub error: std::option::Option<google_cloud_rpc::model::Status>,
10137
10138    /// The database provider.
10139    pub provider: crate::model::DatabaseProvider,
10140
10141    /// The connection profile definition.
10142    pub connection_profile:
10143        std::option::Option<crate::model::connection_profile::ConnectionProfile>,
10144
10145    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10146}
10147
10148impl ConnectionProfile {
10149    pub fn new() -> Self {
10150        std::default::Default::default()
10151    }
10152
10153    /// Sets the value of [name][crate::model::ConnectionProfile::name].
10154    ///
10155    /// # Example
10156    /// ```ignore,no_run
10157    /// # use google_cloud_clouddms_v1::model::ConnectionProfile;
10158    /// let x = ConnectionProfile::new().set_name("example");
10159    /// ```
10160    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10161        self.name = v.into();
10162        self
10163    }
10164
10165    /// Sets the value of [create_time][crate::model::ConnectionProfile::create_time].
10166    ///
10167    /// # Example
10168    /// ```ignore,no_run
10169    /// # use google_cloud_clouddms_v1::model::ConnectionProfile;
10170    /// use wkt::Timestamp;
10171    /// let x = ConnectionProfile::new().set_create_time(Timestamp::default()/* use setters */);
10172    /// ```
10173    pub fn set_create_time<T>(mut self, v: T) -> Self
10174    where
10175        T: std::convert::Into<wkt::Timestamp>,
10176    {
10177        self.create_time = std::option::Option::Some(v.into());
10178        self
10179    }
10180
10181    /// Sets or clears the value of [create_time][crate::model::ConnectionProfile::create_time].
10182    ///
10183    /// # Example
10184    /// ```ignore,no_run
10185    /// # use google_cloud_clouddms_v1::model::ConnectionProfile;
10186    /// use wkt::Timestamp;
10187    /// let x = ConnectionProfile::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
10188    /// let x = ConnectionProfile::new().set_or_clear_create_time(None::<Timestamp>);
10189    /// ```
10190    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10191    where
10192        T: std::convert::Into<wkt::Timestamp>,
10193    {
10194        self.create_time = v.map(|x| x.into());
10195        self
10196    }
10197
10198    /// Sets the value of [update_time][crate::model::ConnectionProfile::update_time].
10199    ///
10200    /// # Example
10201    /// ```ignore,no_run
10202    /// # use google_cloud_clouddms_v1::model::ConnectionProfile;
10203    /// use wkt::Timestamp;
10204    /// let x = ConnectionProfile::new().set_update_time(Timestamp::default()/* use setters */);
10205    /// ```
10206    pub fn set_update_time<T>(mut self, v: T) -> Self
10207    where
10208        T: std::convert::Into<wkt::Timestamp>,
10209    {
10210        self.update_time = std::option::Option::Some(v.into());
10211        self
10212    }
10213
10214    /// Sets or clears the value of [update_time][crate::model::ConnectionProfile::update_time].
10215    ///
10216    /// # Example
10217    /// ```ignore,no_run
10218    /// # use google_cloud_clouddms_v1::model::ConnectionProfile;
10219    /// use wkt::Timestamp;
10220    /// let x = ConnectionProfile::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10221    /// let x = ConnectionProfile::new().set_or_clear_update_time(None::<Timestamp>);
10222    /// ```
10223    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10224    where
10225        T: std::convert::Into<wkt::Timestamp>,
10226    {
10227        self.update_time = v.map(|x| x.into());
10228        self
10229    }
10230
10231    /// Sets the value of [labels][crate::model::ConnectionProfile::labels].
10232    ///
10233    /// # Example
10234    /// ```ignore,no_run
10235    /// # use google_cloud_clouddms_v1::model::ConnectionProfile;
10236    /// let x = ConnectionProfile::new().set_labels([
10237    ///     ("key0", "abc"),
10238    ///     ("key1", "xyz"),
10239    /// ]);
10240    /// ```
10241    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
10242    where
10243        T: std::iter::IntoIterator<Item = (K, V)>,
10244        K: std::convert::Into<std::string::String>,
10245        V: std::convert::Into<std::string::String>,
10246    {
10247        use std::iter::Iterator;
10248        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10249        self
10250    }
10251
10252    /// Sets the value of [state][crate::model::ConnectionProfile::state].
10253    ///
10254    /// # Example
10255    /// ```ignore,no_run
10256    /// # use google_cloud_clouddms_v1::model::ConnectionProfile;
10257    /// use google_cloud_clouddms_v1::model::connection_profile::State;
10258    /// let x0 = ConnectionProfile::new().set_state(State::Draft);
10259    /// let x1 = ConnectionProfile::new().set_state(State::Creating);
10260    /// let x2 = ConnectionProfile::new().set_state(State::Ready);
10261    /// ```
10262    pub fn set_state<T: std::convert::Into<crate::model::connection_profile::State>>(
10263        mut self,
10264        v: T,
10265    ) -> Self {
10266        self.state = v.into();
10267        self
10268    }
10269
10270    /// Sets the value of [display_name][crate::model::ConnectionProfile::display_name].
10271    ///
10272    /// # Example
10273    /// ```ignore,no_run
10274    /// # use google_cloud_clouddms_v1::model::ConnectionProfile;
10275    /// let x = ConnectionProfile::new().set_display_name("example");
10276    /// ```
10277    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10278        self.display_name = v.into();
10279        self
10280    }
10281
10282    /// Sets the value of [error][crate::model::ConnectionProfile::error].
10283    ///
10284    /// # Example
10285    /// ```ignore,no_run
10286    /// # use google_cloud_clouddms_v1::model::ConnectionProfile;
10287    /// use google_cloud_rpc::model::Status;
10288    /// let x = ConnectionProfile::new().set_error(Status::default()/* use setters */);
10289    /// ```
10290    pub fn set_error<T>(mut self, v: T) -> Self
10291    where
10292        T: std::convert::Into<google_cloud_rpc::model::Status>,
10293    {
10294        self.error = std::option::Option::Some(v.into());
10295        self
10296    }
10297
10298    /// Sets or clears the value of [error][crate::model::ConnectionProfile::error].
10299    ///
10300    /// # Example
10301    /// ```ignore,no_run
10302    /// # use google_cloud_clouddms_v1::model::ConnectionProfile;
10303    /// use google_cloud_rpc::model::Status;
10304    /// let x = ConnectionProfile::new().set_or_clear_error(Some(Status::default()/* use setters */));
10305    /// let x = ConnectionProfile::new().set_or_clear_error(None::<Status>);
10306    /// ```
10307    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
10308    where
10309        T: std::convert::Into<google_cloud_rpc::model::Status>,
10310    {
10311        self.error = v.map(|x| x.into());
10312        self
10313    }
10314
10315    /// Sets the value of [provider][crate::model::ConnectionProfile::provider].
10316    ///
10317    /// # Example
10318    /// ```ignore,no_run
10319    /// # use google_cloud_clouddms_v1::model::ConnectionProfile;
10320    /// use google_cloud_clouddms_v1::model::DatabaseProvider;
10321    /// let x0 = ConnectionProfile::new().set_provider(DatabaseProvider::Cloudsql);
10322    /// let x1 = ConnectionProfile::new().set_provider(DatabaseProvider::Rds);
10323    /// let x2 = ConnectionProfile::new().set_provider(DatabaseProvider::Aurora);
10324    /// ```
10325    pub fn set_provider<T: std::convert::Into<crate::model::DatabaseProvider>>(
10326        mut self,
10327        v: T,
10328    ) -> Self {
10329        self.provider = v.into();
10330        self
10331    }
10332
10333    /// Sets the value of [connection_profile][crate::model::ConnectionProfile::connection_profile].
10334    ///
10335    /// Note that all the setters affecting `connection_profile` are mutually
10336    /// exclusive.
10337    ///
10338    /// # Example
10339    /// ```ignore,no_run
10340    /// # use google_cloud_clouddms_v1::model::ConnectionProfile;
10341    /// use google_cloud_clouddms_v1::model::MySqlConnectionProfile;
10342    /// let x = ConnectionProfile::new().set_connection_profile(Some(
10343    ///     google_cloud_clouddms_v1::model::connection_profile::ConnectionProfile::Mysql(MySqlConnectionProfile::default().into())));
10344    /// ```
10345    pub fn set_connection_profile<
10346        T: std::convert::Into<
10347                std::option::Option<crate::model::connection_profile::ConnectionProfile>,
10348            >,
10349    >(
10350        mut self,
10351        v: T,
10352    ) -> Self {
10353        self.connection_profile = v.into();
10354        self
10355    }
10356
10357    /// The value of [connection_profile][crate::model::ConnectionProfile::connection_profile]
10358    /// if it holds a `Mysql`, `None` if the field is not set or
10359    /// holds a different branch.
10360    pub fn mysql(
10361        &self,
10362    ) -> std::option::Option<&std::boxed::Box<crate::model::MySqlConnectionProfile>> {
10363        #[allow(unreachable_patterns)]
10364        self.connection_profile.as_ref().and_then(|v| match v {
10365            crate::model::connection_profile::ConnectionProfile::Mysql(v) => {
10366                std::option::Option::Some(v)
10367            }
10368            _ => std::option::Option::None,
10369        })
10370    }
10371
10372    /// Sets the value of [connection_profile][crate::model::ConnectionProfile::connection_profile]
10373    /// to hold a `Mysql`.
10374    ///
10375    /// Note that all the setters affecting `connection_profile` are
10376    /// mutually exclusive.
10377    ///
10378    /// # Example
10379    /// ```ignore,no_run
10380    /// # use google_cloud_clouddms_v1::model::ConnectionProfile;
10381    /// use google_cloud_clouddms_v1::model::MySqlConnectionProfile;
10382    /// let x = ConnectionProfile::new().set_mysql(MySqlConnectionProfile::default()/* use setters */);
10383    /// assert!(x.mysql().is_some());
10384    /// assert!(x.postgresql().is_none());
10385    /// assert!(x.oracle().is_none());
10386    /// assert!(x.cloudsql().is_none());
10387    /// assert!(x.alloydb().is_none());
10388    /// ```
10389    pub fn set_mysql<
10390        T: std::convert::Into<std::boxed::Box<crate::model::MySqlConnectionProfile>>,
10391    >(
10392        mut self,
10393        v: T,
10394    ) -> Self {
10395        self.connection_profile = std::option::Option::Some(
10396            crate::model::connection_profile::ConnectionProfile::Mysql(v.into()),
10397        );
10398        self
10399    }
10400
10401    /// The value of [connection_profile][crate::model::ConnectionProfile::connection_profile]
10402    /// if it holds a `Postgresql`, `None` if the field is not set or
10403    /// holds a different branch.
10404    pub fn postgresql(
10405        &self,
10406    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgreSqlConnectionProfile>> {
10407        #[allow(unreachable_patterns)]
10408        self.connection_profile.as_ref().and_then(|v| match v {
10409            crate::model::connection_profile::ConnectionProfile::Postgresql(v) => {
10410                std::option::Option::Some(v)
10411            }
10412            _ => std::option::Option::None,
10413        })
10414    }
10415
10416    /// Sets the value of [connection_profile][crate::model::ConnectionProfile::connection_profile]
10417    /// to hold a `Postgresql`.
10418    ///
10419    /// Note that all the setters affecting `connection_profile` are
10420    /// mutually exclusive.
10421    ///
10422    /// # Example
10423    /// ```ignore,no_run
10424    /// # use google_cloud_clouddms_v1::model::ConnectionProfile;
10425    /// use google_cloud_clouddms_v1::model::PostgreSqlConnectionProfile;
10426    /// let x = ConnectionProfile::new().set_postgresql(PostgreSqlConnectionProfile::default()/* use setters */);
10427    /// assert!(x.postgresql().is_some());
10428    /// assert!(x.mysql().is_none());
10429    /// assert!(x.oracle().is_none());
10430    /// assert!(x.cloudsql().is_none());
10431    /// assert!(x.alloydb().is_none());
10432    /// ```
10433    pub fn set_postgresql<
10434        T: std::convert::Into<std::boxed::Box<crate::model::PostgreSqlConnectionProfile>>,
10435    >(
10436        mut self,
10437        v: T,
10438    ) -> Self {
10439        self.connection_profile = std::option::Option::Some(
10440            crate::model::connection_profile::ConnectionProfile::Postgresql(v.into()),
10441        );
10442        self
10443    }
10444
10445    /// The value of [connection_profile][crate::model::ConnectionProfile::connection_profile]
10446    /// if it holds a `Oracle`, `None` if the field is not set or
10447    /// holds a different branch.
10448    pub fn oracle(
10449        &self,
10450    ) -> std::option::Option<&std::boxed::Box<crate::model::OracleConnectionProfile>> {
10451        #[allow(unreachable_patterns)]
10452        self.connection_profile.as_ref().and_then(|v| match v {
10453            crate::model::connection_profile::ConnectionProfile::Oracle(v) => {
10454                std::option::Option::Some(v)
10455            }
10456            _ => std::option::Option::None,
10457        })
10458    }
10459
10460    /// Sets the value of [connection_profile][crate::model::ConnectionProfile::connection_profile]
10461    /// to hold a `Oracle`.
10462    ///
10463    /// Note that all the setters affecting `connection_profile` are
10464    /// mutually exclusive.
10465    ///
10466    /// # Example
10467    /// ```ignore,no_run
10468    /// # use google_cloud_clouddms_v1::model::ConnectionProfile;
10469    /// use google_cloud_clouddms_v1::model::OracleConnectionProfile;
10470    /// let x = ConnectionProfile::new().set_oracle(OracleConnectionProfile::default()/* use setters */);
10471    /// assert!(x.oracle().is_some());
10472    /// assert!(x.mysql().is_none());
10473    /// assert!(x.postgresql().is_none());
10474    /// assert!(x.cloudsql().is_none());
10475    /// assert!(x.alloydb().is_none());
10476    /// ```
10477    pub fn set_oracle<
10478        T: std::convert::Into<std::boxed::Box<crate::model::OracleConnectionProfile>>,
10479    >(
10480        mut self,
10481        v: T,
10482    ) -> Self {
10483        self.connection_profile = std::option::Option::Some(
10484            crate::model::connection_profile::ConnectionProfile::Oracle(v.into()),
10485        );
10486        self
10487    }
10488
10489    /// The value of [connection_profile][crate::model::ConnectionProfile::connection_profile]
10490    /// if it holds a `Cloudsql`, `None` if the field is not set or
10491    /// holds a different branch.
10492    pub fn cloudsql(
10493        &self,
10494    ) -> std::option::Option<&std::boxed::Box<crate::model::CloudSqlConnectionProfile>> {
10495        #[allow(unreachable_patterns)]
10496        self.connection_profile.as_ref().and_then(|v| match v {
10497            crate::model::connection_profile::ConnectionProfile::Cloudsql(v) => {
10498                std::option::Option::Some(v)
10499            }
10500            _ => std::option::Option::None,
10501        })
10502    }
10503
10504    /// Sets the value of [connection_profile][crate::model::ConnectionProfile::connection_profile]
10505    /// to hold a `Cloudsql`.
10506    ///
10507    /// Note that all the setters affecting `connection_profile` are
10508    /// mutually exclusive.
10509    ///
10510    /// # Example
10511    /// ```ignore,no_run
10512    /// # use google_cloud_clouddms_v1::model::ConnectionProfile;
10513    /// use google_cloud_clouddms_v1::model::CloudSqlConnectionProfile;
10514    /// let x = ConnectionProfile::new().set_cloudsql(CloudSqlConnectionProfile::default()/* use setters */);
10515    /// assert!(x.cloudsql().is_some());
10516    /// assert!(x.mysql().is_none());
10517    /// assert!(x.postgresql().is_none());
10518    /// assert!(x.oracle().is_none());
10519    /// assert!(x.alloydb().is_none());
10520    /// ```
10521    pub fn set_cloudsql<
10522        T: std::convert::Into<std::boxed::Box<crate::model::CloudSqlConnectionProfile>>,
10523    >(
10524        mut self,
10525        v: T,
10526    ) -> Self {
10527        self.connection_profile = std::option::Option::Some(
10528            crate::model::connection_profile::ConnectionProfile::Cloudsql(v.into()),
10529        );
10530        self
10531    }
10532
10533    /// The value of [connection_profile][crate::model::ConnectionProfile::connection_profile]
10534    /// if it holds a `Alloydb`, `None` if the field is not set or
10535    /// holds a different branch.
10536    pub fn alloydb(
10537        &self,
10538    ) -> std::option::Option<&std::boxed::Box<crate::model::AlloyDbConnectionProfile>> {
10539        #[allow(unreachable_patterns)]
10540        self.connection_profile.as_ref().and_then(|v| match v {
10541            crate::model::connection_profile::ConnectionProfile::Alloydb(v) => {
10542                std::option::Option::Some(v)
10543            }
10544            _ => std::option::Option::None,
10545        })
10546    }
10547
10548    /// Sets the value of [connection_profile][crate::model::ConnectionProfile::connection_profile]
10549    /// to hold a `Alloydb`.
10550    ///
10551    /// Note that all the setters affecting `connection_profile` are
10552    /// mutually exclusive.
10553    ///
10554    /// # Example
10555    /// ```ignore,no_run
10556    /// # use google_cloud_clouddms_v1::model::ConnectionProfile;
10557    /// use google_cloud_clouddms_v1::model::AlloyDbConnectionProfile;
10558    /// let x = ConnectionProfile::new().set_alloydb(AlloyDbConnectionProfile::default()/* use setters */);
10559    /// assert!(x.alloydb().is_some());
10560    /// assert!(x.mysql().is_none());
10561    /// assert!(x.postgresql().is_none());
10562    /// assert!(x.oracle().is_none());
10563    /// assert!(x.cloudsql().is_none());
10564    /// ```
10565    pub fn set_alloydb<
10566        T: std::convert::Into<std::boxed::Box<crate::model::AlloyDbConnectionProfile>>,
10567    >(
10568        mut self,
10569        v: T,
10570    ) -> Self {
10571        self.connection_profile = std::option::Option::Some(
10572            crate::model::connection_profile::ConnectionProfile::Alloydb(v.into()),
10573        );
10574        self
10575    }
10576}
10577
10578impl wkt::message::Message for ConnectionProfile {
10579    fn typename() -> &'static str {
10580        "type.googleapis.com/google.cloud.clouddms.v1.ConnectionProfile"
10581    }
10582}
10583
10584/// Defines additional types related to [ConnectionProfile].
10585pub mod connection_profile {
10586    #[allow(unused_imports)]
10587    use super::*;
10588
10589    /// The current connection profile state (e.g. DRAFT, READY, or FAILED).
10590    ///
10591    /// # Working with unknown values
10592    ///
10593    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10594    /// additional enum variants at any time. Adding new variants is not considered
10595    /// a breaking change. Applications should write their code in anticipation of:
10596    ///
10597    /// - New values appearing in future releases of the client library, **and**
10598    /// - New values received dynamically, without application changes.
10599    ///
10600    /// Please consult the [Working with enums] section in the user guide for some
10601    /// guidelines.
10602    ///
10603    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10604    #[derive(Clone, Debug, PartialEq)]
10605    #[non_exhaustive]
10606    pub enum State {
10607        /// The state of the connection profile is unknown.
10608        Unspecified,
10609        /// The connection profile is in draft mode and fully editable.
10610        Draft,
10611        /// The connection profile is being created.
10612        Creating,
10613        /// The connection profile is ready.
10614        Ready,
10615        /// The connection profile is being updated.
10616        Updating,
10617        /// The connection profile is being deleted.
10618        Deleting,
10619        /// The connection profile has been deleted.
10620        Deleted,
10621        /// The last action on the connection profile failed.
10622        Failed,
10623        /// If set, the enum was initialized with an unknown value.
10624        ///
10625        /// Applications can examine the value using [State::value] or
10626        /// [State::name].
10627        UnknownValue(state::UnknownValue),
10628    }
10629
10630    #[doc(hidden)]
10631    pub mod state {
10632        #[allow(unused_imports)]
10633        use super::*;
10634        #[derive(Clone, Debug, PartialEq)]
10635        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10636    }
10637
10638    impl State {
10639        /// Gets the enum value.
10640        ///
10641        /// Returns `None` if the enum contains an unknown value deserialized from
10642        /// the string representation of enums.
10643        pub fn value(&self) -> std::option::Option<i32> {
10644            match self {
10645                Self::Unspecified => std::option::Option::Some(0),
10646                Self::Draft => std::option::Option::Some(1),
10647                Self::Creating => std::option::Option::Some(2),
10648                Self::Ready => std::option::Option::Some(3),
10649                Self::Updating => std::option::Option::Some(4),
10650                Self::Deleting => std::option::Option::Some(5),
10651                Self::Deleted => std::option::Option::Some(6),
10652                Self::Failed => std::option::Option::Some(7),
10653                Self::UnknownValue(u) => u.0.value(),
10654            }
10655        }
10656
10657        /// Gets the enum value as a string.
10658        ///
10659        /// Returns `None` if the enum contains an unknown value deserialized from
10660        /// the integer representation of enums.
10661        pub fn name(&self) -> std::option::Option<&str> {
10662            match self {
10663                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
10664                Self::Draft => std::option::Option::Some("DRAFT"),
10665                Self::Creating => std::option::Option::Some("CREATING"),
10666                Self::Ready => std::option::Option::Some("READY"),
10667                Self::Updating => std::option::Option::Some("UPDATING"),
10668                Self::Deleting => std::option::Option::Some("DELETING"),
10669                Self::Deleted => std::option::Option::Some("DELETED"),
10670                Self::Failed => std::option::Option::Some("FAILED"),
10671                Self::UnknownValue(u) => u.0.name(),
10672            }
10673        }
10674    }
10675
10676    impl std::default::Default for State {
10677        fn default() -> Self {
10678            use std::convert::From;
10679            Self::from(0)
10680        }
10681    }
10682
10683    impl std::fmt::Display for State {
10684        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10685            wkt::internal::display_enum(f, self.name(), self.value())
10686        }
10687    }
10688
10689    impl std::convert::From<i32> for State {
10690        fn from(value: i32) -> Self {
10691            match value {
10692                0 => Self::Unspecified,
10693                1 => Self::Draft,
10694                2 => Self::Creating,
10695                3 => Self::Ready,
10696                4 => Self::Updating,
10697                5 => Self::Deleting,
10698                6 => Self::Deleted,
10699                7 => Self::Failed,
10700                _ => Self::UnknownValue(state::UnknownValue(
10701                    wkt::internal::UnknownEnumValue::Integer(value),
10702                )),
10703            }
10704        }
10705    }
10706
10707    impl std::convert::From<&str> for State {
10708        fn from(value: &str) -> Self {
10709            use std::string::ToString;
10710            match value {
10711                "STATE_UNSPECIFIED" => Self::Unspecified,
10712                "DRAFT" => Self::Draft,
10713                "CREATING" => Self::Creating,
10714                "READY" => Self::Ready,
10715                "UPDATING" => Self::Updating,
10716                "DELETING" => Self::Deleting,
10717                "DELETED" => Self::Deleted,
10718                "FAILED" => Self::Failed,
10719                _ => Self::UnknownValue(state::UnknownValue(
10720                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10721                )),
10722            }
10723        }
10724    }
10725
10726    impl serde::ser::Serialize for State {
10727        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10728        where
10729            S: serde::Serializer,
10730        {
10731            match self {
10732                Self::Unspecified => serializer.serialize_i32(0),
10733                Self::Draft => serializer.serialize_i32(1),
10734                Self::Creating => serializer.serialize_i32(2),
10735                Self::Ready => serializer.serialize_i32(3),
10736                Self::Updating => serializer.serialize_i32(4),
10737                Self::Deleting => serializer.serialize_i32(5),
10738                Self::Deleted => serializer.serialize_i32(6),
10739                Self::Failed => serializer.serialize_i32(7),
10740                Self::UnknownValue(u) => u.0.serialize(serializer),
10741            }
10742        }
10743    }
10744
10745    impl<'de> serde::de::Deserialize<'de> for State {
10746        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10747        where
10748            D: serde::Deserializer<'de>,
10749        {
10750            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10751                ".google.cloud.clouddms.v1.ConnectionProfile.State",
10752            ))
10753        }
10754    }
10755
10756    /// The connection profile definition.
10757    #[derive(Clone, Debug, PartialEq)]
10758    #[non_exhaustive]
10759    pub enum ConnectionProfile {
10760        /// A MySQL database connection profile.
10761        Mysql(std::boxed::Box<crate::model::MySqlConnectionProfile>),
10762        /// A PostgreSQL database connection profile.
10763        Postgresql(std::boxed::Box<crate::model::PostgreSqlConnectionProfile>),
10764        /// An Oracle database connection profile.
10765        Oracle(std::boxed::Box<crate::model::OracleConnectionProfile>),
10766        /// A CloudSQL database connection profile.
10767        Cloudsql(std::boxed::Box<crate::model::CloudSqlConnectionProfile>),
10768        /// An AlloyDB cluster connection profile.
10769        Alloydb(std::boxed::Box<crate::model::AlloyDbConnectionProfile>),
10770    }
10771}
10772
10773/// Error message of a verification Migration job.
10774#[derive(Clone, Default, PartialEq)]
10775#[non_exhaustive]
10776pub struct MigrationJobVerificationError {
10777    /// Output only. An instance of ErrorCode specifying the error that occurred.
10778    pub error_code: crate::model::migration_job_verification_error::ErrorCode,
10779
10780    /// Output only. A formatted message with further details about the error and a
10781    /// CTA.
10782    pub error_message: std::string::String,
10783
10784    /// Output only. A specific detailed error message, if supplied by the engine.
10785    pub error_detail_message: std::string::String,
10786
10787    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10788}
10789
10790impl MigrationJobVerificationError {
10791    pub fn new() -> Self {
10792        std::default::Default::default()
10793    }
10794
10795    /// Sets the value of [error_code][crate::model::MigrationJobVerificationError::error_code].
10796    ///
10797    /// # Example
10798    /// ```ignore,no_run
10799    /// # use google_cloud_clouddms_v1::model::MigrationJobVerificationError;
10800    /// use google_cloud_clouddms_v1::model::migration_job_verification_error::ErrorCode;
10801    /// let x0 = MigrationJobVerificationError::new().set_error_code(ErrorCode::ConnectionFailure);
10802    /// let x1 = MigrationJobVerificationError::new().set_error_code(ErrorCode::AuthenticationFailure);
10803    /// let x2 = MigrationJobVerificationError::new().set_error_code(ErrorCode::InvalidConnectionProfileConfig);
10804    /// ```
10805    pub fn set_error_code<
10806        T: std::convert::Into<crate::model::migration_job_verification_error::ErrorCode>,
10807    >(
10808        mut self,
10809        v: T,
10810    ) -> Self {
10811        self.error_code = v.into();
10812        self
10813    }
10814
10815    /// Sets the value of [error_message][crate::model::MigrationJobVerificationError::error_message].
10816    ///
10817    /// # Example
10818    /// ```ignore,no_run
10819    /// # use google_cloud_clouddms_v1::model::MigrationJobVerificationError;
10820    /// let x = MigrationJobVerificationError::new().set_error_message("example");
10821    /// ```
10822    pub fn set_error_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10823        self.error_message = v.into();
10824        self
10825    }
10826
10827    /// Sets the value of [error_detail_message][crate::model::MigrationJobVerificationError::error_detail_message].
10828    ///
10829    /// # Example
10830    /// ```ignore,no_run
10831    /// # use google_cloud_clouddms_v1::model::MigrationJobVerificationError;
10832    /// let x = MigrationJobVerificationError::new().set_error_detail_message("example");
10833    /// ```
10834    pub fn set_error_detail_message<T: std::convert::Into<std::string::String>>(
10835        mut self,
10836        v: T,
10837    ) -> Self {
10838        self.error_detail_message = v.into();
10839        self
10840    }
10841}
10842
10843impl wkt::message::Message for MigrationJobVerificationError {
10844    fn typename() -> &'static str {
10845        "type.googleapis.com/google.cloud.clouddms.v1.MigrationJobVerificationError"
10846    }
10847}
10848
10849/// Defines additional types related to [MigrationJobVerificationError].
10850pub mod migration_job_verification_error {
10851    #[allow(unused_imports)]
10852    use super::*;
10853
10854    /// A general error code describing the type of error that occurred.
10855    ///
10856    /// # Working with unknown values
10857    ///
10858    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10859    /// additional enum variants at any time. Adding new variants is not considered
10860    /// a breaking change. Applications should write their code in anticipation of:
10861    ///
10862    /// - New values appearing in future releases of the client library, **and**
10863    /// - New values received dynamically, without application changes.
10864    ///
10865    /// Please consult the [Working with enums] section in the user guide for some
10866    /// guidelines.
10867    ///
10868    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10869    #[derive(Clone, Debug, PartialEq)]
10870    #[non_exhaustive]
10871    pub enum ErrorCode {
10872        /// An unknown error occurred
10873        Unspecified,
10874        /// We failed to connect to one of the connection profile.
10875        ConnectionFailure,
10876        /// We failed to authenticate to one of the connection profile.
10877        AuthenticationFailure,
10878        /// One of the involved connection profiles has an invalid configuration.
10879        InvalidConnectionProfileConfig,
10880        /// The versions of the source and the destination are incompatible.
10881        VersionIncompatibility,
10882        /// The types of the source and the destination are incompatible.
10883        ConnectionProfileTypesIncompatibility,
10884        /// No pglogical extension installed on databases, applicable for postgres.
10885        NoPglogicalInstalled,
10886        /// pglogical node already exists on databases, applicable for postgres.
10887        PglogicalNodeAlreadyExists,
10888        /// The value of parameter wal_level is not set to logical.
10889        InvalidWalLevel,
10890        /// The value of parameter shared_preload_libraries does not include
10891        /// pglogical.
10892        InvalidSharedPreloadLibrary,
10893        /// The value of parameter max_replication_slots is not sufficient.
10894        InsufficientMaxReplicationSlots,
10895        /// The value of parameter max_wal_senders is not sufficient.
10896        InsufficientMaxWalSenders,
10897        /// The value of parameter max_worker_processes is not sufficient.
10898        InsufficientMaxWorkerProcesses,
10899        /// Extensions installed are either not supported or having unsupported
10900        /// versions.
10901        UnsupportedExtensions,
10902        /// Unsupported migration type.
10903        UnsupportedMigrationType,
10904        /// Invalid RDS logical replication.
10905        InvalidRdsLogicalReplication,
10906        /// The gtid_mode is not supported, applicable for MySQL.
10907        UnsupportedGtidMode,
10908        /// The table definition is not support due to missing primary key or replica
10909        /// identity.
10910        UnsupportedTableDefinition,
10911        /// The definer is not supported.
10912        UnsupportedDefiner,
10913        /// Migration is already running at the time of restart request.
10914        CantRestartRunningMigration,
10915        /// The source already has a replication setup.
10916        SourceAlreadySetup,
10917        /// The source has tables with limited support.
10918        /// E.g. PostgreSQL tables without primary keys.
10919        TablesWithLimitedSupport,
10920        /// The source uses an unsupported locale.
10921        UnsupportedDatabaseLocale,
10922        /// The source uses an unsupported Foreign Data Wrapper configuration.
10923        UnsupportedDatabaseFdwConfig,
10924        /// There was an underlying RDBMS error.
10925        ErrorRdbms,
10926        /// The source DB size in Bytes exceeds a certain threshold. The migration
10927        /// might require an increase of quota, or might not be supported.
10928        SourceSizeExceedsThreshold,
10929        /// The destination DB contains existing databases that are conflicting with
10930        /// those in the source DB.
10931        ExistingConflictingDatabases,
10932        /// Insufficient privilege to enable the parallelism configuration.
10933        ParallelImportInsufficientPrivilege,
10934        /// If set, the enum was initialized with an unknown value.
10935        ///
10936        /// Applications can examine the value using [ErrorCode::value] or
10937        /// [ErrorCode::name].
10938        UnknownValue(error_code::UnknownValue),
10939    }
10940
10941    #[doc(hidden)]
10942    pub mod error_code {
10943        #[allow(unused_imports)]
10944        use super::*;
10945        #[derive(Clone, Debug, PartialEq)]
10946        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10947    }
10948
10949    impl ErrorCode {
10950        /// Gets the enum value.
10951        ///
10952        /// Returns `None` if the enum contains an unknown value deserialized from
10953        /// the string representation of enums.
10954        pub fn value(&self) -> std::option::Option<i32> {
10955            match self {
10956                Self::Unspecified => std::option::Option::Some(0),
10957                Self::ConnectionFailure => std::option::Option::Some(1),
10958                Self::AuthenticationFailure => std::option::Option::Some(2),
10959                Self::InvalidConnectionProfileConfig => std::option::Option::Some(3),
10960                Self::VersionIncompatibility => std::option::Option::Some(4),
10961                Self::ConnectionProfileTypesIncompatibility => std::option::Option::Some(5),
10962                Self::NoPglogicalInstalled => std::option::Option::Some(7),
10963                Self::PglogicalNodeAlreadyExists => std::option::Option::Some(8),
10964                Self::InvalidWalLevel => std::option::Option::Some(9),
10965                Self::InvalidSharedPreloadLibrary => std::option::Option::Some(10),
10966                Self::InsufficientMaxReplicationSlots => std::option::Option::Some(11),
10967                Self::InsufficientMaxWalSenders => std::option::Option::Some(12),
10968                Self::InsufficientMaxWorkerProcesses => std::option::Option::Some(13),
10969                Self::UnsupportedExtensions => std::option::Option::Some(14),
10970                Self::UnsupportedMigrationType => std::option::Option::Some(15),
10971                Self::InvalidRdsLogicalReplication => std::option::Option::Some(16),
10972                Self::UnsupportedGtidMode => std::option::Option::Some(17),
10973                Self::UnsupportedTableDefinition => std::option::Option::Some(18),
10974                Self::UnsupportedDefiner => std::option::Option::Some(19),
10975                Self::CantRestartRunningMigration => std::option::Option::Some(21),
10976                Self::SourceAlreadySetup => std::option::Option::Some(23),
10977                Self::TablesWithLimitedSupport => std::option::Option::Some(24),
10978                Self::UnsupportedDatabaseLocale => std::option::Option::Some(25),
10979                Self::UnsupportedDatabaseFdwConfig => std::option::Option::Some(26),
10980                Self::ErrorRdbms => std::option::Option::Some(27),
10981                Self::SourceSizeExceedsThreshold => std::option::Option::Some(28),
10982                Self::ExistingConflictingDatabases => std::option::Option::Some(29),
10983                Self::ParallelImportInsufficientPrivilege => std::option::Option::Some(30),
10984                Self::UnknownValue(u) => u.0.value(),
10985            }
10986        }
10987
10988        /// Gets the enum value as a string.
10989        ///
10990        /// Returns `None` if the enum contains an unknown value deserialized from
10991        /// the integer representation of enums.
10992        pub fn name(&self) -> std::option::Option<&str> {
10993            match self {
10994                Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
10995                Self::ConnectionFailure => std::option::Option::Some("CONNECTION_FAILURE"),
10996                Self::AuthenticationFailure => std::option::Option::Some("AUTHENTICATION_FAILURE"),
10997                Self::InvalidConnectionProfileConfig => {
10998                    std::option::Option::Some("INVALID_CONNECTION_PROFILE_CONFIG")
10999                }
11000                Self::VersionIncompatibility => {
11001                    std::option::Option::Some("VERSION_INCOMPATIBILITY")
11002                }
11003                Self::ConnectionProfileTypesIncompatibility => {
11004                    std::option::Option::Some("CONNECTION_PROFILE_TYPES_INCOMPATIBILITY")
11005                }
11006                Self::NoPglogicalInstalled => std::option::Option::Some("NO_PGLOGICAL_INSTALLED"),
11007                Self::PglogicalNodeAlreadyExists => {
11008                    std::option::Option::Some("PGLOGICAL_NODE_ALREADY_EXISTS")
11009                }
11010                Self::InvalidWalLevel => std::option::Option::Some("INVALID_WAL_LEVEL"),
11011                Self::InvalidSharedPreloadLibrary => {
11012                    std::option::Option::Some("INVALID_SHARED_PRELOAD_LIBRARY")
11013                }
11014                Self::InsufficientMaxReplicationSlots => {
11015                    std::option::Option::Some("INSUFFICIENT_MAX_REPLICATION_SLOTS")
11016                }
11017                Self::InsufficientMaxWalSenders => {
11018                    std::option::Option::Some("INSUFFICIENT_MAX_WAL_SENDERS")
11019                }
11020                Self::InsufficientMaxWorkerProcesses => {
11021                    std::option::Option::Some("INSUFFICIENT_MAX_WORKER_PROCESSES")
11022                }
11023                Self::UnsupportedExtensions => std::option::Option::Some("UNSUPPORTED_EXTENSIONS"),
11024                Self::UnsupportedMigrationType => {
11025                    std::option::Option::Some("UNSUPPORTED_MIGRATION_TYPE")
11026                }
11027                Self::InvalidRdsLogicalReplication => {
11028                    std::option::Option::Some("INVALID_RDS_LOGICAL_REPLICATION")
11029                }
11030                Self::UnsupportedGtidMode => std::option::Option::Some("UNSUPPORTED_GTID_MODE"),
11031                Self::UnsupportedTableDefinition => {
11032                    std::option::Option::Some("UNSUPPORTED_TABLE_DEFINITION")
11033                }
11034                Self::UnsupportedDefiner => std::option::Option::Some("UNSUPPORTED_DEFINER"),
11035                Self::CantRestartRunningMigration => {
11036                    std::option::Option::Some("CANT_RESTART_RUNNING_MIGRATION")
11037                }
11038                Self::SourceAlreadySetup => std::option::Option::Some("SOURCE_ALREADY_SETUP"),
11039                Self::TablesWithLimitedSupport => {
11040                    std::option::Option::Some("TABLES_WITH_LIMITED_SUPPORT")
11041                }
11042                Self::UnsupportedDatabaseLocale => {
11043                    std::option::Option::Some("UNSUPPORTED_DATABASE_LOCALE")
11044                }
11045                Self::UnsupportedDatabaseFdwConfig => {
11046                    std::option::Option::Some("UNSUPPORTED_DATABASE_FDW_CONFIG")
11047                }
11048                Self::ErrorRdbms => std::option::Option::Some("ERROR_RDBMS"),
11049                Self::SourceSizeExceedsThreshold => {
11050                    std::option::Option::Some("SOURCE_SIZE_EXCEEDS_THRESHOLD")
11051                }
11052                Self::ExistingConflictingDatabases => {
11053                    std::option::Option::Some("EXISTING_CONFLICTING_DATABASES")
11054                }
11055                Self::ParallelImportInsufficientPrivilege => {
11056                    std::option::Option::Some("PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE")
11057                }
11058                Self::UnknownValue(u) => u.0.name(),
11059            }
11060        }
11061    }
11062
11063    impl std::default::Default for ErrorCode {
11064        fn default() -> Self {
11065            use std::convert::From;
11066            Self::from(0)
11067        }
11068    }
11069
11070    impl std::fmt::Display for ErrorCode {
11071        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11072            wkt::internal::display_enum(f, self.name(), self.value())
11073        }
11074    }
11075
11076    impl std::convert::From<i32> for ErrorCode {
11077        fn from(value: i32) -> Self {
11078            match value {
11079                0 => Self::Unspecified,
11080                1 => Self::ConnectionFailure,
11081                2 => Self::AuthenticationFailure,
11082                3 => Self::InvalidConnectionProfileConfig,
11083                4 => Self::VersionIncompatibility,
11084                5 => Self::ConnectionProfileTypesIncompatibility,
11085                7 => Self::NoPglogicalInstalled,
11086                8 => Self::PglogicalNodeAlreadyExists,
11087                9 => Self::InvalidWalLevel,
11088                10 => Self::InvalidSharedPreloadLibrary,
11089                11 => Self::InsufficientMaxReplicationSlots,
11090                12 => Self::InsufficientMaxWalSenders,
11091                13 => Self::InsufficientMaxWorkerProcesses,
11092                14 => Self::UnsupportedExtensions,
11093                15 => Self::UnsupportedMigrationType,
11094                16 => Self::InvalidRdsLogicalReplication,
11095                17 => Self::UnsupportedGtidMode,
11096                18 => Self::UnsupportedTableDefinition,
11097                19 => Self::UnsupportedDefiner,
11098                21 => Self::CantRestartRunningMigration,
11099                23 => Self::SourceAlreadySetup,
11100                24 => Self::TablesWithLimitedSupport,
11101                25 => Self::UnsupportedDatabaseLocale,
11102                26 => Self::UnsupportedDatabaseFdwConfig,
11103                27 => Self::ErrorRdbms,
11104                28 => Self::SourceSizeExceedsThreshold,
11105                29 => Self::ExistingConflictingDatabases,
11106                30 => Self::ParallelImportInsufficientPrivilege,
11107                _ => Self::UnknownValue(error_code::UnknownValue(
11108                    wkt::internal::UnknownEnumValue::Integer(value),
11109                )),
11110            }
11111        }
11112    }
11113
11114    impl std::convert::From<&str> for ErrorCode {
11115        fn from(value: &str) -> Self {
11116            use std::string::ToString;
11117            match value {
11118                "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
11119                "CONNECTION_FAILURE" => Self::ConnectionFailure,
11120                "AUTHENTICATION_FAILURE" => Self::AuthenticationFailure,
11121                "INVALID_CONNECTION_PROFILE_CONFIG" => Self::InvalidConnectionProfileConfig,
11122                "VERSION_INCOMPATIBILITY" => Self::VersionIncompatibility,
11123                "CONNECTION_PROFILE_TYPES_INCOMPATIBILITY" => {
11124                    Self::ConnectionProfileTypesIncompatibility
11125                }
11126                "NO_PGLOGICAL_INSTALLED" => Self::NoPglogicalInstalled,
11127                "PGLOGICAL_NODE_ALREADY_EXISTS" => Self::PglogicalNodeAlreadyExists,
11128                "INVALID_WAL_LEVEL" => Self::InvalidWalLevel,
11129                "INVALID_SHARED_PRELOAD_LIBRARY" => Self::InvalidSharedPreloadLibrary,
11130                "INSUFFICIENT_MAX_REPLICATION_SLOTS" => Self::InsufficientMaxReplicationSlots,
11131                "INSUFFICIENT_MAX_WAL_SENDERS" => Self::InsufficientMaxWalSenders,
11132                "INSUFFICIENT_MAX_WORKER_PROCESSES" => Self::InsufficientMaxWorkerProcesses,
11133                "UNSUPPORTED_EXTENSIONS" => Self::UnsupportedExtensions,
11134                "UNSUPPORTED_MIGRATION_TYPE" => Self::UnsupportedMigrationType,
11135                "INVALID_RDS_LOGICAL_REPLICATION" => Self::InvalidRdsLogicalReplication,
11136                "UNSUPPORTED_GTID_MODE" => Self::UnsupportedGtidMode,
11137                "UNSUPPORTED_TABLE_DEFINITION" => Self::UnsupportedTableDefinition,
11138                "UNSUPPORTED_DEFINER" => Self::UnsupportedDefiner,
11139                "CANT_RESTART_RUNNING_MIGRATION" => Self::CantRestartRunningMigration,
11140                "SOURCE_ALREADY_SETUP" => Self::SourceAlreadySetup,
11141                "TABLES_WITH_LIMITED_SUPPORT" => Self::TablesWithLimitedSupport,
11142                "UNSUPPORTED_DATABASE_LOCALE" => Self::UnsupportedDatabaseLocale,
11143                "UNSUPPORTED_DATABASE_FDW_CONFIG" => Self::UnsupportedDatabaseFdwConfig,
11144                "ERROR_RDBMS" => Self::ErrorRdbms,
11145                "SOURCE_SIZE_EXCEEDS_THRESHOLD" => Self::SourceSizeExceedsThreshold,
11146                "EXISTING_CONFLICTING_DATABASES" => Self::ExistingConflictingDatabases,
11147                "PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE" => {
11148                    Self::ParallelImportInsufficientPrivilege
11149                }
11150                _ => Self::UnknownValue(error_code::UnknownValue(
11151                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11152                )),
11153            }
11154        }
11155    }
11156
11157    impl serde::ser::Serialize for ErrorCode {
11158        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11159        where
11160            S: serde::Serializer,
11161        {
11162            match self {
11163                Self::Unspecified => serializer.serialize_i32(0),
11164                Self::ConnectionFailure => serializer.serialize_i32(1),
11165                Self::AuthenticationFailure => serializer.serialize_i32(2),
11166                Self::InvalidConnectionProfileConfig => serializer.serialize_i32(3),
11167                Self::VersionIncompatibility => serializer.serialize_i32(4),
11168                Self::ConnectionProfileTypesIncompatibility => serializer.serialize_i32(5),
11169                Self::NoPglogicalInstalled => serializer.serialize_i32(7),
11170                Self::PglogicalNodeAlreadyExists => serializer.serialize_i32(8),
11171                Self::InvalidWalLevel => serializer.serialize_i32(9),
11172                Self::InvalidSharedPreloadLibrary => serializer.serialize_i32(10),
11173                Self::InsufficientMaxReplicationSlots => serializer.serialize_i32(11),
11174                Self::InsufficientMaxWalSenders => serializer.serialize_i32(12),
11175                Self::InsufficientMaxWorkerProcesses => serializer.serialize_i32(13),
11176                Self::UnsupportedExtensions => serializer.serialize_i32(14),
11177                Self::UnsupportedMigrationType => serializer.serialize_i32(15),
11178                Self::InvalidRdsLogicalReplication => serializer.serialize_i32(16),
11179                Self::UnsupportedGtidMode => serializer.serialize_i32(17),
11180                Self::UnsupportedTableDefinition => serializer.serialize_i32(18),
11181                Self::UnsupportedDefiner => serializer.serialize_i32(19),
11182                Self::CantRestartRunningMigration => serializer.serialize_i32(21),
11183                Self::SourceAlreadySetup => serializer.serialize_i32(23),
11184                Self::TablesWithLimitedSupport => serializer.serialize_i32(24),
11185                Self::UnsupportedDatabaseLocale => serializer.serialize_i32(25),
11186                Self::UnsupportedDatabaseFdwConfig => serializer.serialize_i32(26),
11187                Self::ErrorRdbms => serializer.serialize_i32(27),
11188                Self::SourceSizeExceedsThreshold => serializer.serialize_i32(28),
11189                Self::ExistingConflictingDatabases => serializer.serialize_i32(29),
11190                Self::ParallelImportInsufficientPrivilege => serializer.serialize_i32(30),
11191                Self::UnknownValue(u) => u.0.serialize(serializer),
11192            }
11193        }
11194    }
11195
11196    impl<'de> serde::de::Deserialize<'de> for ErrorCode {
11197        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11198        where
11199            D: serde::Deserializer<'de>,
11200        {
11201            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
11202                ".google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode",
11203            ))
11204        }
11205    }
11206}
11207
11208/// The PrivateConnection resource is used to establish private connectivity
11209/// with the customer's network.
11210#[derive(Clone, Default, PartialEq)]
11211#[non_exhaustive]
11212pub struct PrivateConnection {
11213    /// The name of the resource.
11214    pub name: std::string::String,
11215
11216    /// Output only. The create time of the resource.
11217    pub create_time: std::option::Option<wkt::Timestamp>,
11218
11219    /// Output only. The last update time of the resource.
11220    pub update_time: std::option::Option<wkt::Timestamp>,
11221
11222    /// The resource labels for private connections to use to annotate any related
11223    /// underlying resources such as Compute Engine VMs. An object containing a
11224    /// list of "key": "value" pairs.
11225    ///
11226    /// Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`.
11227    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
11228
11229    /// The private connection display name.
11230    pub display_name: std::string::String,
11231
11232    /// Output only. The state of the private connection.
11233    pub state: crate::model::private_connection::State,
11234
11235    /// Output only. The error details in case of state FAILED.
11236    pub error: std::option::Option<google_cloud_rpc::model::Status>,
11237
11238    pub connectivity: std::option::Option<crate::model::private_connection::Connectivity>,
11239
11240    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11241}
11242
11243impl PrivateConnection {
11244    pub fn new() -> Self {
11245        std::default::Default::default()
11246    }
11247
11248    /// Sets the value of [name][crate::model::PrivateConnection::name].
11249    ///
11250    /// # Example
11251    /// ```ignore,no_run
11252    /// # use google_cloud_clouddms_v1::model::PrivateConnection;
11253    /// let x = PrivateConnection::new().set_name("example");
11254    /// ```
11255    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11256        self.name = v.into();
11257        self
11258    }
11259
11260    /// Sets the value of [create_time][crate::model::PrivateConnection::create_time].
11261    ///
11262    /// # Example
11263    /// ```ignore,no_run
11264    /// # use google_cloud_clouddms_v1::model::PrivateConnection;
11265    /// use wkt::Timestamp;
11266    /// let x = PrivateConnection::new().set_create_time(Timestamp::default()/* use setters */);
11267    /// ```
11268    pub fn set_create_time<T>(mut self, v: T) -> Self
11269    where
11270        T: std::convert::Into<wkt::Timestamp>,
11271    {
11272        self.create_time = std::option::Option::Some(v.into());
11273        self
11274    }
11275
11276    /// Sets or clears the value of [create_time][crate::model::PrivateConnection::create_time].
11277    ///
11278    /// # Example
11279    /// ```ignore,no_run
11280    /// # use google_cloud_clouddms_v1::model::PrivateConnection;
11281    /// use wkt::Timestamp;
11282    /// let x = PrivateConnection::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11283    /// let x = PrivateConnection::new().set_or_clear_create_time(None::<Timestamp>);
11284    /// ```
11285    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11286    where
11287        T: std::convert::Into<wkt::Timestamp>,
11288    {
11289        self.create_time = v.map(|x| x.into());
11290        self
11291    }
11292
11293    /// Sets the value of [update_time][crate::model::PrivateConnection::update_time].
11294    ///
11295    /// # Example
11296    /// ```ignore,no_run
11297    /// # use google_cloud_clouddms_v1::model::PrivateConnection;
11298    /// use wkt::Timestamp;
11299    /// let x = PrivateConnection::new().set_update_time(Timestamp::default()/* use setters */);
11300    /// ```
11301    pub fn set_update_time<T>(mut self, v: T) -> Self
11302    where
11303        T: std::convert::Into<wkt::Timestamp>,
11304    {
11305        self.update_time = std::option::Option::Some(v.into());
11306        self
11307    }
11308
11309    /// Sets or clears the value of [update_time][crate::model::PrivateConnection::update_time].
11310    ///
11311    /// # Example
11312    /// ```ignore,no_run
11313    /// # use google_cloud_clouddms_v1::model::PrivateConnection;
11314    /// use wkt::Timestamp;
11315    /// let x = PrivateConnection::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
11316    /// let x = PrivateConnection::new().set_or_clear_update_time(None::<Timestamp>);
11317    /// ```
11318    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
11319    where
11320        T: std::convert::Into<wkt::Timestamp>,
11321    {
11322        self.update_time = v.map(|x| x.into());
11323        self
11324    }
11325
11326    /// Sets the value of [labels][crate::model::PrivateConnection::labels].
11327    ///
11328    /// # Example
11329    /// ```ignore,no_run
11330    /// # use google_cloud_clouddms_v1::model::PrivateConnection;
11331    /// let x = PrivateConnection::new().set_labels([
11332    ///     ("key0", "abc"),
11333    ///     ("key1", "xyz"),
11334    /// ]);
11335    /// ```
11336    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
11337    where
11338        T: std::iter::IntoIterator<Item = (K, V)>,
11339        K: std::convert::Into<std::string::String>,
11340        V: std::convert::Into<std::string::String>,
11341    {
11342        use std::iter::Iterator;
11343        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11344        self
11345    }
11346
11347    /// Sets the value of [display_name][crate::model::PrivateConnection::display_name].
11348    ///
11349    /// # Example
11350    /// ```ignore,no_run
11351    /// # use google_cloud_clouddms_v1::model::PrivateConnection;
11352    /// let x = PrivateConnection::new().set_display_name("example");
11353    /// ```
11354    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11355        self.display_name = v.into();
11356        self
11357    }
11358
11359    /// Sets the value of [state][crate::model::PrivateConnection::state].
11360    ///
11361    /// # Example
11362    /// ```ignore,no_run
11363    /// # use google_cloud_clouddms_v1::model::PrivateConnection;
11364    /// use google_cloud_clouddms_v1::model::private_connection::State;
11365    /// let x0 = PrivateConnection::new().set_state(State::Creating);
11366    /// let x1 = PrivateConnection::new().set_state(State::Created);
11367    /// let x2 = PrivateConnection::new().set_state(State::Failed);
11368    /// ```
11369    pub fn set_state<T: std::convert::Into<crate::model::private_connection::State>>(
11370        mut self,
11371        v: T,
11372    ) -> Self {
11373        self.state = v.into();
11374        self
11375    }
11376
11377    /// Sets the value of [error][crate::model::PrivateConnection::error].
11378    ///
11379    /// # Example
11380    /// ```ignore,no_run
11381    /// # use google_cloud_clouddms_v1::model::PrivateConnection;
11382    /// use google_cloud_rpc::model::Status;
11383    /// let x = PrivateConnection::new().set_error(Status::default()/* use setters */);
11384    /// ```
11385    pub fn set_error<T>(mut self, v: T) -> Self
11386    where
11387        T: std::convert::Into<google_cloud_rpc::model::Status>,
11388    {
11389        self.error = std::option::Option::Some(v.into());
11390        self
11391    }
11392
11393    /// Sets or clears the value of [error][crate::model::PrivateConnection::error].
11394    ///
11395    /// # Example
11396    /// ```ignore,no_run
11397    /// # use google_cloud_clouddms_v1::model::PrivateConnection;
11398    /// use google_cloud_rpc::model::Status;
11399    /// let x = PrivateConnection::new().set_or_clear_error(Some(Status::default()/* use setters */));
11400    /// let x = PrivateConnection::new().set_or_clear_error(None::<Status>);
11401    /// ```
11402    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
11403    where
11404        T: std::convert::Into<google_cloud_rpc::model::Status>,
11405    {
11406        self.error = v.map(|x| x.into());
11407        self
11408    }
11409
11410    /// Sets the value of [connectivity][crate::model::PrivateConnection::connectivity].
11411    ///
11412    /// Note that all the setters affecting `connectivity` are mutually
11413    /// exclusive.
11414    ///
11415    /// # Example
11416    /// ```ignore,no_run
11417    /// # use google_cloud_clouddms_v1::model::PrivateConnection;
11418    /// use google_cloud_clouddms_v1::model::VpcPeeringConfig;
11419    /// let x = PrivateConnection::new().set_connectivity(Some(
11420    ///     google_cloud_clouddms_v1::model::private_connection::Connectivity::VpcPeeringConfig(VpcPeeringConfig::default().into())));
11421    /// ```
11422    pub fn set_connectivity<
11423        T: std::convert::Into<std::option::Option<crate::model::private_connection::Connectivity>>,
11424    >(
11425        mut self,
11426        v: T,
11427    ) -> Self {
11428        self.connectivity = v.into();
11429        self
11430    }
11431
11432    /// The value of [connectivity][crate::model::PrivateConnection::connectivity]
11433    /// if it holds a `VpcPeeringConfig`, `None` if the field is not set or
11434    /// holds a different branch.
11435    pub fn vpc_peering_config(
11436        &self,
11437    ) -> std::option::Option<&std::boxed::Box<crate::model::VpcPeeringConfig>> {
11438        #[allow(unreachable_patterns)]
11439        self.connectivity.as_ref().and_then(|v| match v {
11440            crate::model::private_connection::Connectivity::VpcPeeringConfig(v) => {
11441                std::option::Option::Some(v)
11442            }
11443            _ => std::option::Option::None,
11444        })
11445    }
11446
11447    /// Sets the value of [connectivity][crate::model::PrivateConnection::connectivity]
11448    /// to hold a `VpcPeeringConfig`.
11449    ///
11450    /// Note that all the setters affecting `connectivity` are
11451    /// mutually exclusive.
11452    ///
11453    /// # Example
11454    /// ```ignore,no_run
11455    /// # use google_cloud_clouddms_v1::model::PrivateConnection;
11456    /// use google_cloud_clouddms_v1::model::VpcPeeringConfig;
11457    /// let x = PrivateConnection::new().set_vpc_peering_config(VpcPeeringConfig::default()/* use setters */);
11458    /// assert!(x.vpc_peering_config().is_some());
11459    /// ```
11460    pub fn set_vpc_peering_config<
11461        T: std::convert::Into<std::boxed::Box<crate::model::VpcPeeringConfig>>,
11462    >(
11463        mut self,
11464        v: T,
11465    ) -> Self {
11466        self.connectivity = std::option::Option::Some(
11467            crate::model::private_connection::Connectivity::VpcPeeringConfig(v.into()),
11468        );
11469        self
11470    }
11471}
11472
11473impl wkt::message::Message for PrivateConnection {
11474    fn typename() -> &'static str {
11475        "type.googleapis.com/google.cloud.clouddms.v1.PrivateConnection"
11476    }
11477}
11478
11479/// Defines additional types related to [PrivateConnection].
11480pub mod private_connection {
11481    #[allow(unused_imports)]
11482    use super::*;
11483
11484    /// Private Connection state.
11485    ///
11486    /// # Working with unknown values
11487    ///
11488    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11489    /// additional enum variants at any time. Adding new variants is not considered
11490    /// a breaking change. Applications should write their code in anticipation of:
11491    ///
11492    /// - New values appearing in future releases of the client library, **and**
11493    /// - New values received dynamically, without application changes.
11494    ///
11495    /// Please consult the [Working with enums] section in the user guide for some
11496    /// guidelines.
11497    ///
11498    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11499    #[derive(Clone, Debug, PartialEq)]
11500    #[non_exhaustive]
11501    pub enum State {
11502        Unspecified,
11503        /// The private connection is in creation state - creating resources.
11504        Creating,
11505        /// The private connection has been created with all of its resources.
11506        Created,
11507        /// The private connection creation has failed.
11508        Failed,
11509        /// The private connection is being deleted.
11510        Deleting,
11511        /// Delete request has failed, resource is in invalid state.
11512        FailedToDelete,
11513        /// The private connection has been deleted.
11514        Deleted,
11515        /// If set, the enum was initialized with an unknown value.
11516        ///
11517        /// Applications can examine the value using [State::value] or
11518        /// [State::name].
11519        UnknownValue(state::UnknownValue),
11520    }
11521
11522    #[doc(hidden)]
11523    pub mod state {
11524        #[allow(unused_imports)]
11525        use super::*;
11526        #[derive(Clone, Debug, PartialEq)]
11527        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11528    }
11529
11530    impl State {
11531        /// Gets the enum value.
11532        ///
11533        /// Returns `None` if the enum contains an unknown value deserialized from
11534        /// the string representation of enums.
11535        pub fn value(&self) -> std::option::Option<i32> {
11536            match self {
11537                Self::Unspecified => std::option::Option::Some(0),
11538                Self::Creating => std::option::Option::Some(1),
11539                Self::Created => std::option::Option::Some(2),
11540                Self::Failed => std::option::Option::Some(3),
11541                Self::Deleting => std::option::Option::Some(4),
11542                Self::FailedToDelete => std::option::Option::Some(5),
11543                Self::Deleted => std::option::Option::Some(6),
11544                Self::UnknownValue(u) => u.0.value(),
11545            }
11546        }
11547
11548        /// Gets the enum value as a string.
11549        ///
11550        /// Returns `None` if the enum contains an unknown value deserialized from
11551        /// the integer representation of enums.
11552        pub fn name(&self) -> std::option::Option<&str> {
11553            match self {
11554                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
11555                Self::Creating => std::option::Option::Some("CREATING"),
11556                Self::Created => std::option::Option::Some("CREATED"),
11557                Self::Failed => std::option::Option::Some("FAILED"),
11558                Self::Deleting => std::option::Option::Some("DELETING"),
11559                Self::FailedToDelete => std::option::Option::Some("FAILED_TO_DELETE"),
11560                Self::Deleted => std::option::Option::Some("DELETED"),
11561                Self::UnknownValue(u) => u.0.name(),
11562            }
11563        }
11564    }
11565
11566    impl std::default::Default for State {
11567        fn default() -> Self {
11568            use std::convert::From;
11569            Self::from(0)
11570        }
11571    }
11572
11573    impl std::fmt::Display for State {
11574        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11575            wkt::internal::display_enum(f, self.name(), self.value())
11576        }
11577    }
11578
11579    impl std::convert::From<i32> for State {
11580        fn from(value: i32) -> Self {
11581            match value {
11582                0 => Self::Unspecified,
11583                1 => Self::Creating,
11584                2 => Self::Created,
11585                3 => Self::Failed,
11586                4 => Self::Deleting,
11587                5 => Self::FailedToDelete,
11588                6 => Self::Deleted,
11589                _ => Self::UnknownValue(state::UnknownValue(
11590                    wkt::internal::UnknownEnumValue::Integer(value),
11591                )),
11592            }
11593        }
11594    }
11595
11596    impl std::convert::From<&str> for State {
11597        fn from(value: &str) -> Self {
11598            use std::string::ToString;
11599            match value {
11600                "STATE_UNSPECIFIED" => Self::Unspecified,
11601                "CREATING" => Self::Creating,
11602                "CREATED" => Self::Created,
11603                "FAILED" => Self::Failed,
11604                "DELETING" => Self::Deleting,
11605                "FAILED_TO_DELETE" => Self::FailedToDelete,
11606                "DELETED" => Self::Deleted,
11607                _ => Self::UnknownValue(state::UnknownValue(
11608                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11609                )),
11610            }
11611        }
11612    }
11613
11614    impl serde::ser::Serialize for State {
11615        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11616        where
11617            S: serde::Serializer,
11618        {
11619            match self {
11620                Self::Unspecified => serializer.serialize_i32(0),
11621                Self::Creating => serializer.serialize_i32(1),
11622                Self::Created => serializer.serialize_i32(2),
11623                Self::Failed => serializer.serialize_i32(3),
11624                Self::Deleting => serializer.serialize_i32(4),
11625                Self::FailedToDelete => serializer.serialize_i32(5),
11626                Self::Deleted => serializer.serialize_i32(6),
11627                Self::UnknownValue(u) => u.0.serialize(serializer),
11628            }
11629        }
11630    }
11631
11632    impl<'de> serde::de::Deserialize<'de> for State {
11633        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11634        where
11635            D: serde::Deserializer<'de>,
11636        {
11637            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
11638                ".google.cloud.clouddms.v1.PrivateConnection.State",
11639            ))
11640        }
11641    }
11642
11643    #[derive(Clone, Debug, PartialEq)]
11644    #[non_exhaustive]
11645    pub enum Connectivity {
11646        /// VPC peering configuration.
11647        VpcPeeringConfig(std::boxed::Box<crate::model::VpcPeeringConfig>),
11648    }
11649}
11650
11651/// The VPC peering configuration is used to create VPC peering with the
11652/// consumer's VPC.
11653#[derive(Clone, Default, PartialEq)]
11654#[non_exhaustive]
11655pub struct VpcPeeringConfig {
11656    /// Required. Fully qualified name of the VPC that Database Migration Service
11657    /// will peer to.
11658    pub vpc_name: std::string::String,
11659
11660    /// Required. A free subnet for peering. (CIDR of /29)
11661    pub subnet: std::string::String,
11662
11663    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11664}
11665
11666impl VpcPeeringConfig {
11667    pub fn new() -> Self {
11668        std::default::Default::default()
11669    }
11670
11671    /// Sets the value of [vpc_name][crate::model::VpcPeeringConfig::vpc_name].
11672    ///
11673    /// # Example
11674    /// ```ignore,no_run
11675    /// # use google_cloud_clouddms_v1::model::VpcPeeringConfig;
11676    /// let x = VpcPeeringConfig::new().set_vpc_name("example");
11677    /// ```
11678    pub fn set_vpc_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11679        self.vpc_name = v.into();
11680        self
11681    }
11682
11683    /// Sets the value of [subnet][crate::model::VpcPeeringConfig::subnet].
11684    ///
11685    /// # Example
11686    /// ```ignore,no_run
11687    /// # use google_cloud_clouddms_v1::model::VpcPeeringConfig;
11688    /// let x = VpcPeeringConfig::new().set_subnet("example");
11689    /// ```
11690    pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11691        self.subnet = v.into();
11692        self
11693    }
11694}
11695
11696impl wkt::message::Message for VpcPeeringConfig {
11697    fn typename() -> &'static str {
11698        "type.googleapis.com/google.cloud.clouddms.v1.VpcPeeringConfig"
11699    }
11700}
11701
11702/// The type and version of a source or destination database.
11703#[derive(Clone, Default, PartialEq)]
11704#[non_exhaustive]
11705pub struct DatabaseEngineInfo {
11706    /// Required. Engine type.
11707    pub engine: crate::model::DatabaseEngine,
11708
11709    /// Required. Engine named version, for example 12.c.1.
11710    pub version: std::string::String,
11711
11712    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11713}
11714
11715impl DatabaseEngineInfo {
11716    pub fn new() -> Self {
11717        std::default::Default::default()
11718    }
11719
11720    /// Sets the value of [engine][crate::model::DatabaseEngineInfo::engine].
11721    ///
11722    /// # Example
11723    /// ```ignore,no_run
11724    /// # use google_cloud_clouddms_v1::model::DatabaseEngineInfo;
11725    /// use google_cloud_clouddms_v1::model::DatabaseEngine;
11726    /// let x0 = DatabaseEngineInfo::new().set_engine(DatabaseEngine::Mysql);
11727    /// let x1 = DatabaseEngineInfo::new().set_engine(DatabaseEngine::Postgresql);
11728    /// let x2 = DatabaseEngineInfo::new().set_engine(DatabaseEngine::Oracle);
11729    /// ```
11730    pub fn set_engine<T: std::convert::Into<crate::model::DatabaseEngine>>(mut self, v: T) -> Self {
11731        self.engine = v.into();
11732        self
11733    }
11734
11735    /// Sets the value of [version][crate::model::DatabaseEngineInfo::version].
11736    ///
11737    /// # Example
11738    /// ```ignore,no_run
11739    /// # use google_cloud_clouddms_v1::model::DatabaseEngineInfo;
11740    /// let x = DatabaseEngineInfo::new().set_version("example");
11741    /// ```
11742    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11743        self.version = v.into();
11744        self
11745    }
11746}
11747
11748impl wkt::message::Message for DatabaseEngineInfo {
11749    fn typename() -> &'static str {
11750        "type.googleapis.com/google.cloud.clouddms.v1.DatabaseEngineInfo"
11751    }
11752}
11753
11754/// The main conversion workspace resource entity.
11755#[derive(Clone, Default, PartialEq)]
11756#[non_exhaustive]
11757pub struct ConversionWorkspace {
11758    /// Full name of the workspace resource, in the form of:
11759    /// projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.
11760    pub name: std::string::String,
11761
11762    /// Required. The source engine details.
11763    pub source: std::option::Option<crate::model::DatabaseEngineInfo>,
11764
11765    /// Required. The destination engine details.
11766    pub destination: std::option::Option<crate::model::DatabaseEngineInfo>,
11767
11768    /// Optional. A generic list of settings for the workspace.
11769    /// The settings are database pair dependant and can indicate default behavior
11770    /// for the mapping rules engine or turn on or off specific features.
11771    /// Such examples can be: convert_foreign_key_to_interleave=true,
11772    /// skip_triggers=false, ignore_non_table_synonyms=true
11773    pub global_settings: std::collections::HashMap<std::string::String, std::string::String>,
11774
11775    /// Output only. Whether the workspace has uncommitted changes (changes which
11776    /// were made after the workspace was committed).
11777    pub has_uncommitted_changes: bool,
11778
11779    /// Output only. The latest commit ID.
11780    pub latest_commit_id: std::string::String,
11781
11782    /// Output only. The timestamp when the workspace was committed.
11783    pub latest_commit_time: std::option::Option<wkt::Timestamp>,
11784
11785    /// Output only. The timestamp when the workspace resource was created.
11786    pub create_time: std::option::Option<wkt::Timestamp>,
11787
11788    /// Output only. The timestamp when the workspace resource was last updated.
11789    pub update_time: std::option::Option<wkt::Timestamp>,
11790
11791    /// Optional. The display name for the workspace.
11792    pub display_name: std::string::String,
11793
11794    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11795}
11796
11797impl ConversionWorkspace {
11798    pub fn new() -> Self {
11799        std::default::Default::default()
11800    }
11801
11802    /// Sets the value of [name][crate::model::ConversionWorkspace::name].
11803    ///
11804    /// # Example
11805    /// ```ignore,no_run
11806    /// # use google_cloud_clouddms_v1::model::ConversionWorkspace;
11807    /// let x = ConversionWorkspace::new().set_name("example");
11808    /// ```
11809    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11810        self.name = v.into();
11811        self
11812    }
11813
11814    /// Sets the value of [source][crate::model::ConversionWorkspace::source].
11815    ///
11816    /// # Example
11817    /// ```ignore,no_run
11818    /// # use google_cloud_clouddms_v1::model::ConversionWorkspace;
11819    /// use google_cloud_clouddms_v1::model::DatabaseEngineInfo;
11820    /// let x = ConversionWorkspace::new().set_source(DatabaseEngineInfo::default()/* use setters */);
11821    /// ```
11822    pub fn set_source<T>(mut self, v: T) -> Self
11823    where
11824        T: std::convert::Into<crate::model::DatabaseEngineInfo>,
11825    {
11826        self.source = std::option::Option::Some(v.into());
11827        self
11828    }
11829
11830    /// Sets or clears the value of [source][crate::model::ConversionWorkspace::source].
11831    ///
11832    /// # Example
11833    /// ```ignore,no_run
11834    /// # use google_cloud_clouddms_v1::model::ConversionWorkspace;
11835    /// use google_cloud_clouddms_v1::model::DatabaseEngineInfo;
11836    /// let x = ConversionWorkspace::new().set_or_clear_source(Some(DatabaseEngineInfo::default()/* use setters */));
11837    /// let x = ConversionWorkspace::new().set_or_clear_source(None::<DatabaseEngineInfo>);
11838    /// ```
11839    pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
11840    where
11841        T: std::convert::Into<crate::model::DatabaseEngineInfo>,
11842    {
11843        self.source = v.map(|x| x.into());
11844        self
11845    }
11846
11847    /// Sets the value of [destination][crate::model::ConversionWorkspace::destination].
11848    ///
11849    /// # Example
11850    /// ```ignore,no_run
11851    /// # use google_cloud_clouddms_v1::model::ConversionWorkspace;
11852    /// use google_cloud_clouddms_v1::model::DatabaseEngineInfo;
11853    /// let x = ConversionWorkspace::new().set_destination(DatabaseEngineInfo::default()/* use setters */);
11854    /// ```
11855    pub fn set_destination<T>(mut self, v: T) -> Self
11856    where
11857        T: std::convert::Into<crate::model::DatabaseEngineInfo>,
11858    {
11859        self.destination = std::option::Option::Some(v.into());
11860        self
11861    }
11862
11863    /// Sets or clears the value of [destination][crate::model::ConversionWorkspace::destination].
11864    ///
11865    /// # Example
11866    /// ```ignore,no_run
11867    /// # use google_cloud_clouddms_v1::model::ConversionWorkspace;
11868    /// use google_cloud_clouddms_v1::model::DatabaseEngineInfo;
11869    /// let x = ConversionWorkspace::new().set_or_clear_destination(Some(DatabaseEngineInfo::default()/* use setters */));
11870    /// let x = ConversionWorkspace::new().set_or_clear_destination(None::<DatabaseEngineInfo>);
11871    /// ```
11872    pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
11873    where
11874        T: std::convert::Into<crate::model::DatabaseEngineInfo>,
11875    {
11876        self.destination = v.map(|x| x.into());
11877        self
11878    }
11879
11880    /// Sets the value of [global_settings][crate::model::ConversionWorkspace::global_settings].
11881    ///
11882    /// # Example
11883    /// ```ignore,no_run
11884    /// # use google_cloud_clouddms_v1::model::ConversionWorkspace;
11885    /// let x = ConversionWorkspace::new().set_global_settings([
11886    ///     ("key0", "abc"),
11887    ///     ("key1", "xyz"),
11888    /// ]);
11889    /// ```
11890    pub fn set_global_settings<T, K, V>(mut self, v: T) -> Self
11891    where
11892        T: std::iter::IntoIterator<Item = (K, V)>,
11893        K: std::convert::Into<std::string::String>,
11894        V: std::convert::Into<std::string::String>,
11895    {
11896        use std::iter::Iterator;
11897        self.global_settings = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11898        self
11899    }
11900
11901    /// Sets the value of [has_uncommitted_changes][crate::model::ConversionWorkspace::has_uncommitted_changes].
11902    ///
11903    /// # Example
11904    /// ```ignore,no_run
11905    /// # use google_cloud_clouddms_v1::model::ConversionWorkspace;
11906    /// let x = ConversionWorkspace::new().set_has_uncommitted_changes(true);
11907    /// ```
11908    pub fn set_has_uncommitted_changes<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11909        self.has_uncommitted_changes = v.into();
11910        self
11911    }
11912
11913    /// Sets the value of [latest_commit_id][crate::model::ConversionWorkspace::latest_commit_id].
11914    ///
11915    /// # Example
11916    /// ```ignore,no_run
11917    /// # use google_cloud_clouddms_v1::model::ConversionWorkspace;
11918    /// let x = ConversionWorkspace::new().set_latest_commit_id("example");
11919    /// ```
11920    pub fn set_latest_commit_id<T: std::convert::Into<std::string::String>>(
11921        mut self,
11922        v: T,
11923    ) -> Self {
11924        self.latest_commit_id = v.into();
11925        self
11926    }
11927
11928    /// Sets the value of [latest_commit_time][crate::model::ConversionWorkspace::latest_commit_time].
11929    ///
11930    /// # Example
11931    /// ```ignore,no_run
11932    /// # use google_cloud_clouddms_v1::model::ConversionWorkspace;
11933    /// use wkt::Timestamp;
11934    /// let x = ConversionWorkspace::new().set_latest_commit_time(Timestamp::default()/* use setters */);
11935    /// ```
11936    pub fn set_latest_commit_time<T>(mut self, v: T) -> Self
11937    where
11938        T: std::convert::Into<wkt::Timestamp>,
11939    {
11940        self.latest_commit_time = std::option::Option::Some(v.into());
11941        self
11942    }
11943
11944    /// Sets or clears the value of [latest_commit_time][crate::model::ConversionWorkspace::latest_commit_time].
11945    ///
11946    /// # Example
11947    /// ```ignore,no_run
11948    /// # use google_cloud_clouddms_v1::model::ConversionWorkspace;
11949    /// use wkt::Timestamp;
11950    /// let x = ConversionWorkspace::new().set_or_clear_latest_commit_time(Some(Timestamp::default()/* use setters */));
11951    /// let x = ConversionWorkspace::new().set_or_clear_latest_commit_time(None::<Timestamp>);
11952    /// ```
11953    pub fn set_or_clear_latest_commit_time<T>(mut self, v: std::option::Option<T>) -> Self
11954    where
11955        T: std::convert::Into<wkt::Timestamp>,
11956    {
11957        self.latest_commit_time = v.map(|x| x.into());
11958        self
11959    }
11960
11961    /// Sets the value of [create_time][crate::model::ConversionWorkspace::create_time].
11962    ///
11963    /// # Example
11964    /// ```ignore,no_run
11965    /// # use google_cloud_clouddms_v1::model::ConversionWorkspace;
11966    /// use wkt::Timestamp;
11967    /// let x = ConversionWorkspace::new().set_create_time(Timestamp::default()/* use setters */);
11968    /// ```
11969    pub fn set_create_time<T>(mut self, v: T) -> Self
11970    where
11971        T: std::convert::Into<wkt::Timestamp>,
11972    {
11973        self.create_time = std::option::Option::Some(v.into());
11974        self
11975    }
11976
11977    /// Sets or clears the value of [create_time][crate::model::ConversionWorkspace::create_time].
11978    ///
11979    /// # Example
11980    /// ```ignore,no_run
11981    /// # use google_cloud_clouddms_v1::model::ConversionWorkspace;
11982    /// use wkt::Timestamp;
11983    /// let x = ConversionWorkspace::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11984    /// let x = ConversionWorkspace::new().set_or_clear_create_time(None::<Timestamp>);
11985    /// ```
11986    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11987    where
11988        T: std::convert::Into<wkt::Timestamp>,
11989    {
11990        self.create_time = v.map(|x| x.into());
11991        self
11992    }
11993
11994    /// Sets the value of [update_time][crate::model::ConversionWorkspace::update_time].
11995    ///
11996    /// # Example
11997    /// ```ignore,no_run
11998    /// # use google_cloud_clouddms_v1::model::ConversionWorkspace;
11999    /// use wkt::Timestamp;
12000    /// let x = ConversionWorkspace::new().set_update_time(Timestamp::default()/* use setters */);
12001    /// ```
12002    pub fn set_update_time<T>(mut self, v: T) -> Self
12003    where
12004        T: std::convert::Into<wkt::Timestamp>,
12005    {
12006        self.update_time = std::option::Option::Some(v.into());
12007        self
12008    }
12009
12010    /// Sets or clears the value of [update_time][crate::model::ConversionWorkspace::update_time].
12011    ///
12012    /// # Example
12013    /// ```ignore,no_run
12014    /// # use google_cloud_clouddms_v1::model::ConversionWorkspace;
12015    /// use wkt::Timestamp;
12016    /// let x = ConversionWorkspace::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
12017    /// let x = ConversionWorkspace::new().set_or_clear_update_time(None::<Timestamp>);
12018    /// ```
12019    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
12020    where
12021        T: std::convert::Into<wkt::Timestamp>,
12022    {
12023        self.update_time = v.map(|x| x.into());
12024        self
12025    }
12026
12027    /// Sets the value of [display_name][crate::model::ConversionWorkspace::display_name].
12028    ///
12029    /// # Example
12030    /// ```ignore,no_run
12031    /// # use google_cloud_clouddms_v1::model::ConversionWorkspace;
12032    /// let x = ConversionWorkspace::new().set_display_name("example");
12033    /// ```
12034    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12035        self.display_name = v.into();
12036        self
12037    }
12038}
12039
12040impl wkt::message::Message for ConversionWorkspace {
12041    fn typename() -> &'static str {
12042        "type.googleapis.com/google.cloud.clouddms.v1.ConversionWorkspace"
12043    }
12044}
12045
12046/// Execution log of a background job.
12047#[derive(Clone, Default, PartialEq)]
12048#[non_exhaustive]
12049pub struct BackgroundJobLogEntry {
12050    /// The background job log entry ID.
12051    pub id: std::string::String,
12052
12053    /// The type of job that was executed.
12054    pub job_type: crate::model::BackgroundJobType,
12055
12056    /// The timestamp when the background job was started.
12057    pub start_time: std::option::Option<wkt::Timestamp>,
12058
12059    /// The timestamp when the background job was finished.
12060    pub finish_time: std::option::Option<wkt::Timestamp>,
12061
12062    /// Output only. Job completion state, i.e. the final state after the job
12063    /// completed.
12064    pub completion_state: crate::model::background_job_log_entry::JobCompletionState,
12065
12066    /// Output only. Job completion comment, such as how many entities were seeded,
12067    /// how many warnings were found during conversion, and similar information.
12068    pub completion_comment: std::string::String,
12069
12070    /// Output only. Whether the client requested the conversion workspace to be
12071    /// committed after a successful completion of the job.
12072    pub request_autocommit: bool,
12073
12074    pub job_details: std::option::Option<crate::model::background_job_log_entry::JobDetails>,
12075
12076    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12077}
12078
12079impl BackgroundJobLogEntry {
12080    pub fn new() -> Self {
12081        std::default::Default::default()
12082    }
12083
12084    /// Sets the value of [id][crate::model::BackgroundJobLogEntry::id].
12085    ///
12086    /// # Example
12087    /// ```ignore,no_run
12088    /// # use google_cloud_clouddms_v1::model::BackgroundJobLogEntry;
12089    /// let x = BackgroundJobLogEntry::new().set_id("example");
12090    /// ```
12091    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12092        self.id = v.into();
12093        self
12094    }
12095
12096    /// Sets the value of [job_type][crate::model::BackgroundJobLogEntry::job_type].
12097    ///
12098    /// # Example
12099    /// ```ignore,no_run
12100    /// # use google_cloud_clouddms_v1::model::BackgroundJobLogEntry;
12101    /// use google_cloud_clouddms_v1::model::BackgroundJobType;
12102    /// let x0 = BackgroundJobLogEntry::new().set_job_type(BackgroundJobType::SourceSeed);
12103    /// let x1 = BackgroundJobLogEntry::new().set_job_type(BackgroundJobType::Convert);
12104    /// let x2 = BackgroundJobLogEntry::new().set_job_type(BackgroundJobType::ApplyDestination);
12105    /// ```
12106    pub fn set_job_type<T: std::convert::Into<crate::model::BackgroundJobType>>(
12107        mut self,
12108        v: T,
12109    ) -> Self {
12110        self.job_type = v.into();
12111        self
12112    }
12113
12114    /// Sets the value of [start_time][crate::model::BackgroundJobLogEntry::start_time].
12115    ///
12116    /// # Example
12117    /// ```ignore,no_run
12118    /// # use google_cloud_clouddms_v1::model::BackgroundJobLogEntry;
12119    /// use wkt::Timestamp;
12120    /// let x = BackgroundJobLogEntry::new().set_start_time(Timestamp::default()/* use setters */);
12121    /// ```
12122    pub fn set_start_time<T>(mut self, v: T) -> Self
12123    where
12124        T: std::convert::Into<wkt::Timestamp>,
12125    {
12126        self.start_time = std::option::Option::Some(v.into());
12127        self
12128    }
12129
12130    /// Sets or clears the value of [start_time][crate::model::BackgroundJobLogEntry::start_time].
12131    ///
12132    /// # Example
12133    /// ```ignore,no_run
12134    /// # use google_cloud_clouddms_v1::model::BackgroundJobLogEntry;
12135    /// use wkt::Timestamp;
12136    /// let x = BackgroundJobLogEntry::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
12137    /// let x = BackgroundJobLogEntry::new().set_or_clear_start_time(None::<Timestamp>);
12138    /// ```
12139    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
12140    where
12141        T: std::convert::Into<wkt::Timestamp>,
12142    {
12143        self.start_time = v.map(|x| x.into());
12144        self
12145    }
12146
12147    /// Sets the value of [finish_time][crate::model::BackgroundJobLogEntry::finish_time].
12148    ///
12149    /// # Example
12150    /// ```ignore,no_run
12151    /// # use google_cloud_clouddms_v1::model::BackgroundJobLogEntry;
12152    /// use wkt::Timestamp;
12153    /// let x = BackgroundJobLogEntry::new().set_finish_time(Timestamp::default()/* use setters */);
12154    /// ```
12155    pub fn set_finish_time<T>(mut self, v: T) -> Self
12156    where
12157        T: std::convert::Into<wkt::Timestamp>,
12158    {
12159        self.finish_time = std::option::Option::Some(v.into());
12160        self
12161    }
12162
12163    /// Sets or clears the value of [finish_time][crate::model::BackgroundJobLogEntry::finish_time].
12164    ///
12165    /// # Example
12166    /// ```ignore,no_run
12167    /// # use google_cloud_clouddms_v1::model::BackgroundJobLogEntry;
12168    /// use wkt::Timestamp;
12169    /// let x = BackgroundJobLogEntry::new().set_or_clear_finish_time(Some(Timestamp::default()/* use setters */));
12170    /// let x = BackgroundJobLogEntry::new().set_or_clear_finish_time(None::<Timestamp>);
12171    /// ```
12172    pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
12173    where
12174        T: std::convert::Into<wkt::Timestamp>,
12175    {
12176        self.finish_time = v.map(|x| x.into());
12177        self
12178    }
12179
12180    /// Sets the value of [completion_state][crate::model::BackgroundJobLogEntry::completion_state].
12181    ///
12182    /// # Example
12183    /// ```ignore,no_run
12184    /// # use google_cloud_clouddms_v1::model::BackgroundJobLogEntry;
12185    /// use google_cloud_clouddms_v1::model::background_job_log_entry::JobCompletionState;
12186    /// let x0 = BackgroundJobLogEntry::new().set_completion_state(JobCompletionState::Succeeded);
12187    /// let x1 = BackgroundJobLogEntry::new().set_completion_state(JobCompletionState::Failed);
12188    /// ```
12189    pub fn set_completion_state<
12190        T: std::convert::Into<crate::model::background_job_log_entry::JobCompletionState>,
12191    >(
12192        mut self,
12193        v: T,
12194    ) -> Self {
12195        self.completion_state = v.into();
12196        self
12197    }
12198
12199    /// Sets the value of [completion_comment][crate::model::BackgroundJobLogEntry::completion_comment].
12200    ///
12201    /// # Example
12202    /// ```ignore,no_run
12203    /// # use google_cloud_clouddms_v1::model::BackgroundJobLogEntry;
12204    /// let x = BackgroundJobLogEntry::new().set_completion_comment("example");
12205    /// ```
12206    pub fn set_completion_comment<T: std::convert::Into<std::string::String>>(
12207        mut self,
12208        v: T,
12209    ) -> Self {
12210        self.completion_comment = v.into();
12211        self
12212    }
12213
12214    /// Sets the value of [request_autocommit][crate::model::BackgroundJobLogEntry::request_autocommit].
12215    ///
12216    /// # Example
12217    /// ```ignore,no_run
12218    /// # use google_cloud_clouddms_v1::model::BackgroundJobLogEntry;
12219    /// let x = BackgroundJobLogEntry::new().set_request_autocommit(true);
12220    /// ```
12221    pub fn set_request_autocommit<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12222        self.request_autocommit = v.into();
12223        self
12224    }
12225
12226    /// Sets the value of [job_details][crate::model::BackgroundJobLogEntry::job_details].
12227    ///
12228    /// Note that all the setters affecting `job_details` are mutually
12229    /// exclusive.
12230    ///
12231    /// # Example
12232    /// ```ignore,no_run
12233    /// # use google_cloud_clouddms_v1::model::BackgroundJobLogEntry;
12234    /// use google_cloud_clouddms_v1::model::background_job_log_entry::SeedJobDetails;
12235    /// let x = BackgroundJobLogEntry::new().set_job_details(Some(
12236    ///     google_cloud_clouddms_v1::model::background_job_log_entry::JobDetails::SeedJobDetails(SeedJobDetails::default().into())));
12237    /// ```
12238    pub fn set_job_details<
12239        T: std::convert::Into<std::option::Option<crate::model::background_job_log_entry::JobDetails>>,
12240    >(
12241        mut self,
12242        v: T,
12243    ) -> Self {
12244        self.job_details = v.into();
12245        self
12246    }
12247
12248    /// The value of [job_details][crate::model::BackgroundJobLogEntry::job_details]
12249    /// if it holds a `SeedJobDetails`, `None` if the field is not set or
12250    /// holds a different branch.
12251    pub fn seed_job_details(
12252        &self,
12253    ) -> std::option::Option<&std::boxed::Box<crate::model::background_job_log_entry::SeedJobDetails>>
12254    {
12255        #[allow(unreachable_patterns)]
12256        self.job_details.as_ref().and_then(|v| match v {
12257            crate::model::background_job_log_entry::JobDetails::SeedJobDetails(v) => {
12258                std::option::Option::Some(v)
12259            }
12260            _ => std::option::Option::None,
12261        })
12262    }
12263
12264    /// Sets the value of [job_details][crate::model::BackgroundJobLogEntry::job_details]
12265    /// to hold a `SeedJobDetails`.
12266    ///
12267    /// Note that all the setters affecting `job_details` are
12268    /// mutually exclusive.
12269    ///
12270    /// # Example
12271    /// ```ignore,no_run
12272    /// # use google_cloud_clouddms_v1::model::BackgroundJobLogEntry;
12273    /// use google_cloud_clouddms_v1::model::background_job_log_entry::SeedJobDetails;
12274    /// let x = BackgroundJobLogEntry::new().set_seed_job_details(SeedJobDetails::default()/* use setters */);
12275    /// assert!(x.seed_job_details().is_some());
12276    /// assert!(x.import_rules_job_details().is_none());
12277    /// assert!(x.convert_job_details().is_none());
12278    /// assert!(x.apply_job_details().is_none());
12279    /// ```
12280    pub fn set_seed_job_details<
12281        T: std::convert::Into<std::boxed::Box<crate::model::background_job_log_entry::SeedJobDetails>>,
12282    >(
12283        mut self,
12284        v: T,
12285    ) -> Self {
12286        self.job_details = std::option::Option::Some(
12287            crate::model::background_job_log_entry::JobDetails::SeedJobDetails(v.into()),
12288        );
12289        self
12290    }
12291
12292    /// The value of [job_details][crate::model::BackgroundJobLogEntry::job_details]
12293    /// if it holds a `ImportRulesJobDetails`, `None` if the field is not set or
12294    /// holds a different branch.
12295    pub fn import_rules_job_details(
12296        &self,
12297    ) -> std::option::Option<
12298        &std::boxed::Box<crate::model::background_job_log_entry::ImportRulesJobDetails>,
12299    > {
12300        #[allow(unreachable_patterns)]
12301        self.job_details.as_ref().and_then(|v| match v {
12302            crate::model::background_job_log_entry::JobDetails::ImportRulesJobDetails(v) => {
12303                std::option::Option::Some(v)
12304            }
12305            _ => std::option::Option::None,
12306        })
12307    }
12308
12309    /// Sets the value of [job_details][crate::model::BackgroundJobLogEntry::job_details]
12310    /// to hold a `ImportRulesJobDetails`.
12311    ///
12312    /// Note that all the setters affecting `job_details` are
12313    /// mutually exclusive.
12314    ///
12315    /// # Example
12316    /// ```ignore,no_run
12317    /// # use google_cloud_clouddms_v1::model::BackgroundJobLogEntry;
12318    /// use google_cloud_clouddms_v1::model::background_job_log_entry::ImportRulesJobDetails;
12319    /// let x = BackgroundJobLogEntry::new().set_import_rules_job_details(ImportRulesJobDetails::default()/* use setters */);
12320    /// assert!(x.import_rules_job_details().is_some());
12321    /// assert!(x.seed_job_details().is_none());
12322    /// assert!(x.convert_job_details().is_none());
12323    /// assert!(x.apply_job_details().is_none());
12324    /// ```
12325    pub fn set_import_rules_job_details<
12326        T: std::convert::Into<
12327                std::boxed::Box<crate::model::background_job_log_entry::ImportRulesJobDetails>,
12328            >,
12329    >(
12330        mut self,
12331        v: T,
12332    ) -> Self {
12333        self.job_details = std::option::Option::Some(
12334            crate::model::background_job_log_entry::JobDetails::ImportRulesJobDetails(v.into()),
12335        );
12336        self
12337    }
12338
12339    /// The value of [job_details][crate::model::BackgroundJobLogEntry::job_details]
12340    /// if it holds a `ConvertJobDetails`, `None` if the field is not set or
12341    /// holds a different branch.
12342    pub fn convert_job_details(
12343        &self,
12344    ) -> std::option::Option<
12345        &std::boxed::Box<crate::model::background_job_log_entry::ConvertJobDetails>,
12346    > {
12347        #[allow(unreachable_patterns)]
12348        self.job_details.as_ref().and_then(|v| match v {
12349            crate::model::background_job_log_entry::JobDetails::ConvertJobDetails(v) => {
12350                std::option::Option::Some(v)
12351            }
12352            _ => std::option::Option::None,
12353        })
12354    }
12355
12356    /// Sets the value of [job_details][crate::model::BackgroundJobLogEntry::job_details]
12357    /// to hold a `ConvertJobDetails`.
12358    ///
12359    /// Note that all the setters affecting `job_details` are
12360    /// mutually exclusive.
12361    ///
12362    /// # Example
12363    /// ```ignore,no_run
12364    /// # use google_cloud_clouddms_v1::model::BackgroundJobLogEntry;
12365    /// use google_cloud_clouddms_v1::model::background_job_log_entry::ConvertJobDetails;
12366    /// let x = BackgroundJobLogEntry::new().set_convert_job_details(ConvertJobDetails::default()/* use setters */);
12367    /// assert!(x.convert_job_details().is_some());
12368    /// assert!(x.seed_job_details().is_none());
12369    /// assert!(x.import_rules_job_details().is_none());
12370    /// assert!(x.apply_job_details().is_none());
12371    /// ```
12372    pub fn set_convert_job_details<
12373        T: std::convert::Into<
12374                std::boxed::Box<crate::model::background_job_log_entry::ConvertJobDetails>,
12375            >,
12376    >(
12377        mut self,
12378        v: T,
12379    ) -> Self {
12380        self.job_details = std::option::Option::Some(
12381            crate::model::background_job_log_entry::JobDetails::ConvertJobDetails(v.into()),
12382        );
12383        self
12384    }
12385
12386    /// The value of [job_details][crate::model::BackgroundJobLogEntry::job_details]
12387    /// if it holds a `ApplyJobDetails`, `None` if the field is not set or
12388    /// holds a different branch.
12389    pub fn apply_job_details(
12390        &self,
12391    ) -> std::option::Option<
12392        &std::boxed::Box<crate::model::background_job_log_entry::ApplyJobDetails>,
12393    > {
12394        #[allow(unreachable_patterns)]
12395        self.job_details.as_ref().and_then(|v| match v {
12396            crate::model::background_job_log_entry::JobDetails::ApplyJobDetails(v) => {
12397                std::option::Option::Some(v)
12398            }
12399            _ => std::option::Option::None,
12400        })
12401    }
12402
12403    /// Sets the value of [job_details][crate::model::BackgroundJobLogEntry::job_details]
12404    /// to hold a `ApplyJobDetails`.
12405    ///
12406    /// Note that all the setters affecting `job_details` are
12407    /// mutually exclusive.
12408    ///
12409    /// # Example
12410    /// ```ignore,no_run
12411    /// # use google_cloud_clouddms_v1::model::BackgroundJobLogEntry;
12412    /// use google_cloud_clouddms_v1::model::background_job_log_entry::ApplyJobDetails;
12413    /// let x = BackgroundJobLogEntry::new().set_apply_job_details(ApplyJobDetails::default()/* use setters */);
12414    /// assert!(x.apply_job_details().is_some());
12415    /// assert!(x.seed_job_details().is_none());
12416    /// assert!(x.import_rules_job_details().is_none());
12417    /// assert!(x.convert_job_details().is_none());
12418    /// ```
12419    pub fn set_apply_job_details<
12420        T: std::convert::Into<
12421                std::boxed::Box<crate::model::background_job_log_entry::ApplyJobDetails>,
12422            >,
12423    >(
12424        mut self,
12425        v: T,
12426    ) -> Self {
12427        self.job_details = std::option::Option::Some(
12428            crate::model::background_job_log_entry::JobDetails::ApplyJobDetails(v.into()),
12429        );
12430        self
12431    }
12432}
12433
12434impl wkt::message::Message for BackgroundJobLogEntry {
12435    fn typename() -> &'static str {
12436        "type.googleapis.com/google.cloud.clouddms.v1.BackgroundJobLogEntry"
12437    }
12438}
12439
12440/// Defines additional types related to [BackgroundJobLogEntry].
12441pub mod background_job_log_entry {
12442    #[allow(unused_imports)]
12443    use super::*;
12444
12445    /// Details regarding a Seed background job.
12446    #[derive(Clone, Default, PartialEq)]
12447    #[non_exhaustive]
12448    pub struct SeedJobDetails {
12449        /// Output only. The connection profile which was used for the seed job.
12450        pub connection_profile: std::string::String,
12451
12452        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12453    }
12454
12455    impl SeedJobDetails {
12456        pub fn new() -> Self {
12457            std::default::Default::default()
12458        }
12459
12460        /// Sets the value of [connection_profile][crate::model::background_job_log_entry::SeedJobDetails::connection_profile].
12461        ///
12462        /// # Example
12463        /// ```ignore,no_run
12464        /// # use google_cloud_clouddms_v1::model::background_job_log_entry::SeedJobDetails;
12465        /// let x = SeedJobDetails::new().set_connection_profile("example");
12466        /// ```
12467        pub fn set_connection_profile<T: std::convert::Into<std::string::String>>(
12468            mut self,
12469            v: T,
12470        ) -> Self {
12471            self.connection_profile = v.into();
12472            self
12473        }
12474    }
12475
12476    impl wkt::message::Message for SeedJobDetails {
12477        fn typename() -> &'static str {
12478            "type.googleapis.com/google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails"
12479        }
12480    }
12481
12482    /// Details regarding an Import Rules background job.
12483    #[derive(Clone, Default, PartialEq)]
12484    #[non_exhaustive]
12485    pub struct ImportRulesJobDetails {
12486        /// Output only. File names used for the import rules job.
12487        pub files: std::vec::Vec<std::string::String>,
12488
12489        /// Output only. The requested file format.
12490        pub file_format: crate::model::ImportRulesFileFormat,
12491
12492        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12493    }
12494
12495    impl ImportRulesJobDetails {
12496        pub fn new() -> Self {
12497            std::default::Default::default()
12498        }
12499
12500        /// Sets the value of [files][crate::model::background_job_log_entry::ImportRulesJobDetails::files].
12501        ///
12502        /// # Example
12503        /// ```ignore,no_run
12504        /// # use google_cloud_clouddms_v1::model::background_job_log_entry::ImportRulesJobDetails;
12505        /// let x = ImportRulesJobDetails::new().set_files(["a", "b", "c"]);
12506        /// ```
12507        pub fn set_files<T, V>(mut self, v: T) -> Self
12508        where
12509            T: std::iter::IntoIterator<Item = V>,
12510            V: std::convert::Into<std::string::String>,
12511        {
12512            use std::iter::Iterator;
12513            self.files = v.into_iter().map(|i| i.into()).collect();
12514            self
12515        }
12516
12517        /// Sets the value of [file_format][crate::model::background_job_log_entry::ImportRulesJobDetails::file_format].
12518        ///
12519        /// # Example
12520        /// ```ignore,no_run
12521        /// # use google_cloud_clouddms_v1::model::background_job_log_entry::ImportRulesJobDetails;
12522        /// use google_cloud_clouddms_v1::model::ImportRulesFileFormat;
12523        /// let x0 = ImportRulesJobDetails::new().set_file_format(ImportRulesFileFormat::HarbourBridgeSessionFile);
12524        /// let x1 = ImportRulesJobDetails::new().set_file_format(ImportRulesFileFormat::OratopgConfigFile);
12525        /// ```
12526        pub fn set_file_format<T: std::convert::Into<crate::model::ImportRulesFileFormat>>(
12527            mut self,
12528            v: T,
12529        ) -> Self {
12530            self.file_format = v.into();
12531            self
12532        }
12533    }
12534
12535    impl wkt::message::Message for ImportRulesJobDetails {
12536        fn typename() -> &'static str {
12537            "type.googleapis.com/google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails"
12538        }
12539    }
12540
12541    /// Details regarding a Convert background job.
12542    #[derive(Clone, Default, PartialEq)]
12543    #[non_exhaustive]
12544    pub struct ConvertJobDetails {
12545        /// Output only. AIP-160 based filter used to specify the entities to convert
12546        pub filter: std::string::String,
12547
12548        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12549    }
12550
12551    impl ConvertJobDetails {
12552        pub fn new() -> Self {
12553            std::default::Default::default()
12554        }
12555
12556        /// Sets the value of [filter][crate::model::background_job_log_entry::ConvertJobDetails::filter].
12557        ///
12558        /// # Example
12559        /// ```ignore,no_run
12560        /// # use google_cloud_clouddms_v1::model::background_job_log_entry::ConvertJobDetails;
12561        /// let x = ConvertJobDetails::new().set_filter("example");
12562        /// ```
12563        pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12564            self.filter = v.into();
12565            self
12566        }
12567    }
12568
12569    impl wkt::message::Message for ConvertJobDetails {
12570        fn typename() -> &'static str {
12571            "type.googleapis.com/google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails"
12572        }
12573    }
12574
12575    /// Details regarding an Apply background job.
12576    #[derive(Clone, Default, PartialEq)]
12577    #[non_exhaustive]
12578    pub struct ApplyJobDetails {
12579        /// Output only. The connection profile which was used for the apply job.
12580        pub connection_profile: std::string::String,
12581
12582        /// Output only. AIP-160 based filter used to specify the entities to apply
12583        pub filter: std::string::String,
12584
12585        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12586    }
12587
12588    impl ApplyJobDetails {
12589        pub fn new() -> Self {
12590            std::default::Default::default()
12591        }
12592
12593        /// Sets the value of [connection_profile][crate::model::background_job_log_entry::ApplyJobDetails::connection_profile].
12594        ///
12595        /// # Example
12596        /// ```ignore,no_run
12597        /// # use google_cloud_clouddms_v1::model::background_job_log_entry::ApplyJobDetails;
12598        /// let x = ApplyJobDetails::new().set_connection_profile("example");
12599        /// ```
12600        pub fn set_connection_profile<T: std::convert::Into<std::string::String>>(
12601            mut self,
12602            v: T,
12603        ) -> Self {
12604            self.connection_profile = v.into();
12605            self
12606        }
12607
12608        /// Sets the value of [filter][crate::model::background_job_log_entry::ApplyJobDetails::filter].
12609        ///
12610        /// # Example
12611        /// ```ignore,no_run
12612        /// # use google_cloud_clouddms_v1::model::background_job_log_entry::ApplyJobDetails;
12613        /// let x = ApplyJobDetails::new().set_filter("example");
12614        /// ```
12615        pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12616            self.filter = v.into();
12617            self
12618        }
12619    }
12620
12621    impl wkt::message::Message for ApplyJobDetails {
12622        fn typename() -> &'static str {
12623            "type.googleapis.com/google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails"
12624        }
12625    }
12626
12627    /// Final state after a job completes.
12628    ///
12629    /// # Working with unknown values
12630    ///
12631    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12632    /// additional enum variants at any time. Adding new variants is not considered
12633    /// a breaking change. Applications should write their code in anticipation of:
12634    ///
12635    /// - New values appearing in future releases of the client library, **and**
12636    /// - New values received dynamically, without application changes.
12637    ///
12638    /// Please consult the [Working with enums] section in the user guide for some
12639    /// guidelines.
12640    ///
12641    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12642    #[derive(Clone, Debug, PartialEq)]
12643    #[non_exhaustive]
12644    pub enum JobCompletionState {
12645        /// The status is not specified. This state is used when job is not yet
12646        /// finished.
12647        Unspecified,
12648        /// Success.
12649        Succeeded,
12650        /// Error.
12651        Failed,
12652        /// If set, the enum was initialized with an unknown value.
12653        ///
12654        /// Applications can examine the value using [JobCompletionState::value] or
12655        /// [JobCompletionState::name].
12656        UnknownValue(job_completion_state::UnknownValue),
12657    }
12658
12659    #[doc(hidden)]
12660    pub mod job_completion_state {
12661        #[allow(unused_imports)]
12662        use super::*;
12663        #[derive(Clone, Debug, PartialEq)]
12664        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12665    }
12666
12667    impl JobCompletionState {
12668        /// Gets the enum value.
12669        ///
12670        /// Returns `None` if the enum contains an unknown value deserialized from
12671        /// the string representation of enums.
12672        pub fn value(&self) -> std::option::Option<i32> {
12673            match self {
12674                Self::Unspecified => std::option::Option::Some(0),
12675                Self::Succeeded => std::option::Option::Some(1),
12676                Self::Failed => std::option::Option::Some(2),
12677                Self::UnknownValue(u) => u.0.value(),
12678            }
12679        }
12680
12681        /// Gets the enum value as a string.
12682        ///
12683        /// Returns `None` if the enum contains an unknown value deserialized from
12684        /// the integer representation of enums.
12685        pub fn name(&self) -> std::option::Option<&str> {
12686            match self {
12687                Self::Unspecified => std::option::Option::Some("JOB_COMPLETION_STATE_UNSPECIFIED"),
12688                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
12689                Self::Failed => std::option::Option::Some("FAILED"),
12690                Self::UnknownValue(u) => u.0.name(),
12691            }
12692        }
12693    }
12694
12695    impl std::default::Default for JobCompletionState {
12696        fn default() -> Self {
12697            use std::convert::From;
12698            Self::from(0)
12699        }
12700    }
12701
12702    impl std::fmt::Display for JobCompletionState {
12703        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12704            wkt::internal::display_enum(f, self.name(), self.value())
12705        }
12706    }
12707
12708    impl std::convert::From<i32> for JobCompletionState {
12709        fn from(value: i32) -> Self {
12710            match value {
12711                0 => Self::Unspecified,
12712                1 => Self::Succeeded,
12713                2 => Self::Failed,
12714                _ => Self::UnknownValue(job_completion_state::UnknownValue(
12715                    wkt::internal::UnknownEnumValue::Integer(value),
12716                )),
12717            }
12718        }
12719    }
12720
12721    impl std::convert::From<&str> for JobCompletionState {
12722        fn from(value: &str) -> Self {
12723            use std::string::ToString;
12724            match value {
12725                "JOB_COMPLETION_STATE_UNSPECIFIED" => Self::Unspecified,
12726                "SUCCEEDED" => Self::Succeeded,
12727                "FAILED" => Self::Failed,
12728                _ => Self::UnknownValue(job_completion_state::UnknownValue(
12729                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12730                )),
12731            }
12732        }
12733    }
12734
12735    impl serde::ser::Serialize for JobCompletionState {
12736        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12737        where
12738            S: serde::Serializer,
12739        {
12740            match self {
12741                Self::Unspecified => serializer.serialize_i32(0),
12742                Self::Succeeded => serializer.serialize_i32(1),
12743                Self::Failed => serializer.serialize_i32(2),
12744                Self::UnknownValue(u) => u.0.serialize(serializer),
12745            }
12746        }
12747    }
12748
12749    impl<'de> serde::de::Deserialize<'de> for JobCompletionState {
12750        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12751        where
12752            D: serde::Deserializer<'de>,
12753        {
12754            deserializer.deserialize_any(wkt::internal::EnumVisitor::<JobCompletionState>::new(
12755                ".google.cloud.clouddms.v1.BackgroundJobLogEntry.JobCompletionState",
12756            ))
12757        }
12758    }
12759
12760    #[derive(Clone, Debug, PartialEq)]
12761    #[non_exhaustive]
12762    pub enum JobDetails {
12763        /// Output only. Seed job details.
12764        SeedJobDetails(std::boxed::Box<crate::model::background_job_log_entry::SeedJobDetails>),
12765        /// Output only. Import rules job details.
12766        ImportRulesJobDetails(
12767            std::boxed::Box<crate::model::background_job_log_entry::ImportRulesJobDetails>,
12768        ),
12769        /// Output only. Convert job details.
12770        ConvertJobDetails(
12771            std::boxed::Box<crate::model::background_job_log_entry::ConvertJobDetails>,
12772        ),
12773        /// Output only. Apply job details.
12774        ApplyJobDetails(std::boxed::Box<crate::model::background_job_log_entry::ApplyJobDetails>),
12775    }
12776}
12777
12778/// A filter defining the entities that a mapping rule should be applied to.
12779/// When more than one field is specified, the rule is applied only to
12780/// entities which match all the fields.
12781#[derive(Clone, Default, PartialEq)]
12782#[non_exhaustive]
12783pub struct MappingRuleFilter {
12784    /// Optional. The rule should be applied to entities whose parent entity
12785    /// (fully qualified name) matches the given value.
12786    /// For example, if the rule applies to a table entity, the expected value
12787    /// should be a schema (schema). If the rule applies to a column or index
12788    /// entity, the expected value can be either a schema (schema) or a table
12789    /// (schema.table)
12790    pub parent_entity: std::string::String,
12791
12792    /// Optional. The rule should be applied to entities whose non-qualified name
12793    /// starts with the given prefix.
12794    pub entity_name_prefix: std::string::String,
12795
12796    /// Optional. The rule should be applied to entities whose non-qualified name
12797    /// ends with the given suffix.
12798    pub entity_name_suffix: std::string::String,
12799
12800    /// Optional. The rule should be applied to entities whose non-qualified name
12801    /// contains the given string.
12802    pub entity_name_contains: std::string::String,
12803
12804    /// Optional. The rule should be applied to specific entities defined by their
12805    /// fully qualified names.
12806    pub entities: std::vec::Vec<std::string::String>,
12807
12808    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12809}
12810
12811impl MappingRuleFilter {
12812    pub fn new() -> Self {
12813        std::default::Default::default()
12814    }
12815
12816    /// Sets the value of [parent_entity][crate::model::MappingRuleFilter::parent_entity].
12817    ///
12818    /// # Example
12819    /// ```ignore,no_run
12820    /// # use google_cloud_clouddms_v1::model::MappingRuleFilter;
12821    /// let x = MappingRuleFilter::new().set_parent_entity("example");
12822    /// ```
12823    pub fn set_parent_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12824        self.parent_entity = v.into();
12825        self
12826    }
12827
12828    /// Sets the value of [entity_name_prefix][crate::model::MappingRuleFilter::entity_name_prefix].
12829    ///
12830    /// # Example
12831    /// ```ignore,no_run
12832    /// # use google_cloud_clouddms_v1::model::MappingRuleFilter;
12833    /// let x = MappingRuleFilter::new().set_entity_name_prefix("example");
12834    /// ```
12835    pub fn set_entity_name_prefix<T: std::convert::Into<std::string::String>>(
12836        mut self,
12837        v: T,
12838    ) -> Self {
12839        self.entity_name_prefix = v.into();
12840        self
12841    }
12842
12843    /// Sets the value of [entity_name_suffix][crate::model::MappingRuleFilter::entity_name_suffix].
12844    ///
12845    /// # Example
12846    /// ```ignore,no_run
12847    /// # use google_cloud_clouddms_v1::model::MappingRuleFilter;
12848    /// let x = MappingRuleFilter::new().set_entity_name_suffix("example");
12849    /// ```
12850    pub fn set_entity_name_suffix<T: std::convert::Into<std::string::String>>(
12851        mut self,
12852        v: T,
12853    ) -> Self {
12854        self.entity_name_suffix = v.into();
12855        self
12856    }
12857
12858    /// Sets the value of [entity_name_contains][crate::model::MappingRuleFilter::entity_name_contains].
12859    ///
12860    /// # Example
12861    /// ```ignore,no_run
12862    /// # use google_cloud_clouddms_v1::model::MappingRuleFilter;
12863    /// let x = MappingRuleFilter::new().set_entity_name_contains("example");
12864    /// ```
12865    pub fn set_entity_name_contains<T: std::convert::Into<std::string::String>>(
12866        mut self,
12867        v: T,
12868    ) -> Self {
12869        self.entity_name_contains = v.into();
12870        self
12871    }
12872
12873    /// Sets the value of [entities][crate::model::MappingRuleFilter::entities].
12874    ///
12875    /// # Example
12876    /// ```ignore,no_run
12877    /// # use google_cloud_clouddms_v1::model::MappingRuleFilter;
12878    /// let x = MappingRuleFilter::new().set_entities(["a", "b", "c"]);
12879    /// ```
12880    pub fn set_entities<T, V>(mut self, v: T) -> Self
12881    where
12882        T: std::iter::IntoIterator<Item = V>,
12883        V: std::convert::Into<std::string::String>,
12884    {
12885        use std::iter::Iterator;
12886        self.entities = v.into_iter().map(|i| i.into()).collect();
12887        self
12888    }
12889}
12890
12891impl wkt::message::Message for MappingRuleFilter {
12892    fn typename() -> &'static str {
12893        "type.googleapis.com/google.cloud.clouddms.v1.MappingRuleFilter"
12894    }
12895}
12896
12897/// Definition of a transformation that is to be applied to a group of entities
12898/// in the source schema. Several such transformations can be applied to an
12899/// entity sequentially to define the corresponding entity in the target schema.
12900#[derive(Clone, Default, PartialEq)]
12901#[non_exhaustive]
12902pub struct MappingRule {
12903    /// Full name of the mapping rule resource, in the form of:
12904    /// projects/{project}/locations/{location}/conversionWorkspaces/{set}/mappingRule/{rule}.
12905    pub name: std::string::String,
12906
12907    /// Optional. A human readable name
12908    pub display_name: std::string::String,
12909
12910    /// Optional. The mapping rule state
12911    pub state: crate::model::mapping_rule::State,
12912
12913    /// Required. The rule scope
12914    pub rule_scope: crate::model::DatabaseEntityType,
12915
12916    /// Required. The rule filter
12917    pub filter: std::option::Option<crate::model::MappingRuleFilter>,
12918
12919    /// Required. The order in which the rule is applied. Lower order rules are
12920    /// applied before higher value rules so they may end up being overridden.
12921    pub rule_order: i64,
12922
12923    /// Output only. The revision ID of the mapping rule.
12924    /// A new revision is committed whenever the mapping rule is changed in any
12925    /// way. The format is an 8-character hexadecimal string.
12926    pub revision_id: std::string::String,
12927
12928    /// Output only. The timestamp that the revision was created.
12929    pub revision_create_time: std::option::Option<wkt::Timestamp>,
12930
12931    /// The rule specific details.
12932    pub details: std::option::Option<crate::model::mapping_rule::Details>,
12933
12934    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12935}
12936
12937impl MappingRule {
12938    pub fn new() -> Self {
12939        std::default::Default::default()
12940    }
12941
12942    /// Sets the value of [name][crate::model::MappingRule::name].
12943    ///
12944    /// # Example
12945    /// ```ignore,no_run
12946    /// # use google_cloud_clouddms_v1::model::MappingRule;
12947    /// let x = MappingRule::new().set_name("example");
12948    /// ```
12949    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12950        self.name = v.into();
12951        self
12952    }
12953
12954    /// Sets the value of [display_name][crate::model::MappingRule::display_name].
12955    ///
12956    /// # Example
12957    /// ```ignore,no_run
12958    /// # use google_cloud_clouddms_v1::model::MappingRule;
12959    /// let x = MappingRule::new().set_display_name("example");
12960    /// ```
12961    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12962        self.display_name = v.into();
12963        self
12964    }
12965
12966    /// Sets the value of [state][crate::model::MappingRule::state].
12967    ///
12968    /// # Example
12969    /// ```ignore,no_run
12970    /// # use google_cloud_clouddms_v1::model::MappingRule;
12971    /// use google_cloud_clouddms_v1::model::mapping_rule::State;
12972    /// let x0 = MappingRule::new().set_state(State::Enabled);
12973    /// let x1 = MappingRule::new().set_state(State::Disabled);
12974    /// let x2 = MappingRule::new().set_state(State::Deleted);
12975    /// ```
12976    pub fn set_state<T: std::convert::Into<crate::model::mapping_rule::State>>(
12977        mut self,
12978        v: T,
12979    ) -> Self {
12980        self.state = v.into();
12981        self
12982    }
12983
12984    /// Sets the value of [rule_scope][crate::model::MappingRule::rule_scope].
12985    ///
12986    /// # Example
12987    /// ```ignore,no_run
12988    /// # use google_cloud_clouddms_v1::model::MappingRule;
12989    /// use google_cloud_clouddms_v1::model::DatabaseEntityType;
12990    /// let x0 = MappingRule::new().set_rule_scope(DatabaseEntityType::Schema);
12991    /// let x1 = MappingRule::new().set_rule_scope(DatabaseEntityType::Table);
12992    /// let x2 = MappingRule::new().set_rule_scope(DatabaseEntityType::Column);
12993    /// ```
12994    pub fn set_rule_scope<T: std::convert::Into<crate::model::DatabaseEntityType>>(
12995        mut self,
12996        v: T,
12997    ) -> Self {
12998        self.rule_scope = v.into();
12999        self
13000    }
13001
13002    /// Sets the value of [filter][crate::model::MappingRule::filter].
13003    ///
13004    /// # Example
13005    /// ```ignore,no_run
13006    /// # use google_cloud_clouddms_v1::model::MappingRule;
13007    /// use google_cloud_clouddms_v1::model::MappingRuleFilter;
13008    /// let x = MappingRule::new().set_filter(MappingRuleFilter::default()/* use setters */);
13009    /// ```
13010    pub fn set_filter<T>(mut self, v: T) -> Self
13011    where
13012        T: std::convert::Into<crate::model::MappingRuleFilter>,
13013    {
13014        self.filter = std::option::Option::Some(v.into());
13015        self
13016    }
13017
13018    /// Sets or clears the value of [filter][crate::model::MappingRule::filter].
13019    ///
13020    /// # Example
13021    /// ```ignore,no_run
13022    /// # use google_cloud_clouddms_v1::model::MappingRule;
13023    /// use google_cloud_clouddms_v1::model::MappingRuleFilter;
13024    /// let x = MappingRule::new().set_or_clear_filter(Some(MappingRuleFilter::default()/* use setters */));
13025    /// let x = MappingRule::new().set_or_clear_filter(None::<MappingRuleFilter>);
13026    /// ```
13027    pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
13028    where
13029        T: std::convert::Into<crate::model::MappingRuleFilter>,
13030    {
13031        self.filter = v.map(|x| x.into());
13032        self
13033    }
13034
13035    /// Sets the value of [rule_order][crate::model::MappingRule::rule_order].
13036    ///
13037    /// # Example
13038    /// ```ignore,no_run
13039    /// # use google_cloud_clouddms_v1::model::MappingRule;
13040    /// let x = MappingRule::new().set_rule_order(42);
13041    /// ```
13042    pub fn set_rule_order<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13043        self.rule_order = v.into();
13044        self
13045    }
13046
13047    /// Sets the value of [revision_id][crate::model::MappingRule::revision_id].
13048    ///
13049    /// # Example
13050    /// ```ignore,no_run
13051    /// # use google_cloud_clouddms_v1::model::MappingRule;
13052    /// let x = MappingRule::new().set_revision_id("example");
13053    /// ```
13054    pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13055        self.revision_id = v.into();
13056        self
13057    }
13058
13059    /// Sets the value of [revision_create_time][crate::model::MappingRule::revision_create_time].
13060    ///
13061    /// # Example
13062    /// ```ignore,no_run
13063    /// # use google_cloud_clouddms_v1::model::MappingRule;
13064    /// use wkt::Timestamp;
13065    /// let x = MappingRule::new().set_revision_create_time(Timestamp::default()/* use setters */);
13066    /// ```
13067    pub fn set_revision_create_time<T>(mut self, v: T) -> Self
13068    where
13069        T: std::convert::Into<wkt::Timestamp>,
13070    {
13071        self.revision_create_time = std::option::Option::Some(v.into());
13072        self
13073    }
13074
13075    /// Sets or clears the value of [revision_create_time][crate::model::MappingRule::revision_create_time].
13076    ///
13077    /// # Example
13078    /// ```ignore,no_run
13079    /// # use google_cloud_clouddms_v1::model::MappingRule;
13080    /// use wkt::Timestamp;
13081    /// let x = MappingRule::new().set_or_clear_revision_create_time(Some(Timestamp::default()/* use setters */));
13082    /// let x = MappingRule::new().set_or_clear_revision_create_time(None::<Timestamp>);
13083    /// ```
13084    pub fn set_or_clear_revision_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13085    where
13086        T: std::convert::Into<wkt::Timestamp>,
13087    {
13088        self.revision_create_time = v.map(|x| x.into());
13089        self
13090    }
13091
13092    /// Sets the value of [details][crate::model::MappingRule::details].
13093    ///
13094    /// Note that all the setters affecting `details` are mutually
13095    /// exclusive.
13096    ///
13097    /// # Example
13098    /// ```ignore,no_run
13099    /// # use google_cloud_clouddms_v1::model::MappingRule;
13100    /// use google_cloud_clouddms_v1::model::SingleEntityRename;
13101    /// let x = MappingRule::new().set_details(Some(
13102    ///     google_cloud_clouddms_v1::model::mapping_rule::Details::SingleEntityRename(SingleEntityRename::default().into())));
13103    /// ```
13104    pub fn set_details<
13105        T: std::convert::Into<std::option::Option<crate::model::mapping_rule::Details>>,
13106    >(
13107        mut self,
13108        v: T,
13109    ) -> Self {
13110        self.details = v.into();
13111        self
13112    }
13113
13114    /// The value of [details][crate::model::MappingRule::details]
13115    /// if it holds a `SingleEntityRename`, `None` if the field is not set or
13116    /// holds a different branch.
13117    pub fn single_entity_rename(
13118        &self,
13119    ) -> std::option::Option<&std::boxed::Box<crate::model::SingleEntityRename>> {
13120        #[allow(unreachable_patterns)]
13121        self.details.as_ref().and_then(|v| match v {
13122            crate::model::mapping_rule::Details::SingleEntityRename(v) => {
13123                std::option::Option::Some(v)
13124            }
13125            _ => std::option::Option::None,
13126        })
13127    }
13128
13129    /// Sets the value of [details][crate::model::MappingRule::details]
13130    /// to hold a `SingleEntityRename`.
13131    ///
13132    /// Note that all the setters affecting `details` are
13133    /// mutually exclusive.
13134    ///
13135    /// # Example
13136    /// ```ignore,no_run
13137    /// # use google_cloud_clouddms_v1::model::MappingRule;
13138    /// use google_cloud_clouddms_v1::model::SingleEntityRename;
13139    /// let x = MappingRule::new().set_single_entity_rename(SingleEntityRename::default()/* use setters */);
13140    /// assert!(x.single_entity_rename().is_some());
13141    /// assert!(x.multi_entity_rename().is_none());
13142    /// assert!(x.entity_move().is_none());
13143    /// assert!(x.single_column_change().is_none());
13144    /// assert!(x.multi_column_data_type_change().is_none());
13145    /// assert!(x.conditional_column_set_value().is_none());
13146    /// assert!(x.convert_rowid_column().is_none());
13147    /// assert!(x.set_table_primary_key().is_none());
13148    /// assert!(x.single_package_change().is_none());
13149    /// assert!(x.source_sql_change().is_none());
13150    /// assert!(x.filter_table_columns().is_none());
13151    /// ```
13152    pub fn set_single_entity_rename<
13153        T: std::convert::Into<std::boxed::Box<crate::model::SingleEntityRename>>,
13154    >(
13155        mut self,
13156        v: T,
13157    ) -> Self {
13158        self.details = std::option::Option::Some(
13159            crate::model::mapping_rule::Details::SingleEntityRename(v.into()),
13160        );
13161        self
13162    }
13163
13164    /// The value of [details][crate::model::MappingRule::details]
13165    /// if it holds a `MultiEntityRename`, `None` if the field is not set or
13166    /// holds a different branch.
13167    pub fn multi_entity_rename(
13168        &self,
13169    ) -> std::option::Option<&std::boxed::Box<crate::model::MultiEntityRename>> {
13170        #[allow(unreachable_patterns)]
13171        self.details.as_ref().and_then(|v| match v {
13172            crate::model::mapping_rule::Details::MultiEntityRename(v) => {
13173                std::option::Option::Some(v)
13174            }
13175            _ => std::option::Option::None,
13176        })
13177    }
13178
13179    /// Sets the value of [details][crate::model::MappingRule::details]
13180    /// to hold a `MultiEntityRename`.
13181    ///
13182    /// Note that all the setters affecting `details` are
13183    /// mutually exclusive.
13184    ///
13185    /// # Example
13186    /// ```ignore,no_run
13187    /// # use google_cloud_clouddms_v1::model::MappingRule;
13188    /// use google_cloud_clouddms_v1::model::MultiEntityRename;
13189    /// let x = MappingRule::new().set_multi_entity_rename(MultiEntityRename::default()/* use setters */);
13190    /// assert!(x.multi_entity_rename().is_some());
13191    /// assert!(x.single_entity_rename().is_none());
13192    /// assert!(x.entity_move().is_none());
13193    /// assert!(x.single_column_change().is_none());
13194    /// assert!(x.multi_column_data_type_change().is_none());
13195    /// assert!(x.conditional_column_set_value().is_none());
13196    /// assert!(x.convert_rowid_column().is_none());
13197    /// assert!(x.set_table_primary_key().is_none());
13198    /// assert!(x.single_package_change().is_none());
13199    /// assert!(x.source_sql_change().is_none());
13200    /// assert!(x.filter_table_columns().is_none());
13201    /// ```
13202    pub fn set_multi_entity_rename<
13203        T: std::convert::Into<std::boxed::Box<crate::model::MultiEntityRename>>,
13204    >(
13205        mut self,
13206        v: T,
13207    ) -> Self {
13208        self.details = std::option::Option::Some(
13209            crate::model::mapping_rule::Details::MultiEntityRename(v.into()),
13210        );
13211        self
13212    }
13213
13214    /// The value of [details][crate::model::MappingRule::details]
13215    /// if it holds a `EntityMove`, `None` if the field is not set or
13216    /// holds a different branch.
13217    pub fn entity_move(&self) -> std::option::Option<&std::boxed::Box<crate::model::EntityMove>> {
13218        #[allow(unreachable_patterns)]
13219        self.details.as_ref().and_then(|v| match v {
13220            crate::model::mapping_rule::Details::EntityMove(v) => std::option::Option::Some(v),
13221            _ => std::option::Option::None,
13222        })
13223    }
13224
13225    /// Sets the value of [details][crate::model::MappingRule::details]
13226    /// to hold a `EntityMove`.
13227    ///
13228    /// Note that all the setters affecting `details` are
13229    /// mutually exclusive.
13230    ///
13231    /// # Example
13232    /// ```ignore,no_run
13233    /// # use google_cloud_clouddms_v1::model::MappingRule;
13234    /// use google_cloud_clouddms_v1::model::EntityMove;
13235    /// let x = MappingRule::new().set_entity_move(EntityMove::default()/* use setters */);
13236    /// assert!(x.entity_move().is_some());
13237    /// assert!(x.single_entity_rename().is_none());
13238    /// assert!(x.multi_entity_rename().is_none());
13239    /// assert!(x.single_column_change().is_none());
13240    /// assert!(x.multi_column_data_type_change().is_none());
13241    /// assert!(x.conditional_column_set_value().is_none());
13242    /// assert!(x.convert_rowid_column().is_none());
13243    /// assert!(x.set_table_primary_key().is_none());
13244    /// assert!(x.single_package_change().is_none());
13245    /// assert!(x.source_sql_change().is_none());
13246    /// assert!(x.filter_table_columns().is_none());
13247    /// ```
13248    pub fn set_entity_move<T: std::convert::Into<std::boxed::Box<crate::model::EntityMove>>>(
13249        mut self,
13250        v: T,
13251    ) -> Self {
13252        self.details =
13253            std::option::Option::Some(crate::model::mapping_rule::Details::EntityMove(v.into()));
13254        self
13255    }
13256
13257    /// The value of [details][crate::model::MappingRule::details]
13258    /// if it holds a `SingleColumnChange`, `None` if the field is not set or
13259    /// holds a different branch.
13260    pub fn single_column_change(
13261        &self,
13262    ) -> std::option::Option<&std::boxed::Box<crate::model::SingleColumnChange>> {
13263        #[allow(unreachable_patterns)]
13264        self.details.as_ref().and_then(|v| match v {
13265            crate::model::mapping_rule::Details::SingleColumnChange(v) => {
13266                std::option::Option::Some(v)
13267            }
13268            _ => std::option::Option::None,
13269        })
13270    }
13271
13272    /// Sets the value of [details][crate::model::MappingRule::details]
13273    /// to hold a `SingleColumnChange`.
13274    ///
13275    /// Note that all the setters affecting `details` are
13276    /// mutually exclusive.
13277    ///
13278    /// # Example
13279    /// ```ignore,no_run
13280    /// # use google_cloud_clouddms_v1::model::MappingRule;
13281    /// use google_cloud_clouddms_v1::model::SingleColumnChange;
13282    /// let x = MappingRule::new().set_single_column_change(SingleColumnChange::default()/* use setters */);
13283    /// assert!(x.single_column_change().is_some());
13284    /// assert!(x.single_entity_rename().is_none());
13285    /// assert!(x.multi_entity_rename().is_none());
13286    /// assert!(x.entity_move().is_none());
13287    /// assert!(x.multi_column_data_type_change().is_none());
13288    /// assert!(x.conditional_column_set_value().is_none());
13289    /// assert!(x.convert_rowid_column().is_none());
13290    /// assert!(x.set_table_primary_key().is_none());
13291    /// assert!(x.single_package_change().is_none());
13292    /// assert!(x.source_sql_change().is_none());
13293    /// assert!(x.filter_table_columns().is_none());
13294    /// ```
13295    pub fn set_single_column_change<
13296        T: std::convert::Into<std::boxed::Box<crate::model::SingleColumnChange>>,
13297    >(
13298        mut self,
13299        v: T,
13300    ) -> Self {
13301        self.details = std::option::Option::Some(
13302            crate::model::mapping_rule::Details::SingleColumnChange(v.into()),
13303        );
13304        self
13305    }
13306
13307    /// The value of [details][crate::model::MappingRule::details]
13308    /// if it holds a `MultiColumnDataTypeChange`, `None` if the field is not set or
13309    /// holds a different branch.
13310    pub fn multi_column_data_type_change(
13311        &self,
13312    ) -> std::option::Option<&std::boxed::Box<crate::model::MultiColumnDatatypeChange>> {
13313        #[allow(unreachable_patterns)]
13314        self.details.as_ref().and_then(|v| match v {
13315            crate::model::mapping_rule::Details::MultiColumnDataTypeChange(v) => {
13316                std::option::Option::Some(v)
13317            }
13318            _ => std::option::Option::None,
13319        })
13320    }
13321
13322    /// Sets the value of [details][crate::model::MappingRule::details]
13323    /// to hold a `MultiColumnDataTypeChange`.
13324    ///
13325    /// Note that all the setters affecting `details` are
13326    /// mutually exclusive.
13327    ///
13328    /// # Example
13329    /// ```ignore,no_run
13330    /// # use google_cloud_clouddms_v1::model::MappingRule;
13331    /// use google_cloud_clouddms_v1::model::MultiColumnDatatypeChange;
13332    /// let x = MappingRule::new().set_multi_column_data_type_change(MultiColumnDatatypeChange::default()/* use setters */);
13333    /// assert!(x.multi_column_data_type_change().is_some());
13334    /// assert!(x.single_entity_rename().is_none());
13335    /// assert!(x.multi_entity_rename().is_none());
13336    /// assert!(x.entity_move().is_none());
13337    /// assert!(x.single_column_change().is_none());
13338    /// assert!(x.conditional_column_set_value().is_none());
13339    /// assert!(x.convert_rowid_column().is_none());
13340    /// assert!(x.set_table_primary_key().is_none());
13341    /// assert!(x.single_package_change().is_none());
13342    /// assert!(x.source_sql_change().is_none());
13343    /// assert!(x.filter_table_columns().is_none());
13344    /// ```
13345    pub fn set_multi_column_data_type_change<
13346        T: std::convert::Into<std::boxed::Box<crate::model::MultiColumnDatatypeChange>>,
13347    >(
13348        mut self,
13349        v: T,
13350    ) -> Self {
13351        self.details = std::option::Option::Some(
13352            crate::model::mapping_rule::Details::MultiColumnDataTypeChange(v.into()),
13353        );
13354        self
13355    }
13356
13357    /// The value of [details][crate::model::MappingRule::details]
13358    /// if it holds a `ConditionalColumnSetValue`, `None` if the field is not set or
13359    /// holds a different branch.
13360    pub fn conditional_column_set_value(
13361        &self,
13362    ) -> std::option::Option<&std::boxed::Box<crate::model::ConditionalColumnSetValue>> {
13363        #[allow(unreachable_patterns)]
13364        self.details.as_ref().and_then(|v| match v {
13365            crate::model::mapping_rule::Details::ConditionalColumnSetValue(v) => {
13366                std::option::Option::Some(v)
13367            }
13368            _ => std::option::Option::None,
13369        })
13370    }
13371
13372    /// Sets the value of [details][crate::model::MappingRule::details]
13373    /// to hold a `ConditionalColumnSetValue`.
13374    ///
13375    /// Note that all the setters affecting `details` are
13376    /// mutually exclusive.
13377    ///
13378    /// # Example
13379    /// ```ignore,no_run
13380    /// # use google_cloud_clouddms_v1::model::MappingRule;
13381    /// use google_cloud_clouddms_v1::model::ConditionalColumnSetValue;
13382    /// let x = MappingRule::new().set_conditional_column_set_value(ConditionalColumnSetValue::default()/* use setters */);
13383    /// assert!(x.conditional_column_set_value().is_some());
13384    /// assert!(x.single_entity_rename().is_none());
13385    /// assert!(x.multi_entity_rename().is_none());
13386    /// assert!(x.entity_move().is_none());
13387    /// assert!(x.single_column_change().is_none());
13388    /// assert!(x.multi_column_data_type_change().is_none());
13389    /// assert!(x.convert_rowid_column().is_none());
13390    /// assert!(x.set_table_primary_key().is_none());
13391    /// assert!(x.single_package_change().is_none());
13392    /// assert!(x.source_sql_change().is_none());
13393    /// assert!(x.filter_table_columns().is_none());
13394    /// ```
13395    pub fn set_conditional_column_set_value<
13396        T: std::convert::Into<std::boxed::Box<crate::model::ConditionalColumnSetValue>>,
13397    >(
13398        mut self,
13399        v: T,
13400    ) -> Self {
13401        self.details = std::option::Option::Some(
13402            crate::model::mapping_rule::Details::ConditionalColumnSetValue(v.into()),
13403        );
13404        self
13405    }
13406
13407    /// The value of [details][crate::model::MappingRule::details]
13408    /// if it holds a `ConvertRowidColumn`, `None` if the field is not set or
13409    /// holds a different branch.
13410    pub fn convert_rowid_column(
13411        &self,
13412    ) -> std::option::Option<&std::boxed::Box<crate::model::ConvertRowIdToColumn>> {
13413        #[allow(unreachable_patterns)]
13414        self.details.as_ref().and_then(|v| match v {
13415            crate::model::mapping_rule::Details::ConvertRowidColumn(v) => {
13416                std::option::Option::Some(v)
13417            }
13418            _ => std::option::Option::None,
13419        })
13420    }
13421
13422    /// Sets the value of [details][crate::model::MappingRule::details]
13423    /// to hold a `ConvertRowidColumn`.
13424    ///
13425    /// Note that all the setters affecting `details` are
13426    /// mutually exclusive.
13427    ///
13428    /// # Example
13429    /// ```ignore,no_run
13430    /// # use google_cloud_clouddms_v1::model::MappingRule;
13431    /// use google_cloud_clouddms_v1::model::ConvertRowIdToColumn;
13432    /// let x = MappingRule::new().set_convert_rowid_column(ConvertRowIdToColumn::default()/* use setters */);
13433    /// assert!(x.convert_rowid_column().is_some());
13434    /// assert!(x.single_entity_rename().is_none());
13435    /// assert!(x.multi_entity_rename().is_none());
13436    /// assert!(x.entity_move().is_none());
13437    /// assert!(x.single_column_change().is_none());
13438    /// assert!(x.multi_column_data_type_change().is_none());
13439    /// assert!(x.conditional_column_set_value().is_none());
13440    /// assert!(x.set_table_primary_key().is_none());
13441    /// assert!(x.single_package_change().is_none());
13442    /// assert!(x.source_sql_change().is_none());
13443    /// assert!(x.filter_table_columns().is_none());
13444    /// ```
13445    pub fn set_convert_rowid_column<
13446        T: std::convert::Into<std::boxed::Box<crate::model::ConvertRowIdToColumn>>,
13447    >(
13448        mut self,
13449        v: T,
13450    ) -> Self {
13451        self.details = std::option::Option::Some(
13452            crate::model::mapping_rule::Details::ConvertRowidColumn(v.into()),
13453        );
13454        self
13455    }
13456
13457    /// The value of [details][crate::model::MappingRule::details]
13458    /// if it holds a `SetTablePrimaryKey`, `None` if the field is not set or
13459    /// holds a different branch.
13460    pub fn set_table_primary_key(
13461        &self,
13462    ) -> std::option::Option<&std::boxed::Box<crate::model::SetTablePrimaryKey>> {
13463        #[allow(unreachable_patterns)]
13464        self.details.as_ref().and_then(|v| match v {
13465            crate::model::mapping_rule::Details::SetTablePrimaryKey(v) => {
13466                std::option::Option::Some(v)
13467            }
13468            _ => std::option::Option::None,
13469        })
13470    }
13471
13472    /// Sets the value of [details][crate::model::MappingRule::details]
13473    /// to hold a `SetTablePrimaryKey`.
13474    ///
13475    /// Note that all the setters affecting `details` are
13476    /// mutually exclusive.
13477    ///
13478    /// # Example
13479    /// ```ignore,no_run
13480    /// # use google_cloud_clouddms_v1::model::MappingRule;
13481    /// use google_cloud_clouddms_v1::model::SetTablePrimaryKey;
13482    /// let x = MappingRule::new().set_set_table_primary_key(SetTablePrimaryKey::default()/* use setters */);
13483    /// assert!(x.set_table_primary_key().is_some());
13484    /// assert!(x.single_entity_rename().is_none());
13485    /// assert!(x.multi_entity_rename().is_none());
13486    /// assert!(x.entity_move().is_none());
13487    /// assert!(x.single_column_change().is_none());
13488    /// assert!(x.multi_column_data_type_change().is_none());
13489    /// assert!(x.conditional_column_set_value().is_none());
13490    /// assert!(x.convert_rowid_column().is_none());
13491    /// assert!(x.single_package_change().is_none());
13492    /// assert!(x.source_sql_change().is_none());
13493    /// assert!(x.filter_table_columns().is_none());
13494    /// ```
13495    pub fn set_set_table_primary_key<
13496        T: std::convert::Into<std::boxed::Box<crate::model::SetTablePrimaryKey>>,
13497    >(
13498        mut self,
13499        v: T,
13500    ) -> Self {
13501        self.details = std::option::Option::Some(
13502            crate::model::mapping_rule::Details::SetTablePrimaryKey(v.into()),
13503        );
13504        self
13505    }
13506
13507    /// The value of [details][crate::model::MappingRule::details]
13508    /// if it holds a `SinglePackageChange`, `None` if the field is not set or
13509    /// holds a different branch.
13510    pub fn single_package_change(
13511        &self,
13512    ) -> std::option::Option<&std::boxed::Box<crate::model::SinglePackageChange>> {
13513        #[allow(unreachable_patterns)]
13514        self.details.as_ref().and_then(|v| match v {
13515            crate::model::mapping_rule::Details::SinglePackageChange(v) => {
13516                std::option::Option::Some(v)
13517            }
13518            _ => std::option::Option::None,
13519        })
13520    }
13521
13522    /// Sets the value of [details][crate::model::MappingRule::details]
13523    /// to hold a `SinglePackageChange`.
13524    ///
13525    /// Note that all the setters affecting `details` are
13526    /// mutually exclusive.
13527    ///
13528    /// # Example
13529    /// ```ignore,no_run
13530    /// # use google_cloud_clouddms_v1::model::MappingRule;
13531    /// use google_cloud_clouddms_v1::model::SinglePackageChange;
13532    /// let x = MappingRule::new().set_single_package_change(SinglePackageChange::default()/* use setters */);
13533    /// assert!(x.single_package_change().is_some());
13534    /// assert!(x.single_entity_rename().is_none());
13535    /// assert!(x.multi_entity_rename().is_none());
13536    /// assert!(x.entity_move().is_none());
13537    /// assert!(x.single_column_change().is_none());
13538    /// assert!(x.multi_column_data_type_change().is_none());
13539    /// assert!(x.conditional_column_set_value().is_none());
13540    /// assert!(x.convert_rowid_column().is_none());
13541    /// assert!(x.set_table_primary_key().is_none());
13542    /// assert!(x.source_sql_change().is_none());
13543    /// assert!(x.filter_table_columns().is_none());
13544    /// ```
13545    pub fn set_single_package_change<
13546        T: std::convert::Into<std::boxed::Box<crate::model::SinglePackageChange>>,
13547    >(
13548        mut self,
13549        v: T,
13550    ) -> Self {
13551        self.details = std::option::Option::Some(
13552            crate::model::mapping_rule::Details::SinglePackageChange(v.into()),
13553        );
13554        self
13555    }
13556
13557    /// The value of [details][crate::model::MappingRule::details]
13558    /// if it holds a `SourceSqlChange`, `None` if the field is not set or
13559    /// holds a different branch.
13560    pub fn source_sql_change(
13561        &self,
13562    ) -> std::option::Option<&std::boxed::Box<crate::model::SourceSqlChange>> {
13563        #[allow(unreachable_patterns)]
13564        self.details.as_ref().and_then(|v| match v {
13565            crate::model::mapping_rule::Details::SourceSqlChange(v) => std::option::Option::Some(v),
13566            _ => std::option::Option::None,
13567        })
13568    }
13569
13570    /// Sets the value of [details][crate::model::MappingRule::details]
13571    /// to hold a `SourceSqlChange`.
13572    ///
13573    /// Note that all the setters affecting `details` are
13574    /// mutually exclusive.
13575    ///
13576    /// # Example
13577    /// ```ignore,no_run
13578    /// # use google_cloud_clouddms_v1::model::MappingRule;
13579    /// use google_cloud_clouddms_v1::model::SourceSqlChange;
13580    /// let x = MappingRule::new().set_source_sql_change(SourceSqlChange::default()/* use setters */);
13581    /// assert!(x.source_sql_change().is_some());
13582    /// assert!(x.single_entity_rename().is_none());
13583    /// assert!(x.multi_entity_rename().is_none());
13584    /// assert!(x.entity_move().is_none());
13585    /// assert!(x.single_column_change().is_none());
13586    /// assert!(x.multi_column_data_type_change().is_none());
13587    /// assert!(x.conditional_column_set_value().is_none());
13588    /// assert!(x.convert_rowid_column().is_none());
13589    /// assert!(x.set_table_primary_key().is_none());
13590    /// assert!(x.single_package_change().is_none());
13591    /// assert!(x.filter_table_columns().is_none());
13592    /// ```
13593    pub fn set_source_sql_change<
13594        T: std::convert::Into<std::boxed::Box<crate::model::SourceSqlChange>>,
13595    >(
13596        mut self,
13597        v: T,
13598    ) -> Self {
13599        self.details = std::option::Option::Some(
13600            crate::model::mapping_rule::Details::SourceSqlChange(v.into()),
13601        );
13602        self
13603    }
13604
13605    /// The value of [details][crate::model::MappingRule::details]
13606    /// if it holds a `FilterTableColumns`, `None` if the field is not set or
13607    /// holds a different branch.
13608    pub fn filter_table_columns(
13609        &self,
13610    ) -> std::option::Option<&std::boxed::Box<crate::model::FilterTableColumns>> {
13611        #[allow(unreachable_patterns)]
13612        self.details.as_ref().and_then(|v| match v {
13613            crate::model::mapping_rule::Details::FilterTableColumns(v) => {
13614                std::option::Option::Some(v)
13615            }
13616            _ => std::option::Option::None,
13617        })
13618    }
13619
13620    /// Sets the value of [details][crate::model::MappingRule::details]
13621    /// to hold a `FilterTableColumns`.
13622    ///
13623    /// Note that all the setters affecting `details` are
13624    /// mutually exclusive.
13625    ///
13626    /// # Example
13627    /// ```ignore,no_run
13628    /// # use google_cloud_clouddms_v1::model::MappingRule;
13629    /// use google_cloud_clouddms_v1::model::FilterTableColumns;
13630    /// let x = MappingRule::new().set_filter_table_columns(FilterTableColumns::default()/* use setters */);
13631    /// assert!(x.filter_table_columns().is_some());
13632    /// assert!(x.single_entity_rename().is_none());
13633    /// assert!(x.multi_entity_rename().is_none());
13634    /// assert!(x.entity_move().is_none());
13635    /// assert!(x.single_column_change().is_none());
13636    /// assert!(x.multi_column_data_type_change().is_none());
13637    /// assert!(x.conditional_column_set_value().is_none());
13638    /// assert!(x.convert_rowid_column().is_none());
13639    /// assert!(x.set_table_primary_key().is_none());
13640    /// assert!(x.single_package_change().is_none());
13641    /// assert!(x.source_sql_change().is_none());
13642    /// ```
13643    pub fn set_filter_table_columns<
13644        T: std::convert::Into<std::boxed::Box<crate::model::FilterTableColumns>>,
13645    >(
13646        mut self,
13647        v: T,
13648    ) -> Self {
13649        self.details = std::option::Option::Some(
13650            crate::model::mapping_rule::Details::FilterTableColumns(v.into()),
13651        );
13652        self
13653    }
13654}
13655
13656impl wkt::message::Message for MappingRule {
13657    fn typename() -> &'static str {
13658        "type.googleapis.com/google.cloud.clouddms.v1.MappingRule"
13659    }
13660}
13661
13662/// Defines additional types related to [MappingRule].
13663pub mod mapping_rule {
13664    #[allow(unused_imports)]
13665    use super::*;
13666
13667    /// The current mapping rule state such as enabled, disabled or deleted.
13668    ///
13669    /// # Working with unknown values
13670    ///
13671    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13672    /// additional enum variants at any time. Adding new variants is not considered
13673    /// a breaking change. Applications should write their code in anticipation of:
13674    ///
13675    /// - New values appearing in future releases of the client library, **and**
13676    /// - New values received dynamically, without application changes.
13677    ///
13678    /// Please consult the [Working with enums] section in the user guide for some
13679    /// guidelines.
13680    ///
13681    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13682    #[derive(Clone, Debug, PartialEq)]
13683    #[non_exhaustive]
13684    pub enum State {
13685        /// The state of the mapping rule is unknown.
13686        Unspecified,
13687        /// The rule is enabled.
13688        Enabled,
13689        /// The rule is disabled.
13690        Disabled,
13691        /// The rule is logically deleted.
13692        Deleted,
13693        /// If set, the enum was initialized with an unknown value.
13694        ///
13695        /// Applications can examine the value using [State::value] or
13696        /// [State::name].
13697        UnknownValue(state::UnknownValue),
13698    }
13699
13700    #[doc(hidden)]
13701    pub mod state {
13702        #[allow(unused_imports)]
13703        use super::*;
13704        #[derive(Clone, Debug, PartialEq)]
13705        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13706    }
13707
13708    impl State {
13709        /// Gets the enum value.
13710        ///
13711        /// Returns `None` if the enum contains an unknown value deserialized from
13712        /// the string representation of enums.
13713        pub fn value(&self) -> std::option::Option<i32> {
13714            match self {
13715                Self::Unspecified => std::option::Option::Some(0),
13716                Self::Enabled => std::option::Option::Some(1),
13717                Self::Disabled => std::option::Option::Some(2),
13718                Self::Deleted => std::option::Option::Some(3),
13719                Self::UnknownValue(u) => u.0.value(),
13720            }
13721        }
13722
13723        /// Gets the enum value as a string.
13724        ///
13725        /// Returns `None` if the enum contains an unknown value deserialized from
13726        /// the integer representation of enums.
13727        pub fn name(&self) -> std::option::Option<&str> {
13728            match self {
13729                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13730                Self::Enabled => std::option::Option::Some("ENABLED"),
13731                Self::Disabled => std::option::Option::Some("DISABLED"),
13732                Self::Deleted => std::option::Option::Some("DELETED"),
13733                Self::UnknownValue(u) => u.0.name(),
13734            }
13735        }
13736    }
13737
13738    impl std::default::Default for State {
13739        fn default() -> Self {
13740            use std::convert::From;
13741            Self::from(0)
13742        }
13743    }
13744
13745    impl std::fmt::Display for State {
13746        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13747            wkt::internal::display_enum(f, self.name(), self.value())
13748        }
13749    }
13750
13751    impl std::convert::From<i32> for State {
13752        fn from(value: i32) -> Self {
13753            match value {
13754                0 => Self::Unspecified,
13755                1 => Self::Enabled,
13756                2 => Self::Disabled,
13757                3 => Self::Deleted,
13758                _ => Self::UnknownValue(state::UnknownValue(
13759                    wkt::internal::UnknownEnumValue::Integer(value),
13760                )),
13761            }
13762        }
13763    }
13764
13765    impl std::convert::From<&str> for State {
13766        fn from(value: &str) -> Self {
13767            use std::string::ToString;
13768            match value {
13769                "STATE_UNSPECIFIED" => Self::Unspecified,
13770                "ENABLED" => Self::Enabled,
13771                "DISABLED" => Self::Disabled,
13772                "DELETED" => Self::Deleted,
13773                _ => Self::UnknownValue(state::UnknownValue(
13774                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13775                )),
13776            }
13777        }
13778    }
13779
13780    impl serde::ser::Serialize for State {
13781        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13782        where
13783            S: serde::Serializer,
13784        {
13785            match self {
13786                Self::Unspecified => serializer.serialize_i32(0),
13787                Self::Enabled => serializer.serialize_i32(1),
13788                Self::Disabled => serializer.serialize_i32(2),
13789                Self::Deleted => serializer.serialize_i32(3),
13790                Self::UnknownValue(u) => u.0.serialize(serializer),
13791            }
13792        }
13793    }
13794
13795    impl<'de> serde::de::Deserialize<'de> for State {
13796        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13797        where
13798            D: serde::Deserializer<'de>,
13799        {
13800            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13801                ".google.cloud.clouddms.v1.MappingRule.State",
13802            ))
13803        }
13804    }
13805
13806    /// The rule specific details.
13807    #[derive(Clone, Debug, PartialEq)]
13808    #[non_exhaustive]
13809    pub enum Details {
13810        /// Optional. Rule to specify how a single entity should be renamed.
13811        SingleEntityRename(std::boxed::Box<crate::model::SingleEntityRename>),
13812        /// Optional. Rule to specify how multiple entities should be renamed.
13813        MultiEntityRename(std::boxed::Box<crate::model::MultiEntityRename>),
13814        /// Optional. Rule to specify how multiple entities should be relocated into
13815        /// a different schema.
13816        EntityMove(std::boxed::Box<crate::model::EntityMove>),
13817        /// Optional. Rule to specify how a single column is converted.
13818        SingleColumnChange(std::boxed::Box<crate::model::SingleColumnChange>),
13819        /// Optional. Rule to specify how multiple columns should be converted to a
13820        /// different data type.
13821        MultiColumnDataTypeChange(std::boxed::Box<crate::model::MultiColumnDatatypeChange>),
13822        /// Optional. Rule to specify how the data contained in a column should be
13823        /// transformed (such as trimmed, rounded, etc) provided that the data meets
13824        /// certain criteria.
13825        ConditionalColumnSetValue(std::boxed::Box<crate::model::ConditionalColumnSetValue>),
13826        /// Optional. Rule to specify how multiple tables should be converted with an
13827        /// additional rowid column.
13828        ConvertRowidColumn(std::boxed::Box<crate::model::ConvertRowIdToColumn>),
13829        /// Optional. Rule to specify the primary key for a table
13830        SetTablePrimaryKey(std::boxed::Box<crate::model::SetTablePrimaryKey>),
13831        /// Optional. Rule to specify how a single package is converted.
13832        SinglePackageChange(std::boxed::Box<crate::model::SinglePackageChange>),
13833        /// Optional. Rule to change the sql code for an entity, for example,
13834        /// function, procedure.
13835        SourceSqlChange(std::boxed::Box<crate::model::SourceSqlChange>),
13836        /// Optional. Rule to specify the list of columns to include or exclude from
13837        /// a table.
13838        FilterTableColumns(std::boxed::Box<crate::model::FilterTableColumns>),
13839    }
13840}
13841
13842/// Options to configure rule type SingleEntityRename.
13843/// The rule is used to rename an entity.
13844///
13845/// The rule filter field can refer to only one entity.
13846///
13847/// The rule scope can be one of: Database, Schema, Table, Column, Constraint,
13848/// Index, View, Function, Stored Procedure, Materialized View, Sequence, UDT,
13849/// Synonym
13850#[derive(Clone, Default, PartialEq)]
13851#[non_exhaustive]
13852pub struct SingleEntityRename {
13853    /// Required. The new name of the destination entity
13854    pub new_name: std::string::String,
13855
13856    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13857}
13858
13859impl SingleEntityRename {
13860    pub fn new() -> Self {
13861        std::default::Default::default()
13862    }
13863
13864    /// Sets the value of [new_name][crate::model::SingleEntityRename::new_name].
13865    ///
13866    /// # Example
13867    /// ```ignore,no_run
13868    /// # use google_cloud_clouddms_v1::model::SingleEntityRename;
13869    /// let x = SingleEntityRename::new().set_new_name("example");
13870    /// ```
13871    pub fn set_new_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13872        self.new_name = v.into();
13873        self
13874    }
13875}
13876
13877impl wkt::message::Message for SingleEntityRename {
13878    fn typename() -> &'static str {
13879        "type.googleapis.com/google.cloud.clouddms.v1.SingleEntityRename"
13880    }
13881}
13882
13883/// Options to configure rule type MultiEntityRename.
13884/// The rule is used to rename multiple entities.
13885///
13886/// The rule filter field can refer to one or more entities.
13887///
13888/// The rule scope can be one of: Database, Schema, Table, Column, Constraint,
13889/// Index, View, Function, Stored Procedure, Materialized View, Sequence, UDT
13890#[derive(Clone, Default, PartialEq)]
13891#[non_exhaustive]
13892pub struct MultiEntityRename {
13893    /// Optional. The pattern used to generate the new entity's name. This pattern
13894    /// must include the characters '{name}', which will be replaced with the name
13895    /// of the original entity. For example, the pattern 't_{name}' for an entity
13896    /// name jobs would be converted to 't_jobs'.
13897    ///
13898    /// If unspecified, the default value for this field is '{name}'
13899    pub new_name_pattern: std::string::String,
13900
13901    /// Optional. Additional transformation that can be done on the source entity
13902    /// name before it is being used by the new_name_pattern, for example lower
13903    /// case. If no transformation is desired, use NO_TRANSFORMATION
13904    pub source_name_transformation: crate::model::EntityNameTransformation,
13905
13906    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13907}
13908
13909impl MultiEntityRename {
13910    pub fn new() -> Self {
13911        std::default::Default::default()
13912    }
13913
13914    /// Sets the value of [new_name_pattern][crate::model::MultiEntityRename::new_name_pattern].
13915    ///
13916    /// # Example
13917    /// ```ignore,no_run
13918    /// # use google_cloud_clouddms_v1::model::MultiEntityRename;
13919    /// let x = MultiEntityRename::new().set_new_name_pattern("example");
13920    /// ```
13921    pub fn set_new_name_pattern<T: std::convert::Into<std::string::String>>(
13922        mut self,
13923        v: T,
13924    ) -> Self {
13925        self.new_name_pattern = v.into();
13926        self
13927    }
13928
13929    /// Sets the value of [source_name_transformation][crate::model::MultiEntityRename::source_name_transformation].
13930    ///
13931    /// # Example
13932    /// ```ignore,no_run
13933    /// # use google_cloud_clouddms_v1::model::MultiEntityRename;
13934    /// use google_cloud_clouddms_v1::model::EntityNameTransformation;
13935    /// let x0 = MultiEntityRename::new().set_source_name_transformation(EntityNameTransformation::NoTransformation);
13936    /// let x1 = MultiEntityRename::new().set_source_name_transformation(EntityNameTransformation::LowerCase);
13937    /// let x2 = MultiEntityRename::new().set_source_name_transformation(EntityNameTransformation::UpperCase);
13938    /// ```
13939    pub fn set_source_name_transformation<
13940        T: std::convert::Into<crate::model::EntityNameTransformation>,
13941    >(
13942        mut self,
13943        v: T,
13944    ) -> Self {
13945        self.source_name_transformation = v.into();
13946        self
13947    }
13948}
13949
13950impl wkt::message::Message for MultiEntityRename {
13951    fn typename() -> &'static str {
13952        "type.googleapis.com/google.cloud.clouddms.v1.MultiEntityRename"
13953    }
13954}
13955
13956/// Options to configure rule type EntityMove.
13957/// The rule is used to move an entity to a new schema.
13958///
13959/// The rule filter field can refer to one or more entities.
13960///
13961/// The rule scope can be one of: Table, Column, Constraint, Index, View,
13962/// Function, Stored Procedure, Materialized View, Sequence, UDT
13963#[derive(Clone, Default, PartialEq)]
13964#[non_exhaustive]
13965pub struct EntityMove {
13966    /// Required. The new schema
13967    pub new_schema: std::string::String,
13968
13969    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13970}
13971
13972impl EntityMove {
13973    pub fn new() -> Self {
13974        std::default::Default::default()
13975    }
13976
13977    /// Sets the value of [new_schema][crate::model::EntityMove::new_schema].
13978    ///
13979    /// # Example
13980    /// ```ignore,no_run
13981    /// # use google_cloud_clouddms_v1::model::EntityMove;
13982    /// let x = EntityMove::new().set_new_schema("example");
13983    /// ```
13984    pub fn set_new_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13985        self.new_schema = v.into();
13986        self
13987    }
13988}
13989
13990impl wkt::message::Message for EntityMove {
13991    fn typename() -> &'static str {
13992        "type.googleapis.com/google.cloud.clouddms.v1.EntityMove"
13993    }
13994}
13995
13996/// Options to configure rule type SingleColumnChange.
13997/// The rule is used to change the properties of a column.
13998///
13999/// The rule filter field can refer to one entity.
14000///
14001/// The rule scope can be one of: Column.
14002///
14003/// When using this rule, if a field is not specified than the destination
14004/// column's configuration will be the same as the one in the source column..
14005#[derive(Clone, Default, PartialEq)]
14006#[non_exhaustive]
14007pub struct SingleColumnChange {
14008    /// Optional. Column data type name.
14009    pub data_type: std::string::String,
14010
14011    /// Optional. Charset override - instead of table level charset.
14012    pub charset: std::string::String,
14013
14014    /// Optional. Collation override - instead of table level collation.
14015    pub collation: std::string::String,
14016
14017    /// Optional. Column length - e.g. 50 as in varchar (50) - when relevant.
14018    pub length: i64,
14019
14020    /// Optional. Column precision - e.g. 8 as in double (8,2) - when relevant.
14021    pub precision: i32,
14022
14023    /// Optional. Column scale - e.g. 2 as in double (8,2) - when relevant.
14024    pub scale: i32,
14025
14026    /// Optional. Column fractional seconds precision - e.g. 2 as in timestamp (2)
14027    ///
14028    /// - when relevant.
14029    pub fractional_seconds_precision: i32,
14030
14031    /// Optional. Is the column of array type.
14032    pub array: bool,
14033
14034    /// Optional. The length of the array, only relevant if the column type is an
14035    /// array.
14036    pub array_length: i32,
14037
14038    /// Optional. Is the column nullable.
14039    pub nullable: bool,
14040
14041    /// Optional. Is the column auto-generated/identity.
14042    pub auto_generated: bool,
14043
14044    /// Optional. Is the column a UDT (User-defined Type).
14045    pub udt: bool,
14046
14047    /// Optional. Custom engine specific features.
14048    pub custom_features: std::option::Option<wkt::Struct>,
14049
14050    /// Optional. Specifies the list of values allowed in the column.
14051    pub set_values: std::vec::Vec<std::string::String>,
14052
14053    /// Optional. Comment associated with the column.
14054    pub comment: std::string::String,
14055
14056    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14057}
14058
14059impl SingleColumnChange {
14060    pub fn new() -> Self {
14061        std::default::Default::default()
14062    }
14063
14064    /// Sets the value of [data_type][crate::model::SingleColumnChange::data_type].
14065    ///
14066    /// # Example
14067    /// ```ignore,no_run
14068    /// # use google_cloud_clouddms_v1::model::SingleColumnChange;
14069    /// let x = SingleColumnChange::new().set_data_type("example");
14070    /// ```
14071    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14072        self.data_type = v.into();
14073        self
14074    }
14075
14076    /// Sets the value of [charset][crate::model::SingleColumnChange::charset].
14077    ///
14078    /// # Example
14079    /// ```ignore,no_run
14080    /// # use google_cloud_clouddms_v1::model::SingleColumnChange;
14081    /// let x = SingleColumnChange::new().set_charset("example");
14082    /// ```
14083    pub fn set_charset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14084        self.charset = v.into();
14085        self
14086    }
14087
14088    /// Sets the value of [collation][crate::model::SingleColumnChange::collation].
14089    ///
14090    /// # Example
14091    /// ```ignore,no_run
14092    /// # use google_cloud_clouddms_v1::model::SingleColumnChange;
14093    /// let x = SingleColumnChange::new().set_collation("example");
14094    /// ```
14095    pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14096        self.collation = v.into();
14097        self
14098    }
14099
14100    /// Sets the value of [length][crate::model::SingleColumnChange::length].
14101    ///
14102    /// # Example
14103    /// ```ignore,no_run
14104    /// # use google_cloud_clouddms_v1::model::SingleColumnChange;
14105    /// let x = SingleColumnChange::new().set_length(42);
14106    /// ```
14107    pub fn set_length<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14108        self.length = v.into();
14109        self
14110    }
14111
14112    /// Sets the value of [precision][crate::model::SingleColumnChange::precision].
14113    ///
14114    /// # Example
14115    /// ```ignore,no_run
14116    /// # use google_cloud_clouddms_v1::model::SingleColumnChange;
14117    /// let x = SingleColumnChange::new().set_precision(42);
14118    /// ```
14119    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14120        self.precision = v.into();
14121        self
14122    }
14123
14124    /// Sets the value of [scale][crate::model::SingleColumnChange::scale].
14125    ///
14126    /// # Example
14127    /// ```ignore,no_run
14128    /// # use google_cloud_clouddms_v1::model::SingleColumnChange;
14129    /// let x = SingleColumnChange::new().set_scale(42);
14130    /// ```
14131    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14132        self.scale = v.into();
14133        self
14134    }
14135
14136    /// Sets the value of [fractional_seconds_precision][crate::model::SingleColumnChange::fractional_seconds_precision].
14137    ///
14138    /// # Example
14139    /// ```ignore,no_run
14140    /// # use google_cloud_clouddms_v1::model::SingleColumnChange;
14141    /// let x = SingleColumnChange::new().set_fractional_seconds_precision(42);
14142    /// ```
14143    pub fn set_fractional_seconds_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14144        self.fractional_seconds_precision = v.into();
14145        self
14146    }
14147
14148    /// Sets the value of [array][crate::model::SingleColumnChange::array].
14149    ///
14150    /// # Example
14151    /// ```ignore,no_run
14152    /// # use google_cloud_clouddms_v1::model::SingleColumnChange;
14153    /// let x = SingleColumnChange::new().set_array(true);
14154    /// ```
14155    pub fn set_array<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14156        self.array = v.into();
14157        self
14158    }
14159
14160    /// Sets the value of [array_length][crate::model::SingleColumnChange::array_length].
14161    ///
14162    /// # Example
14163    /// ```ignore,no_run
14164    /// # use google_cloud_clouddms_v1::model::SingleColumnChange;
14165    /// let x = SingleColumnChange::new().set_array_length(42);
14166    /// ```
14167    pub fn set_array_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14168        self.array_length = v.into();
14169        self
14170    }
14171
14172    /// Sets the value of [nullable][crate::model::SingleColumnChange::nullable].
14173    ///
14174    /// # Example
14175    /// ```ignore,no_run
14176    /// # use google_cloud_clouddms_v1::model::SingleColumnChange;
14177    /// let x = SingleColumnChange::new().set_nullable(true);
14178    /// ```
14179    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14180        self.nullable = v.into();
14181        self
14182    }
14183
14184    /// Sets the value of [auto_generated][crate::model::SingleColumnChange::auto_generated].
14185    ///
14186    /// # Example
14187    /// ```ignore,no_run
14188    /// # use google_cloud_clouddms_v1::model::SingleColumnChange;
14189    /// let x = SingleColumnChange::new().set_auto_generated(true);
14190    /// ```
14191    pub fn set_auto_generated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14192        self.auto_generated = v.into();
14193        self
14194    }
14195
14196    /// Sets the value of [udt][crate::model::SingleColumnChange::udt].
14197    ///
14198    /// # Example
14199    /// ```ignore,no_run
14200    /// # use google_cloud_clouddms_v1::model::SingleColumnChange;
14201    /// let x = SingleColumnChange::new().set_udt(true);
14202    /// ```
14203    pub fn set_udt<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14204        self.udt = v.into();
14205        self
14206    }
14207
14208    /// Sets the value of [custom_features][crate::model::SingleColumnChange::custom_features].
14209    ///
14210    /// # Example
14211    /// ```ignore,no_run
14212    /// # use google_cloud_clouddms_v1::model::SingleColumnChange;
14213    /// use wkt::Struct;
14214    /// let x = SingleColumnChange::new().set_custom_features(Struct::default()/* use setters */);
14215    /// ```
14216    pub fn set_custom_features<T>(mut self, v: T) -> Self
14217    where
14218        T: std::convert::Into<wkt::Struct>,
14219    {
14220        self.custom_features = std::option::Option::Some(v.into());
14221        self
14222    }
14223
14224    /// Sets or clears the value of [custom_features][crate::model::SingleColumnChange::custom_features].
14225    ///
14226    /// # Example
14227    /// ```ignore,no_run
14228    /// # use google_cloud_clouddms_v1::model::SingleColumnChange;
14229    /// use wkt::Struct;
14230    /// let x = SingleColumnChange::new().set_or_clear_custom_features(Some(Struct::default()/* use setters */));
14231    /// let x = SingleColumnChange::new().set_or_clear_custom_features(None::<Struct>);
14232    /// ```
14233    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
14234    where
14235        T: std::convert::Into<wkt::Struct>,
14236    {
14237        self.custom_features = v.map(|x| x.into());
14238        self
14239    }
14240
14241    /// Sets the value of [set_values][crate::model::SingleColumnChange::set_values].
14242    ///
14243    /// # Example
14244    /// ```ignore,no_run
14245    /// # use google_cloud_clouddms_v1::model::SingleColumnChange;
14246    /// let x = SingleColumnChange::new().set_set_values(["a", "b", "c"]);
14247    /// ```
14248    pub fn set_set_values<T, V>(mut self, v: T) -> Self
14249    where
14250        T: std::iter::IntoIterator<Item = V>,
14251        V: std::convert::Into<std::string::String>,
14252    {
14253        use std::iter::Iterator;
14254        self.set_values = v.into_iter().map(|i| i.into()).collect();
14255        self
14256    }
14257
14258    /// Sets the value of [comment][crate::model::SingleColumnChange::comment].
14259    ///
14260    /// # Example
14261    /// ```ignore,no_run
14262    /// # use google_cloud_clouddms_v1::model::SingleColumnChange;
14263    /// let x = SingleColumnChange::new().set_comment("example");
14264    /// ```
14265    pub fn set_comment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14266        self.comment = v.into();
14267        self
14268    }
14269}
14270
14271impl wkt::message::Message for SingleColumnChange {
14272    fn typename() -> &'static str {
14273        "type.googleapis.com/google.cloud.clouddms.v1.SingleColumnChange"
14274    }
14275}
14276
14277/// Options to configure rule type MultiColumnDatatypeChange.
14278/// The rule is used to change the data type and associated properties of
14279/// multiple columns at once.
14280///
14281/// The rule filter field can refer to one or more entities.
14282///
14283/// The rule scope can be one of:Column.
14284///
14285/// This rule requires additional filters to be specified beyond the basic rule
14286/// filter field, which is the source data type, but the rule supports additional
14287/// filtering capabilities such as the minimum and maximum field length. All
14288/// additional filters which are specified are required to be met in order for
14289/// the rule to be applied (logical AND between the fields).
14290#[derive(Clone, Default, PartialEq)]
14291#[non_exhaustive]
14292pub struct MultiColumnDatatypeChange {
14293    /// Required. Filter on source data type.
14294    pub source_data_type_filter: std::string::String,
14295
14296    /// Required. New data type.
14297    pub new_data_type: std::string::String,
14298
14299    /// Optional. Column length - e.g. varchar (50) - if not specified and relevant
14300    /// uses the source column length.
14301    pub override_length: i64,
14302
14303    /// Optional. Column scale - when relevant - if not specified and relevant
14304    /// uses the source column scale.
14305    pub override_scale: i32,
14306
14307    /// Optional. Column precision - when relevant - if not specified and relevant
14308    /// uses the source column precision.
14309    pub override_precision: i32,
14310
14311    /// Optional. Column fractional seconds precision - used only for timestamp
14312    /// based datatypes - if not specified and relevant uses the source column
14313    /// fractional seconds precision.
14314    pub override_fractional_seconds_precision: i32,
14315
14316    /// Optional. Custom engine specific features.
14317    pub custom_features: std::option::Option<wkt::Struct>,
14318
14319    /// Filter on source column parameters.
14320    pub source_filter:
14321        std::option::Option<crate::model::multi_column_datatype_change::SourceFilter>,
14322
14323    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14324}
14325
14326impl MultiColumnDatatypeChange {
14327    pub fn new() -> Self {
14328        std::default::Default::default()
14329    }
14330
14331    /// Sets the value of [source_data_type_filter][crate::model::MultiColumnDatatypeChange::source_data_type_filter].
14332    ///
14333    /// # Example
14334    /// ```ignore,no_run
14335    /// # use google_cloud_clouddms_v1::model::MultiColumnDatatypeChange;
14336    /// let x = MultiColumnDatatypeChange::new().set_source_data_type_filter("example");
14337    /// ```
14338    pub fn set_source_data_type_filter<T: std::convert::Into<std::string::String>>(
14339        mut self,
14340        v: T,
14341    ) -> Self {
14342        self.source_data_type_filter = v.into();
14343        self
14344    }
14345
14346    /// Sets the value of [new_data_type][crate::model::MultiColumnDatatypeChange::new_data_type].
14347    ///
14348    /// # Example
14349    /// ```ignore,no_run
14350    /// # use google_cloud_clouddms_v1::model::MultiColumnDatatypeChange;
14351    /// let x = MultiColumnDatatypeChange::new().set_new_data_type("example");
14352    /// ```
14353    pub fn set_new_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14354        self.new_data_type = v.into();
14355        self
14356    }
14357
14358    /// Sets the value of [override_length][crate::model::MultiColumnDatatypeChange::override_length].
14359    ///
14360    /// # Example
14361    /// ```ignore,no_run
14362    /// # use google_cloud_clouddms_v1::model::MultiColumnDatatypeChange;
14363    /// let x = MultiColumnDatatypeChange::new().set_override_length(42);
14364    /// ```
14365    pub fn set_override_length<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14366        self.override_length = v.into();
14367        self
14368    }
14369
14370    /// Sets the value of [override_scale][crate::model::MultiColumnDatatypeChange::override_scale].
14371    ///
14372    /// # Example
14373    /// ```ignore,no_run
14374    /// # use google_cloud_clouddms_v1::model::MultiColumnDatatypeChange;
14375    /// let x = MultiColumnDatatypeChange::new().set_override_scale(42);
14376    /// ```
14377    pub fn set_override_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14378        self.override_scale = v.into();
14379        self
14380    }
14381
14382    /// Sets the value of [override_precision][crate::model::MultiColumnDatatypeChange::override_precision].
14383    ///
14384    /// # Example
14385    /// ```ignore,no_run
14386    /// # use google_cloud_clouddms_v1::model::MultiColumnDatatypeChange;
14387    /// let x = MultiColumnDatatypeChange::new().set_override_precision(42);
14388    /// ```
14389    pub fn set_override_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14390        self.override_precision = v.into();
14391        self
14392    }
14393
14394    /// Sets the value of [override_fractional_seconds_precision][crate::model::MultiColumnDatatypeChange::override_fractional_seconds_precision].
14395    ///
14396    /// # Example
14397    /// ```ignore,no_run
14398    /// # use google_cloud_clouddms_v1::model::MultiColumnDatatypeChange;
14399    /// let x = MultiColumnDatatypeChange::new().set_override_fractional_seconds_precision(42);
14400    /// ```
14401    pub fn set_override_fractional_seconds_precision<T: std::convert::Into<i32>>(
14402        mut self,
14403        v: T,
14404    ) -> Self {
14405        self.override_fractional_seconds_precision = v.into();
14406        self
14407    }
14408
14409    /// Sets the value of [custom_features][crate::model::MultiColumnDatatypeChange::custom_features].
14410    ///
14411    /// # Example
14412    /// ```ignore,no_run
14413    /// # use google_cloud_clouddms_v1::model::MultiColumnDatatypeChange;
14414    /// use wkt::Struct;
14415    /// let x = MultiColumnDatatypeChange::new().set_custom_features(Struct::default()/* use setters */);
14416    /// ```
14417    pub fn set_custom_features<T>(mut self, v: T) -> Self
14418    where
14419        T: std::convert::Into<wkt::Struct>,
14420    {
14421        self.custom_features = std::option::Option::Some(v.into());
14422        self
14423    }
14424
14425    /// Sets or clears the value of [custom_features][crate::model::MultiColumnDatatypeChange::custom_features].
14426    ///
14427    /// # Example
14428    /// ```ignore,no_run
14429    /// # use google_cloud_clouddms_v1::model::MultiColumnDatatypeChange;
14430    /// use wkt::Struct;
14431    /// let x = MultiColumnDatatypeChange::new().set_or_clear_custom_features(Some(Struct::default()/* use setters */));
14432    /// let x = MultiColumnDatatypeChange::new().set_or_clear_custom_features(None::<Struct>);
14433    /// ```
14434    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
14435    where
14436        T: std::convert::Into<wkt::Struct>,
14437    {
14438        self.custom_features = v.map(|x| x.into());
14439        self
14440    }
14441
14442    /// Sets the value of [source_filter][crate::model::MultiColumnDatatypeChange::source_filter].
14443    ///
14444    /// Note that all the setters affecting `source_filter` are mutually
14445    /// exclusive.
14446    ///
14447    /// # Example
14448    /// ```ignore,no_run
14449    /// # use google_cloud_clouddms_v1::model::MultiColumnDatatypeChange;
14450    /// use google_cloud_clouddms_v1::model::SourceTextFilter;
14451    /// let x = MultiColumnDatatypeChange::new().set_source_filter(Some(
14452    ///     google_cloud_clouddms_v1::model::multi_column_datatype_change::SourceFilter::SourceTextFilter(SourceTextFilter::default().into())));
14453    /// ```
14454    pub fn set_source_filter<
14455        T: std::convert::Into<
14456                std::option::Option<crate::model::multi_column_datatype_change::SourceFilter>,
14457            >,
14458    >(
14459        mut self,
14460        v: T,
14461    ) -> Self {
14462        self.source_filter = v.into();
14463        self
14464    }
14465
14466    /// The value of [source_filter][crate::model::MultiColumnDatatypeChange::source_filter]
14467    /// if it holds a `SourceTextFilter`, `None` if the field is not set or
14468    /// holds a different branch.
14469    pub fn source_text_filter(
14470        &self,
14471    ) -> std::option::Option<&std::boxed::Box<crate::model::SourceTextFilter>> {
14472        #[allow(unreachable_patterns)]
14473        self.source_filter.as_ref().and_then(|v| match v {
14474            crate::model::multi_column_datatype_change::SourceFilter::SourceTextFilter(v) => {
14475                std::option::Option::Some(v)
14476            }
14477            _ => std::option::Option::None,
14478        })
14479    }
14480
14481    /// Sets the value of [source_filter][crate::model::MultiColumnDatatypeChange::source_filter]
14482    /// to hold a `SourceTextFilter`.
14483    ///
14484    /// Note that all the setters affecting `source_filter` are
14485    /// mutually exclusive.
14486    ///
14487    /// # Example
14488    /// ```ignore,no_run
14489    /// # use google_cloud_clouddms_v1::model::MultiColumnDatatypeChange;
14490    /// use google_cloud_clouddms_v1::model::SourceTextFilter;
14491    /// let x = MultiColumnDatatypeChange::new().set_source_text_filter(SourceTextFilter::default()/* use setters */);
14492    /// assert!(x.source_text_filter().is_some());
14493    /// assert!(x.source_numeric_filter().is_none());
14494    /// ```
14495    pub fn set_source_text_filter<
14496        T: std::convert::Into<std::boxed::Box<crate::model::SourceTextFilter>>,
14497    >(
14498        mut self,
14499        v: T,
14500    ) -> Self {
14501        self.source_filter = std::option::Option::Some(
14502            crate::model::multi_column_datatype_change::SourceFilter::SourceTextFilter(v.into()),
14503        );
14504        self
14505    }
14506
14507    /// The value of [source_filter][crate::model::MultiColumnDatatypeChange::source_filter]
14508    /// if it holds a `SourceNumericFilter`, `None` if the field is not set or
14509    /// holds a different branch.
14510    pub fn source_numeric_filter(
14511        &self,
14512    ) -> std::option::Option<&std::boxed::Box<crate::model::SourceNumericFilter>> {
14513        #[allow(unreachable_patterns)]
14514        self.source_filter.as_ref().and_then(|v| match v {
14515            crate::model::multi_column_datatype_change::SourceFilter::SourceNumericFilter(v) => {
14516                std::option::Option::Some(v)
14517            }
14518            _ => std::option::Option::None,
14519        })
14520    }
14521
14522    /// Sets the value of [source_filter][crate::model::MultiColumnDatatypeChange::source_filter]
14523    /// to hold a `SourceNumericFilter`.
14524    ///
14525    /// Note that all the setters affecting `source_filter` are
14526    /// mutually exclusive.
14527    ///
14528    /// # Example
14529    /// ```ignore,no_run
14530    /// # use google_cloud_clouddms_v1::model::MultiColumnDatatypeChange;
14531    /// use google_cloud_clouddms_v1::model::SourceNumericFilter;
14532    /// let x = MultiColumnDatatypeChange::new().set_source_numeric_filter(SourceNumericFilter::default()/* use setters */);
14533    /// assert!(x.source_numeric_filter().is_some());
14534    /// assert!(x.source_text_filter().is_none());
14535    /// ```
14536    pub fn set_source_numeric_filter<
14537        T: std::convert::Into<std::boxed::Box<crate::model::SourceNumericFilter>>,
14538    >(
14539        mut self,
14540        v: T,
14541    ) -> Self {
14542        self.source_filter = std::option::Option::Some(
14543            crate::model::multi_column_datatype_change::SourceFilter::SourceNumericFilter(v.into()),
14544        );
14545        self
14546    }
14547}
14548
14549impl wkt::message::Message for MultiColumnDatatypeChange {
14550    fn typename() -> &'static str {
14551        "type.googleapis.com/google.cloud.clouddms.v1.MultiColumnDatatypeChange"
14552    }
14553}
14554
14555/// Defines additional types related to [MultiColumnDatatypeChange].
14556pub mod multi_column_datatype_change {
14557    #[allow(unused_imports)]
14558    use super::*;
14559
14560    /// Filter on source column parameters.
14561    #[derive(Clone, Debug, PartialEq)]
14562    #[non_exhaustive]
14563    pub enum SourceFilter {
14564        /// Optional. Filter for text-based data types like varchar.
14565        SourceTextFilter(std::boxed::Box<crate::model::SourceTextFilter>),
14566        /// Optional. Filter for fixed point number data types such as
14567        /// NUMERIC/NUMBER.
14568        SourceNumericFilter(std::boxed::Box<crate::model::SourceNumericFilter>),
14569    }
14570}
14571
14572/// Filter for text-based data types like varchar.
14573#[derive(Clone, Default, PartialEq)]
14574#[non_exhaustive]
14575pub struct SourceTextFilter {
14576    /// Optional. The filter will match columns with length greater than or equal
14577    /// to this number.
14578    pub source_min_length_filter: i64,
14579
14580    /// Optional. The filter will match columns with length smaller than or equal
14581    /// to this number.
14582    pub source_max_length_filter: i64,
14583
14584    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14585}
14586
14587impl SourceTextFilter {
14588    pub fn new() -> Self {
14589        std::default::Default::default()
14590    }
14591
14592    /// Sets the value of [source_min_length_filter][crate::model::SourceTextFilter::source_min_length_filter].
14593    ///
14594    /// # Example
14595    /// ```ignore,no_run
14596    /// # use google_cloud_clouddms_v1::model::SourceTextFilter;
14597    /// let x = SourceTextFilter::new().set_source_min_length_filter(42);
14598    /// ```
14599    pub fn set_source_min_length_filter<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14600        self.source_min_length_filter = v.into();
14601        self
14602    }
14603
14604    /// Sets the value of [source_max_length_filter][crate::model::SourceTextFilter::source_max_length_filter].
14605    ///
14606    /// # Example
14607    /// ```ignore,no_run
14608    /// # use google_cloud_clouddms_v1::model::SourceTextFilter;
14609    /// let x = SourceTextFilter::new().set_source_max_length_filter(42);
14610    /// ```
14611    pub fn set_source_max_length_filter<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14612        self.source_max_length_filter = v.into();
14613        self
14614    }
14615}
14616
14617impl wkt::message::Message for SourceTextFilter {
14618    fn typename() -> &'static str {
14619        "type.googleapis.com/google.cloud.clouddms.v1.SourceTextFilter"
14620    }
14621}
14622
14623/// Filter for fixed point number data types such as NUMERIC/NUMBER
14624#[derive(Clone, Default, PartialEq)]
14625#[non_exhaustive]
14626pub struct SourceNumericFilter {
14627    /// Optional. The filter will match columns with scale greater than or equal to
14628    /// this number.
14629    pub source_min_scale_filter: i32,
14630
14631    /// Optional. The filter will match columns with scale smaller than or equal to
14632    /// this number.
14633    pub source_max_scale_filter: i32,
14634
14635    /// Optional. The filter will match columns with precision greater than or
14636    /// equal to this number.
14637    pub source_min_precision_filter: i32,
14638
14639    /// Optional. The filter will match columns with precision smaller than or
14640    /// equal to this number.
14641    pub source_max_precision_filter: i32,
14642
14643    /// Required. Enum to set the option defining the datatypes numeric filter has
14644    /// to be applied to
14645    pub numeric_filter_option: crate::model::NumericFilterOption,
14646
14647    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14648}
14649
14650impl SourceNumericFilter {
14651    pub fn new() -> Self {
14652        std::default::Default::default()
14653    }
14654
14655    /// Sets the value of [source_min_scale_filter][crate::model::SourceNumericFilter::source_min_scale_filter].
14656    ///
14657    /// # Example
14658    /// ```ignore,no_run
14659    /// # use google_cloud_clouddms_v1::model::SourceNumericFilter;
14660    /// let x = SourceNumericFilter::new().set_source_min_scale_filter(42);
14661    /// ```
14662    pub fn set_source_min_scale_filter<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14663        self.source_min_scale_filter = v.into();
14664        self
14665    }
14666
14667    /// Sets the value of [source_max_scale_filter][crate::model::SourceNumericFilter::source_max_scale_filter].
14668    ///
14669    /// # Example
14670    /// ```ignore,no_run
14671    /// # use google_cloud_clouddms_v1::model::SourceNumericFilter;
14672    /// let x = SourceNumericFilter::new().set_source_max_scale_filter(42);
14673    /// ```
14674    pub fn set_source_max_scale_filter<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14675        self.source_max_scale_filter = v.into();
14676        self
14677    }
14678
14679    /// Sets the value of [source_min_precision_filter][crate::model::SourceNumericFilter::source_min_precision_filter].
14680    ///
14681    /// # Example
14682    /// ```ignore,no_run
14683    /// # use google_cloud_clouddms_v1::model::SourceNumericFilter;
14684    /// let x = SourceNumericFilter::new().set_source_min_precision_filter(42);
14685    /// ```
14686    pub fn set_source_min_precision_filter<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14687        self.source_min_precision_filter = v.into();
14688        self
14689    }
14690
14691    /// Sets the value of [source_max_precision_filter][crate::model::SourceNumericFilter::source_max_precision_filter].
14692    ///
14693    /// # Example
14694    /// ```ignore,no_run
14695    /// # use google_cloud_clouddms_v1::model::SourceNumericFilter;
14696    /// let x = SourceNumericFilter::new().set_source_max_precision_filter(42);
14697    /// ```
14698    pub fn set_source_max_precision_filter<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14699        self.source_max_precision_filter = v.into();
14700        self
14701    }
14702
14703    /// Sets the value of [numeric_filter_option][crate::model::SourceNumericFilter::numeric_filter_option].
14704    ///
14705    /// # Example
14706    /// ```ignore,no_run
14707    /// # use google_cloud_clouddms_v1::model::SourceNumericFilter;
14708    /// use google_cloud_clouddms_v1::model::NumericFilterOption;
14709    /// let x0 = SourceNumericFilter::new().set_numeric_filter_option(NumericFilterOption::All);
14710    /// let x1 = SourceNumericFilter::new().set_numeric_filter_option(NumericFilterOption::Limit);
14711    /// let x2 = SourceNumericFilter::new().set_numeric_filter_option(NumericFilterOption::Limitless);
14712    /// ```
14713    pub fn set_numeric_filter_option<T: std::convert::Into<crate::model::NumericFilterOption>>(
14714        mut self,
14715        v: T,
14716    ) -> Self {
14717        self.numeric_filter_option = v.into();
14718        self
14719    }
14720}
14721
14722impl wkt::message::Message for SourceNumericFilter {
14723    fn typename() -> &'static str {
14724        "type.googleapis.com/google.cloud.clouddms.v1.SourceNumericFilter"
14725    }
14726}
14727
14728/// Options to configure rule type ConditionalColumnSetValue.
14729/// The rule is used to transform the data which is being replicated/migrated.
14730///
14731/// The rule filter field can refer to one or more entities.
14732///
14733/// The rule scope can be one of: Column.
14734#[derive(Clone, Default, PartialEq)]
14735#[non_exhaustive]
14736pub struct ConditionalColumnSetValue {
14737    /// Required. Description of data transformation during migration.
14738    pub value_transformation: std::option::Option<crate::model::ValueTransformation>,
14739
14740    /// Optional. Custom engine specific features.
14741    pub custom_features: std::option::Option<wkt::Struct>,
14742
14743    pub source_filter:
14744        std::option::Option<crate::model::conditional_column_set_value::SourceFilter>,
14745
14746    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14747}
14748
14749impl ConditionalColumnSetValue {
14750    pub fn new() -> Self {
14751        std::default::Default::default()
14752    }
14753
14754    /// Sets the value of [value_transformation][crate::model::ConditionalColumnSetValue::value_transformation].
14755    ///
14756    /// # Example
14757    /// ```ignore,no_run
14758    /// # use google_cloud_clouddms_v1::model::ConditionalColumnSetValue;
14759    /// use google_cloud_clouddms_v1::model::ValueTransformation;
14760    /// let x = ConditionalColumnSetValue::new().set_value_transformation(ValueTransformation::default()/* use setters */);
14761    /// ```
14762    pub fn set_value_transformation<T>(mut self, v: T) -> Self
14763    where
14764        T: std::convert::Into<crate::model::ValueTransformation>,
14765    {
14766        self.value_transformation = std::option::Option::Some(v.into());
14767        self
14768    }
14769
14770    /// Sets or clears the value of [value_transformation][crate::model::ConditionalColumnSetValue::value_transformation].
14771    ///
14772    /// # Example
14773    /// ```ignore,no_run
14774    /// # use google_cloud_clouddms_v1::model::ConditionalColumnSetValue;
14775    /// use google_cloud_clouddms_v1::model::ValueTransformation;
14776    /// let x = ConditionalColumnSetValue::new().set_or_clear_value_transformation(Some(ValueTransformation::default()/* use setters */));
14777    /// let x = ConditionalColumnSetValue::new().set_or_clear_value_transformation(None::<ValueTransformation>);
14778    /// ```
14779    pub fn set_or_clear_value_transformation<T>(mut self, v: std::option::Option<T>) -> Self
14780    where
14781        T: std::convert::Into<crate::model::ValueTransformation>,
14782    {
14783        self.value_transformation = v.map(|x| x.into());
14784        self
14785    }
14786
14787    /// Sets the value of [custom_features][crate::model::ConditionalColumnSetValue::custom_features].
14788    ///
14789    /// # Example
14790    /// ```ignore,no_run
14791    /// # use google_cloud_clouddms_v1::model::ConditionalColumnSetValue;
14792    /// use wkt::Struct;
14793    /// let x = ConditionalColumnSetValue::new().set_custom_features(Struct::default()/* use setters */);
14794    /// ```
14795    pub fn set_custom_features<T>(mut self, v: T) -> Self
14796    where
14797        T: std::convert::Into<wkt::Struct>,
14798    {
14799        self.custom_features = std::option::Option::Some(v.into());
14800        self
14801    }
14802
14803    /// Sets or clears the value of [custom_features][crate::model::ConditionalColumnSetValue::custom_features].
14804    ///
14805    /// # Example
14806    /// ```ignore,no_run
14807    /// # use google_cloud_clouddms_v1::model::ConditionalColumnSetValue;
14808    /// use wkt::Struct;
14809    /// let x = ConditionalColumnSetValue::new().set_or_clear_custom_features(Some(Struct::default()/* use setters */));
14810    /// let x = ConditionalColumnSetValue::new().set_or_clear_custom_features(None::<Struct>);
14811    /// ```
14812    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
14813    where
14814        T: std::convert::Into<wkt::Struct>,
14815    {
14816        self.custom_features = v.map(|x| x.into());
14817        self
14818    }
14819
14820    /// Sets the value of [source_filter][crate::model::ConditionalColumnSetValue::source_filter].
14821    ///
14822    /// Note that all the setters affecting `source_filter` are mutually
14823    /// exclusive.
14824    ///
14825    /// # Example
14826    /// ```ignore,no_run
14827    /// # use google_cloud_clouddms_v1::model::ConditionalColumnSetValue;
14828    /// use google_cloud_clouddms_v1::model::SourceTextFilter;
14829    /// let x = ConditionalColumnSetValue::new().set_source_filter(Some(
14830    ///     google_cloud_clouddms_v1::model::conditional_column_set_value::SourceFilter::SourceTextFilter(SourceTextFilter::default().into())));
14831    /// ```
14832    pub fn set_source_filter<
14833        T: std::convert::Into<
14834                std::option::Option<crate::model::conditional_column_set_value::SourceFilter>,
14835            >,
14836    >(
14837        mut self,
14838        v: T,
14839    ) -> Self {
14840        self.source_filter = v.into();
14841        self
14842    }
14843
14844    /// The value of [source_filter][crate::model::ConditionalColumnSetValue::source_filter]
14845    /// if it holds a `SourceTextFilter`, `None` if the field is not set or
14846    /// holds a different branch.
14847    pub fn source_text_filter(
14848        &self,
14849    ) -> std::option::Option<&std::boxed::Box<crate::model::SourceTextFilter>> {
14850        #[allow(unreachable_patterns)]
14851        self.source_filter.as_ref().and_then(|v| match v {
14852            crate::model::conditional_column_set_value::SourceFilter::SourceTextFilter(v) => {
14853                std::option::Option::Some(v)
14854            }
14855            _ => std::option::Option::None,
14856        })
14857    }
14858
14859    /// Sets the value of [source_filter][crate::model::ConditionalColumnSetValue::source_filter]
14860    /// to hold a `SourceTextFilter`.
14861    ///
14862    /// Note that all the setters affecting `source_filter` are
14863    /// mutually exclusive.
14864    ///
14865    /// # Example
14866    /// ```ignore,no_run
14867    /// # use google_cloud_clouddms_v1::model::ConditionalColumnSetValue;
14868    /// use google_cloud_clouddms_v1::model::SourceTextFilter;
14869    /// let x = ConditionalColumnSetValue::new().set_source_text_filter(SourceTextFilter::default()/* use setters */);
14870    /// assert!(x.source_text_filter().is_some());
14871    /// assert!(x.source_numeric_filter().is_none());
14872    /// ```
14873    pub fn set_source_text_filter<
14874        T: std::convert::Into<std::boxed::Box<crate::model::SourceTextFilter>>,
14875    >(
14876        mut self,
14877        v: T,
14878    ) -> Self {
14879        self.source_filter = std::option::Option::Some(
14880            crate::model::conditional_column_set_value::SourceFilter::SourceTextFilter(v.into()),
14881        );
14882        self
14883    }
14884
14885    /// The value of [source_filter][crate::model::ConditionalColumnSetValue::source_filter]
14886    /// if it holds a `SourceNumericFilter`, `None` if the field is not set or
14887    /// holds a different branch.
14888    pub fn source_numeric_filter(
14889        &self,
14890    ) -> std::option::Option<&std::boxed::Box<crate::model::SourceNumericFilter>> {
14891        #[allow(unreachable_patterns)]
14892        self.source_filter.as_ref().and_then(|v| match v {
14893            crate::model::conditional_column_set_value::SourceFilter::SourceNumericFilter(v) => {
14894                std::option::Option::Some(v)
14895            }
14896            _ => std::option::Option::None,
14897        })
14898    }
14899
14900    /// Sets the value of [source_filter][crate::model::ConditionalColumnSetValue::source_filter]
14901    /// to hold a `SourceNumericFilter`.
14902    ///
14903    /// Note that all the setters affecting `source_filter` are
14904    /// mutually exclusive.
14905    ///
14906    /// # Example
14907    /// ```ignore,no_run
14908    /// # use google_cloud_clouddms_v1::model::ConditionalColumnSetValue;
14909    /// use google_cloud_clouddms_v1::model::SourceNumericFilter;
14910    /// let x = ConditionalColumnSetValue::new().set_source_numeric_filter(SourceNumericFilter::default()/* use setters */);
14911    /// assert!(x.source_numeric_filter().is_some());
14912    /// assert!(x.source_text_filter().is_none());
14913    /// ```
14914    pub fn set_source_numeric_filter<
14915        T: std::convert::Into<std::boxed::Box<crate::model::SourceNumericFilter>>,
14916    >(
14917        mut self,
14918        v: T,
14919    ) -> Self {
14920        self.source_filter = std::option::Option::Some(
14921            crate::model::conditional_column_set_value::SourceFilter::SourceNumericFilter(v.into()),
14922        );
14923        self
14924    }
14925}
14926
14927impl wkt::message::Message for ConditionalColumnSetValue {
14928    fn typename() -> &'static str {
14929        "type.googleapis.com/google.cloud.clouddms.v1.ConditionalColumnSetValue"
14930    }
14931}
14932
14933/// Defines additional types related to [ConditionalColumnSetValue].
14934pub mod conditional_column_set_value {
14935    #[allow(unused_imports)]
14936    use super::*;
14937
14938    #[derive(Clone, Debug, PartialEq)]
14939    #[non_exhaustive]
14940    pub enum SourceFilter {
14941        /// Optional. Optional filter on source column length. Used for text based
14942        /// data types like varchar.
14943        SourceTextFilter(std::boxed::Box<crate::model::SourceTextFilter>),
14944        /// Optional. Optional filter on source column precision and scale. Used for
14945        /// fixed point numbers such as NUMERIC/NUMBER data types.
14946        SourceNumericFilter(std::boxed::Box<crate::model::SourceNumericFilter>),
14947    }
14948}
14949
14950/// Description of data transformation during migration as part of the
14951/// ConditionalColumnSetValue.
14952#[derive(Clone, Default, PartialEq)]
14953#[non_exhaustive]
14954pub struct ValueTransformation {
14955    pub filter: std::option::Option<crate::model::value_transformation::Filter>,
14956
14957    pub action: std::option::Option<crate::model::value_transformation::Action>,
14958
14959    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14960}
14961
14962impl ValueTransformation {
14963    pub fn new() -> Self {
14964        std::default::Default::default()
14965    }
14966
14967    /// Sets the value of [filter][crate::model::ValueTransformation::filter].
14968    ///
14969    /// Note that all the setters affecting `filter` are mutually
14970    /// exclusive.
14971    ///
14972    /// # Example
14973    /// ```ignore,no_run
14974    /// # use google_cloud_clouddms_v1::model::ValueTransformation;
14975    /// use wkt::Empty;
14976    /// let x = ValueTransformation::new().set_filter(Some(
14977    ///     google_cloud_clouddms_v1::model::value_transformation::Filter::IsNull(Empty::default().into())));
14978    /// ```
14979    pub fn set_filter<
14980        T: std::convert::Into<std::option::Option<crate::model::value_transformation::Filter>>,
14981    >(
14982        mut self,
14983        v: T,
14984    ) -> Self {
14985        self.filter = v.into();
14986        self
14987    }
14988
14989    /// The value of [filter][crate::model::ValueTransformation::filter]
14990    /// if it holds a `IsNull`, `None` if the field is not set or
14991    /// holds a different branch.
14992    pub fn is_null(&self) -> std::option::Option<&std::boxed::Box<wkt::Empty>> {
14993        #[allow(unreachable_patterns)]
14994        self.filter.as_ref().and_then(|v| match v {
14995            crate::model::value_transformation::Filter::IsNull(v) => std::option::Option::Some(v),
14996            _ => std::option::Option::None,
14997        })
14998    }
14999
15000    /// Sets the value of [filter][crate::model::ValueTransformation::filter]
15001    /// to hold a `IsNull`.
15002    ///
15003    /// Note that all the setters affecting `filter` are
15004    /// mutually exclusive.
15005    ///
15006    /// # Example
15007    /// ```ignore,no_run
15008    /// # use google_cloud_clouddms_v1::model::ValueTransformation;
15009    /// use wkt::Empty;
15010    /// let x = ValueTransformation::new().set_is_null(Empty::default()/* use setters */);
15011    /// assert!(x.is_null().is_some());
15012    /// assert!(x.value_list().is_none());
15013    /// assert!(x.int_comparison().is_none());
15014    /// assert!(x.double_comparison().is_none());
15015    /// ```
15016    pub fn set_is_null<T: std::convert::Into<std::boxed::Box<wkt::Empty>>>(mut self, v: T) -> Self {
15017        self.filter =
15018            std::option::Option::Some(crate::model::value_transformation::Filter::IsNull(v.into()));
15019        self
15020    }
15021
15022    /// The value of [filter][crate::model::ValueTransformation::filter]
15023    /// if it holds a `ValueList`, `None` if the field is not set or
15024    /// holds a different branch.
15025    pub fn value_list(
15026        &self,
15027    ) -> std::option::Option<&std::boxed::Box<crate::model::ValueListFilter>> {
15028        #[allow(unreachable_patterns)]
15029        self.filter.as_ref().and_then(|v| match v {
15030            crate::model::value_transformation::Filter::ValueList(v) => {
15031                std::option::Option::Some(v)
15032            }
15033            _ => std::option::Option::None,
15034        })
15035    }
15036
15037    /// Sets the value of [filter][crate::model::ValueTransformation::filter]
15038    /// to hold a `ValueList`.
15039    ///
15040    /// Note that all the setters affecting `filter` are
15041    /// mutually exclusive.
15042    ///
15043    /// # Example
15044    /// ```ignore,no_run
15045    /// # use google_cloud_clouddms_v1::model::ValueTransformation;
15046    /// use google_cloud_clouddms_v1::model::ValueListFilter;
15047    /// let x = ValueTransformation::new().set_value_list(ValueListFilter::default()/* use setters */);
15048    /// assert!(x.value_list().is_some());
15049    /// assert!(x.is_null().is_none());
15050    /// assert!(x.int_comparison().is_none());
15051    /// assert!(x.double_comparison().is_none());
15052    /// ```
15053    pub fn set_value_list<T: std::convert::Into<std::boxed::Box<crate::model::ValueListFilter>>>(
15054        mut self,
15055        v: T,
15056    ) -> Self {
15057        self.filter = std::option::Option::Some(
15058            crate::model::value_transformation::Filter::ValueList(v.into()),
15059        );
15060        self
15061    }
15062
15063    /// The value of [filter][crate::model::ValueTransformation::filter]
15064    /// if it holds a `IntComparison`, `None` if the field is not set or
15065    /// holds a different branch.
15066    pub fn int_comparison(
15067        &self,
15068    ) -> std::option::Option<&std::boxed::Box<crate::model::IntComparisonFilter>> {
15069        #[allow(unreachable_patterns)]
15070        self.filter.as_ref().and_then(|v| match v {
15071            crate::model::value_transformation::Filter::IntComparison(v) => {
15072                std::option::Option::Some(v)
15073            }
15074            _ => std::option::Option::None,
15075        })
15076    }
15077
15078    /// Sets the value of [filter][crate::model::ValueTransformation::filter]
15079    /// to hold a `IntComparison`.
15080    ///
15081    /// Note that all the setters affecting `filter` are
15082    /// mutually exclusive.
15083    ///
15084    /// # Example
15085    /// ```ignore,no_run
15086    /// # use google_cloud_clouddms_v1::model::ValueTransformation;
15087    /// use google_cloud_clouddms_v1::model::IntComparisonFilter;
15088    /// let x = ValueTransformation::new().set_int_comparison(IntComparisonFilter::default()/* use setters */);
15089    /// assert!(x.int_comparison().is_some());
15090    /// assert!(x.is_null().is_none());
15091    /// assert!(x.value_list().is_none());
15092    /// assert!(x.double_comparison().is_none());
15093    /// ```
15094    pub fn set_int_comparison<
15095        T: std::convert::Into<std::boxed::Box<crate::model::IntComparisonFilter>>,
15096    >(
15097        mut self,
15098        v: T,
15099    ) -> Self {
15100        self.filter = std::option::Option::Some(
15101            crate::model::value_transformation::Filter::IntComparison(v.into()),
15102        );
15103        self
15104    }
15105
15106    /// The value of [filter][crate::model::ValueTransformation::filter]
15107    /// if it holds a `DoubleComparison`, `None` if the field is not set or
15108    /// holds a different branch.
15109    pub fn double_comparison(
15110        &self,
15111    ) -> std::option::Option<&std::boxed::Box<crate::model::DoubleComparisonFilter>> {
15112        #[allow(unreachable_patterns)]
15113        self.filter.as_ref().and_then(|v| match v {
15114            crate::model::value_transformation::Filter::DoubleComparison(v) => {
15115                std::option::Option::Some(v)
15116            }
15117            _ => std::option::Option::None,
15118        })
15119    }
15120
15121    /// Sets the value of [filter][crate::model::ValueTransformation::filter]
15122    /// to hold a `DoubleComparison`.
15123    ///
15124    /// Note that all the setters affecting `filter` are
15125    /// mutually exclusive.
15126    ///
15127    /// # Example
15128    /// ```ignore,no_run
15129    /// # use google_cloud_clouddms_v1::model::ValueTransformation;
15130    /// use google_cloud_clouddms_v1::model::DoubleComparisonFilter;
15131    /// let x = ValueTransformation::new().set_double_comparison(DoubleComparisonFilter::default()/* use setters */);
15132    /// assert!(x.double_comparison().is_some());
15133    /// assert!(x.is_null().is_none());
15134    /// assert!(x.value_list().is_none());
15135    /// assert!(x.int_comparison().is_none());
15136    /// ```
15137    pub fn set_double_comparison<
15138        T: std::convert::Into<std::boxed::Box<crate::model::DoubleComparisonFilter>>,
15139    >(
15140        mut self,
15141        v: T,
15142    ) -> Self {
15143        self.filter = std::option::Option::Some(
15144            crate::model::value_transformation::Filter::DoubleComparison(v.into()),
15145        );
15146        self
15147    }
15148
15149    /// Sets the value of [action][crate::model::ValueTransformation::action].
15150    ///
15151    /// Note that all the setters affecting `action` are mutually
15152    /// exclusive.
15153    ///
15154    /// # Example
15155    /// ```ignore,no_run
15156    /// # use google_cloud_clouddms_v1::model::ValueTransformation;
15157    /// use wkt::Empty;
15158    /// let x = ValueTransformation::new().set_action(Some(
15159    ///     google_cloud_clouddms_v1::model::value_transformation::Action::AssignNull(Empty::default().into())));
15160    /// ```
15161    pub fn set_action<
15162        T: std::convert::Into<std::option::Option<crate::model::value_transformation::Action>>,
15163    >(
15164        mut self,
15165        v: T,
15166    ) -> Self {
15167        self.action = v.into();
15168        self
15169    }
15170
15171    /// The value of [action][crate::model::ValueTransformation::action]
15172    /// if it holds a `AssignNull`, `None` if the field is not set or
15173    /// holds a different branch.
15174    pub fn assign_null(&self) -> std::option::Option<&std::boxed::Box<wkt::Empty>> {
15175        #[allow(unreachable_patterns)]
15176        self.action.as_ref().and_then(|v| match v {
15177            crate::model::value_transformation::Action::AssignNull(v) => {
15178                std::option::Option::Some(v)
15179            }
15180            _ => std::option::Option::None,
15181        })
15182    }
15183
15184    /// Sets the value of [action][crate::model::ValueTransformation::action]
15185    /// to hold a `AssignNull`.
15186    ///
15187    /// Note that all the setters affecting `action` are
15188    /// mutually exclusive.
15189    ///
15190    /// # Example
15191    /// ```ignore,no_run
15192    /// # use google_cloud_clouddms_v1::model::ValueTransformation;
15193    /// use wkt::Empty;
15194    /// let x = ValueTransformation::new().set_assign_null(Empty::default()/* use setters */);
15195    /// assert!(x.assign_null().is_some());
15196    /// assert!(x.assign_specific_value().is_none());
15197    /// assert!(x.assign_min_value().is_none());
15198    /// assert!(x.assign_max_value().is_none());
15199    /// assert!(x.round_scale().is_none());
15200    /// assert!(x.apply_hash().is_none());
15201    /// ```
15202    pub fn set_assign_null<T: std::convert::Into<std::boxed::Box<wkt::Empty>>>(
15203        mut self,
15204        v: T,
15205    ) -> Self {
15206        self.action = std::option::Option::Some(
15207            crate::model::value_transformation::Action::AssignNull(v.into()),
15208        );
15209        self
15210    }
15211
15212    /// The value of [action][crate::model::ValueTransformation::action]
15213    /// if it holds a `AssignSpecificValue`, `None` if the field is not set or
15214    /// holds a different branch.
15215    pub fn assign_specific_value(
15216        &self,
15217    ) -> std::option::Option<&std::boxed::Box<crate::model::AssignSpecificValue>> {
15218        #[allow(unreachable_patterns)]
15219        self.action.as_ref().and_then(|v| match v {
15220            crate::model::value_transformation::Action::AssignSpecificValue(v) => {
15221                std::option::Option::Some(v)
15222            }
15223            _ => std::option::Option::None,
15224        })
15225    }
15226
15227    /// Sets the value of [action][crate::model::ValueTransformation::action]
15228    /// to hold a `AssignSpecificValue`.
15229    ///
15230    /// Note that all the setters affecting `action` are
15231    /// mutually exclusive.
15232    ///
15233    /// # Example
15234    /// ```ignore,no_run
15235    /// # use google_cloud_clouddms_v1::model::ValueTransformation;
15236    /// use google_cloud_clouddms_v1::model::AssignSpecificValue;
15237    /// let x = ValueTransformation::new().set_assign_specific_value(AssignSpecificValue::default()/* use setters */);
15238    /// assert!(x.assign_specific_value().is_some());
15239    /// assert!(x.assign_null().is_none());
15240    /// assert!(x.assign_min_value().is_none());
15241    /// assert!(x.assign_max_value().is_none());
15242    /// assert!(x.round_scale().is_none());
15243    /// assert!(x.apply_hash().is_none());
15244    /// ```
15245    pub fn set_assign_specific_value<
15246        T: std::convert::Into<std::boxed::Box<crate::model::AssignSpecificValue>>,
15247    >(
15248        mut self,
15249        v: T,
15250    ) -> Self {
15251        self.action = std::option::Option::Some(
15252            crate::model::value_transformation::Action::AssignSpecificValue(v.into()),
15253        );
15254        self
15255    }
15256
15257    /// The value of [action][crate::model::ValueTransformation::action]
15258    /// if it holds a `AssignMinValue`, `None` if the field is not set or
15259    /// holds a different branch.
15260    pub fn assign_min_value(&self) -> std::option::Option<&std::boxed::Box<wkt::Empty>> {
15261        #[allow(unreachable_patterns)]
15262        self.action.as_ref().and_then(|v| match v {
15263            crate::model::value_transformation::Action::AssignMinValue(v) => {
15264                std::option::Option::Some(v)
15265            }
15266            _ => std::option::Option::None,
15267        })
15268    }
15269
15270    /// Sets the value of [action][crate::model::ValueTransformation::action]
15271    /// to hold a `AssignMinValue`.
15272    ///
15273    /// Note that all the setters affecting `action` are
15274    /// mutually exclusive.
15275    ///
15276    /// # Example
15277    /// ```ignore,no_run
15278    /// # use google_cloud_clouddms_v1::model::ValueTransformation;
15279    /// use wkt::Empty;
15280    /// let x = ValueTransformation::new().set_assign_min_value(Empty::default()/* use setters */);
15281    /// assert!(x.assign_min_value().is_some());
15282    /// assert!(x.assign_null().is_none());
15283    /// assert!(x.assign_specific_value().is_none());
15284    /// assert!(x.assign_max_value().is_none());
15285    /// assert!(x.round_scale().is_none());
15286    /// assert!(x.apply_hash().is_none());
15287    /// ```
15288    pub fn set_assign_min_value<T: std::convert::Into<std::boxed::Box<wkt::Empty>>>(
15289        mut self,
15290        v: T,
15291    ) -> Self {
15292        self.action = std::option::Option::Some(
15293            crate::model::value_transformation::Action::AssignMinValue(v.into()),
15294        );
15295        self
15296    }
15297
15298    /// The value of [action][crate::model::ValueTransformation::action]
15299    /// if it holds a `AssignMaxValue`, `None` if the field is not set or
15300    /// holds a different branch.
15301    pub fn assign_max_value(&self) -> std::option::Option<&std::boxed::Box<wkt::Empty>> {
15302        #[allow(unreachable_patterns)]
15303        self.action.as_ref().and_then(|v| match v {
15304            crate::model::value_transformation::Action::AssignMaxValue(v) => {
15305                std::option::Option::Some(v)
15306            }
15307            _ => std::option::Option::None,
15308        })
15309    }
15310
15311    /// Sets the value of [action][crate::model::ValueTransformation::action]
15312    /// to hold a `AssignMaxValue`.
15313    ///
15314    /// Note that all the setters affecting `action` are
15315    /// mutually exclusive.
15316    ///
15317    /// # Example
15318    /// ```ignore,no_run
15319    /// # use google_cloud_clouddms_v1::model::ValueTransformation;
15320    /// use wkt::Empty;
15321    /// let x = ValueTransformation::new().set_assign_max_value(Empty::default()/* use setters */);
15322    /// assert!(x.assign_max_value().is_some());
15323    /// assert!(x.assign_null().is_none());
15324    /// assert!(x.assign_specific_value().is_none());
15325    /// assert!(x.assign_min_value().is_none());
15326    /// assert!(x.round_scale().is_none());
15327    /// assert!(x.apply_hash().is_none());
15328    /// ```
15329    pub fn set_assign_max_value<T: std::convert::Into<std::boxed::Box<wkt::Empty>>>(
15330        mut self,
15331        v: T,
15332    ) -> Self {
15333        self.action = std::option::Option::Some(
15334            crate::model::value_transformation::Action::AssignMaxValue(v.into()),
15335        );
15336        self
15337    }
15338
15339    /// The value of [action][crate::model::ValueTransformation::action]
15340    /// if it holds a `RoundScale`, `None` if the field is not set or
15341    /// holds a different branch.
15342    pub fn round_scale(&self) -> std::option::Option<&std::boxed::Box<crate::model::RoundToScale>> {
15343        #[allow(unreachable_patterns)]
15344        self.action.as_ref().and_then(|v| match v {
15345            crate::model::value_transformation::Action::RoundScale(v) => {
15346                std::option::Option::Some(v)
15347            }
15348            _ => std::option::Option::None,
15349        })
15350    }
15351
15352    /// Sets the value of [action][crate::model::ValueTransformation::action]
15353    /// to hold a `RoundScale`.
15354    ///
15355    /// Note that all the setters affecting `action` are
15356    /// mutually exclusive.
15357    ///
15358    /// # Example
15359    /// ```ignore,no_run
15360    /// # use google_cloud_clouddms_v1::model::ValueTransformation;
15361    /// use google_cloud_clouddms_v1::model::RoundToScale;
15362    /// let x = ValueTransformation::new().set_round_scale(RoundToScale::default()/* use setters */);
15363    /// assert!(x.round_scale().is_some());
15364    /// assert!(x.assign_null().is_none());
15365    /// assert!(x.assign_specific_value().is_none());
15366    /// assert!(x.assign_min_value().is_none());
15367    /// assert!(x.assign_max_value().is_none());
15368    /// assert!(x.apply_hash().is_none());
15369    /// ```
15370    pub fn set_round_scale<T: std::convert::Into<std::boxed::Box<crate::model::RoundToScale>>>(
15371        mut self,
15372        v: T,
15373    ) -> Self {
15374        self.action = std::option::Option::Some(
15375            crate::model::value_transformation::Action::RoundScale(v.into()),
15376        );
15377        self
15378    }
15379
15380    /// The value of [action][crate::model::ValueTransformation::action]
15381    /// if it holds a `ApplyHash`, `None` if the field is not set or
15382    /// holds a different branch.
15383    pub fn apply_hash(&self) -> std::option::Option<&std::boxed::Box<crate::model::ApplyHash>> {
15384        #[allow(unreachable_patterns)]
15385        self.action.as_ref().and_then(|v| match v {
15386            crate::model::value_transformation::Action::ApplyHash(v) => {
15387                std::option::Option::Some(v)
15388            }
15389            _ => std::option::Option::None,
15390        })
15391    }
15392
15393    /// Sets the value of [action][crate::model::ValueTransformation::action]
15394    /// to hold a `ApplyHash`.
15395    ///
15396    /// Note that all the setters affecting `action` are
15397    /// mutually exclusive.
15398    ///
15399    /// # Example
15400    /// ```ignore,no_run
15401    /// # use google_cloud_clouddms_v1::model::ValueTransformation;
15402    /// use google_cloud_clouddms_v1::model::ApplyHash;
15403    /// let x = ValueTransformation::new().set_apply_hash(ApplyHash::default()/* use setters */);
15404    /// assert!(x.apply_hash().is_some());
15405    /// assert!(x.assign_null().is_none());
15406    /// assert!(x.assign_specific_value().is_none());
15407    /// assert!(x.assign_min_value().is_none());
15408    /// assert!(x.assign_max_value().is_none());
15409    /// assert!(x.round_scale().is_none());
15410    /// ```
15411    pub fn set_apply_hash<T: std::convert::Into<std::boxed::Box<crate::model::ApplyHash>>>(
15412        mut self,
15413        v: T,
15414    ) -> Self {
15415        self.action = std::option::Option::Some(
15416            crate::model::value_transformation::Action::ApplyHash(v.into()),
15417        );
15418        self
15419    }
15420}
15421
15422impl wkt::message::Message for ValueTransformation {
15423    fn typename() -> &'static str {
15424        "type.googleapis.com/google.cloud.clouddms.v1.ValueTransformation"
15425    }
15426}
15427
15428/// Defines additional types related to [ValueTransformation].
15429pub mod value_transformation {
15430    #[allow(unused_imports)]
15431    use super::*;
15432
15433    #[derive(Clone, Debug, PartialEq)]
15434    #[non_exhaustive]
15435    pub enum Filter {
15436        /// Optional. Value is null
15437        IsNull(std::boxed::Box<wkt::Empty>),
15438        /// Optional. Value is found in the specified list.
15439        ValueList(std::boxed::Box<crate::model::ValueListFilter>),
15440        /// Optional. Filter on relation between source value and compare value of
15441        /// type integer.
15442        IntComparison(std::boxed::Box<crate::model::IntComparisonFilter>),
15443        /// Optional. Filter on relation between source value and compare value of
15444        /// type double.
15445        DoubleComparison(std::boxed::Box<crate::model::DoubleComparisonFilter>),
15446    }
15447
15448    #[derive(Clone, Debug, PartialEq)]
15449    #[non_exhaustive]
15450    pub enum Action {
15451        /// Optional. Set to null
15452        AssignNull(std::boxed::Box<wkt::Empty>),
15453        /// Optional. Set to a specific value (value is converted to fit the target
15454        /// data type)
15455        AssignSpecificValue(std::boxed::Box<crate::model::AssignSpecificValue>),
15456        /// Optional. Set to min_value - if integer or numeric, will use
15457        /// int.minvalue, etc
15458        AssignMinValue(std::boxed::Box<wkt::Empty>),
15459        /// Optional. Set to max_value - if integer or numeric, will use
15460        /// int.maxvalue, etc
15461        AssignMaxValue(std::boxed::Box<wkt::Empty>),
15462        /// Optional. Allows the data to change scale
15463        RoundScale(std::boxed::Box<crate::model::RoundToScale>),
15464        /// Optional. Applies a hash function on the data
15465        ApplyHash(std::boxed::Box<crate::model::ApplyHash>),
15466    }
15467}
15468
15469/// Options to configure rule type ConvertROWIDToColumn.
15470/// The rule is used to add column rowid to destination tables based on an Oracle
15471/// rowid function/property.
15472///
15473/// The rule filter field can refer to one or more entities.
15474///
15475/// The rule scope can be one of: Table.
15476///
15477/// This rule requires additional filter to be specified beyond the basic rule
15478/// filter field, which is whether or not to work on tables which already have a
15479/// primary key defined.
15480#[derive(Clone, Default, PartialEq)]
15481#[non_exhaustive]
15482pub struct ConvertRowIdToColumn {
15483    /// Required. Only work on tables without primary key defined
15484    pub only_if_no_primary_key: bool,
15485
15486    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15487}
15488
15489impl ConvertRowIdToColumn {
15490    pub fn new() -> Self {
15491        std::default::Default::default()
15492    }
15493
15494    /// Sets the value of [only_if_no_primary_key][crate::model::ConvertRowIdToColumn::only_if_no_primary_key].
15495    ///
15496    /// # Example
15497    /// ```ignore,no_run
15498    /// # use google_cloud_clouddms_v1::model::ConvertRowIdToColumn;
15499    /// let x = ConvertRowIdToColumn::new().set_only_if_no_primary_key(true);
15500    /// ```
15501    pub fn set_only_if_no_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15502        self.only_if_no_primary_key = v.into();
15503        self
15504    }
15505}
15506
15507impl wkt::message::Message for ConvertRowIdToColumn {
15508    fn typename() -> &'static str {
15509        "type.googleapis.com/google.cloud.clouddms.v1.ConvertRowIdToColumn"
15510    }
15511}
15512
15513/// Options to configure rule type SetTablePrimaryKey.
15514/// The rule is used to specify the columns and name to configure/alter the
15515/// primary key of a table.
15516///
15517/// The rule filter field can refer to one entity.
15518///
15519/// The rule scope can be one of: Table.
15520#[derive(Clone, Default, PartialEq)]
15521#[non_exhaustive]
15522pub struct SetTablePrimaryKey {
15523    /// Required. List of column names for the primary key
15524    pub primary_key_columns: std::vec::Vec<std::string::String>,
15525
15526    /// Optional. Name for the primary key
15527    pub primary_key: std::string::String,
15528
15529    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15530}
15531
15532impl SetTablePrimaryKey {
15533    pub fn new() -> Self {
15534        std::default::Default::default()
15535    }
15536
15537    /// Sets the value of [primary_key_columns][crate::model::SetTablePrimaryKey::primary_key_columns].
15538    ///
15539    /// # Example
15540    /// ```ignore,no_run
15541    /// # use google_cloud_clouddms_v1::model::SetTablePrimaryKey;
15542    /// let x = SetTablePrimaryKey::new().set_primary_key_columns(["a", "b", "c"]);
15543    /// ```
15544    pub fn set_primary_key_columns<T, V>(mut self, v: T) -> Self
15545    where
15546        T: std::iter::IntoIterator<Item = V>,
15547        V: std::convert::Into<std::string::String>,
15548    {
15549        use std::iter::Iterator;
15550        self.primary_key_columns = v.into_iter().map(|i| i.into()).collect();
15551        self
15552    }
15553
15554    /// Sets the value of [primary_key][crate::model::SetTablePrimaryKey::primary_key].
15555    ///
15556    /// # Example
15557    /// ```ignore,no_run
15558    /// # use google_cloud_clouddms_v1::model::SetTablePrimaryKey;
15559    /// let x = SetTablePrimaryKey::new().set_primary_key("example");
15560    /// ```
15561    pub fn set_primary_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15562        self.primary_key = v.into();
15563        self
15564    }
15565}
15566
15567impl wkt::message::Message for SetTablePrimaryKey {
15568    fn typename() -> &'static str {
15569        "type.googleapis.com/google.cloud.clouddms.v1.SetTablePrimaryKey"
15570    }
15571}
15572
15573/// Options to configure rule type SinglePackageChange.
15574/// The rule is used to alter the sql code for a package entities.
15575///
15576/// The rule filter field can refer to one entity.
15577///
15578/// The rule scope can be: Package
15579#[derive(Clone, Default, PartialEq)]
15580#[non_exhaustive]
15581pub struct SinglePackageChange {
15582    /// Optional. Sql code for package description
15583    pub package_description: std::string::String,
15584
15585    /// Optional. Sql code for package body
15586    pub package_body: std::string::String,
15587
15588    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15589}
15590
15591impl SinglePackageChange {
15592    pub fn new() -> Self {
15593        std::default::Default::default()
15594    }
15595
15596    /// Sets the value of [package_description][crate::model::SinglePackageChange::package_description].
15597    ///
15598    /// # Example
15599    /// ```ignore,no_run
15600    /// # use google_cloud_clouddms_v1::model::SinglePackageChange;
15601    /// let x = SinglePackageChange::new().set_package_description("example");
15602    /// ```
15603    pub fn set_package_description<T: std::convert::Into<std::string::String>>(
15604        mut self,
15605        v: T,
15606    ) -> Self {
15607        self.package_description = v.into();
15608        self
15609    }
15610
15611    /// Sets the value of [package_body][crate::model::SinglePackageChange::package_body].
15612    ///
15613    /// # Example
15614    /// ```ignore,no_run
15615    /// # use google_cloud_clouddms_v1::model::SinglePackageChange;
15616    /// let x = SinglePackageChange::new().set_package_body("example");
15617    /// ```
15618    pub fn set_package_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15619        self.package_body = v.into();
15620        self
15621    }
15622}
15623
15624impl wkt::message::Message for SinglePackageChange {
15625    fn typename() -> &'static str {
15626        "type.googleapis.com/google.cloud.clouddms.v1.SinglePackageChange"
15627    }
15628}
15629
15630/// Options to configure rule type SourceSqlChange.
15631/// The rule is used to alter the sql code for database entities.
15632///
15633/// The rule filter field can refer to one entity.
15634///
15635/// The rule scope can be: StoredProcedure, Function, Trigger, View
15636#[derive(Clone, Default, PartialEq)]
15637#[non_exhaustive]
15638pub struct SourceSqlChange {
15639    /// Required. Sql code for source (stored procedure, function, trigger or view)
15640    pub sql_code: std::string::String,
15641
15642    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15643}
15644
15645impl SourceSqlChange {
15646    pub fn new() -> Self {
15647        std::default::Default::default()
15648    }
15649
15650    /// Sets the value of [sql_code][crate::model::SourceSqlChange::sql_code].
15651    ///
15652    /// # Example
15653    /// ```ignore,no_run
15654    /// # use google_cloud_clouddms_v1::model::SourceSqlChange;
15655    /// let x = SourceSqlChange::new().set_sql_code("example");
15656    /// ```
15657    pub fn set_sql_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15658        self.sql_code = v.into();
15659        self
15660    }
15661}
15662
15663impl wkt::message::Message for SourceSqlChange {
15664    fn typename() -> &'static str {
15665        "type.googleapis.com/google.cloud.clouddms.v1.SourceSqlChange"
15666    }
15667}
15668
15669/// Options to configure rule type FilterTableColumns.
15670/// The rule is used to filter the list of columns to include or exclude from a
15671/// table.
15672///
15673/// The rule filter field can refer to one entity.
15674///
15675/// The rule scope can be: Table
15676///
15677/// Only one of the two lists can be specified for the rule.
15678#[derive(Clone, Default, PartialEq)]
15679#[non_exhaustive]
15680pub struct FilterTableColumns {
15681    /// Optional. List of columns to be included for a particular table.
15682    pub include_columns: std::vec::Vec<std::string::String>,
15683
15684    /// Optional. List of columns to be excluded for a particular table.
15685    pub exclude_columns: std::vec::Vec<std::string::String>,
15686
15687    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15688}
15689
15690impl FilterTableColumns {
15691    pub fn new() -> Self {
15692        std::default::Default::default()
15693    }
15694
15695    /// Sets the value of [include_columns][crate::model::FilterTableColumns::include_columns].
15696    ///
15697    /// # Example
15698    /// ```ignore,no_run
15699    /// # use google_cloud_clouddms_v1::model::FilterTableColumns;
15700    /// let x = FilterTableColumns::new().set_include_columns(["a", "b", "c"]);
15701    /// ```
15702    pub fn set_include_columns<T, V>(mut self, v: T) -> Self
15703    where
15704        T: std::iter::IntoIterator<Item = V>,
15705        V: std::convert::Into<std::string::String>,
15706    {
15707        use std::iter::Iterator;
15708        self.include_columns = v.into_iter().map(|i| i.into()).collect();
15709        self
15710    }
15711
15712    /// Sets the value of [exclude_columns][crate::model::FilterTableColumns::exclude_columns].
15713    ///
15714    /// # Example
15715    /// ```ignore,no_run
15716    /// # use google_cloud_clouddms_v1::model::FilterTableColumns;
15717    /// let x = FilterTableColumns::new().set_exclude_columns(["a", "b", "c"]);
15718    /// ```
15719    pub fn set_exclude_columns<T, V>(mut self, v: T) -> Self
15720    where
15721        T: std::iter::IntoIterator<Item = V>,
15722        V: std::convert::Into<std::string::String>,
15723    {
15724        use std::iter::Iterator;
15725        self.exclude_columns = v.into_iter().map(|i| i.into()).collect();
15726        self
15727    }
15728}
15729
15730impl wkt::message::Message for FilterTableColumns {
15731    fn typename() -> &'static str {
15732        "type.googleapis.com/google.cloud.clouddms.v1.FilterTableColumns"
15733    }
15734}
15735
15736/// A list of values to filter by in ConditionalColumnSetValue
15737#[derive(Clone, Default, PartialEq)]
15738#[non_exhaustive]
15739pub struct ValueListFilter {
15740    /// Required. Indicates whether the filter matches rows with values that are
15741    /// present in the list or those with values not present in it.
15742    pub value_present_list: crate::model::ValuePresentInList,
15743
15744    /// Required. The list to be used to filter by
15745    pub values: std::vec::Vec<std::string::String>,
15746
15747    /// Required. Whether to ignore case when filtering by values. Defaults to
15748    /// false
15749    pub ignore_case: bool,
15750
15751    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15752}
15753
15754impl ValueListFilter {
15755    pub fn new() -> Self {
15756        std::default::Default::default()
15757    }
15758
15759    /// Sets the value of [value_present_list][crate::model::ValueListFilter::value_present_list].
15760    ///
15761    /// # Example
15762    /// ```ignore,no_run
15763    /// # use google_cloud_clouddms_v1::model::ValueListFilter;
15764    /// use google_cloud_clouddms_v1::model::ValuePresentInList;
15765    /// let x0 = ValueListFilter::new().set_value_present_list(ValuePresentInList::IfValueList);
15766    /// let x1 = ValueListFilter::new().set_value_present_list(ValuePresentInList::IfValueNotList);
15767    /// ```
15768    pub fn set_value_present_list<T: std::convert::Into<crate::model::ValuePresentInList>>(
15769        mut self,
15770        v: T,
15771    ) -> Self {
15772        self.value_present_list = v.into();
15773        self
15774    }
15775
15776    /// Sets the value of [values][crate::model::ValueListFilter::values].
15777    ///
15778    /// # Example
15779    /// ```ignore,no_run
15780    /// # use google_cloud_clouddms_v1::model::ValueListFilter;
15781    /// let x = ValueListFilter::new().set_values(["a", "b", "c"]);
15782    /// ```
15783    pub fn set_values<T, V>(mut self, v: T) -> Self
15784    where
15785        T: std::iter::IntoIterator<Item = V>,
15786        V: std::convert::Into<std::string::String>,
15787    {
15788        use std::iter::Iterator;
15789        self.values = v.into_iter().map(|i| i.into()).collect();
15790        self
15791    }
15792
15793    /// Sets the value of [ignore_case][crate::model::ValueListFilter::ignore_case].
15794    ///
15795    /// # Example
15796    /// ```ignore,no_run
15797    /// # use google_cloud_clouddms_v1::model::ValueListFilter;
15798    /// let x = ValueListFilter::new().set_ignore_case(true);
15799    /// ```
15800    pub fn set_ignore_case<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15801        self.ignore_case = v.into();
15802        self
15803    }
15804}
15805
15806impl wkt::message::Message for ValueListFilter {
15807    fn typename() -> &'static str {
15808        "type.googleapis.com/google.cloud.clouddms.v1.ValueListFilter"
15809    }
15810}
15811
15812/// Filter based on relation between source value and compare value of type
15813/// integer in ConditionalColumnSetValue
15814#[derive(Clone, Default, PartialEq)]
15815#[non_exhaustive]
15816pub struct IntComparisonFilter {
15817    /// Required. Relation between source value and compare value
15818    pub value_comparison: crate::model::ValueComparison,
15819
15820    /// Required. Integer compare value to be used
15821    pub value: i64,
15822
15823    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15824}
15825
15826impl IntComparisonFilter {
15827    pub fn new() -> Self {
15828        std::default::Default::default()
15829    }
15830
15831    /// Sets the value of [value_comparison][crate::model::IntComparisonFilter::value_comparison].
15832    ///
15833    /// # Example
15834    /// ```ignore,no_run
15835    /// # use google_cloud_clouddms_v1::model::IntComparisonFilter;
15836    /// use google_cloud_clouddms_v1::model::ValueComparison;
15837    /// let x0 = IntComparisonFilter::new().set_value_comparison(ValueComparison::IfValueSmallerThan);
15838    /// let x1 = IntComparisonFilter::new().set_value_comparison(ValueComparison::IfValueSmallerEqualThan);
15839    /// let x2 = IntComparisonFilter::new().set_value_comparison(ValueComparison::IfValueLargerThan);
15840    /// ```
15841    pub fn set_value_comparison<T: std::convert::Into<crate::model::ValueComparison>>(
15842        mut self,
15843        v: T,
15844    ) -> Self {
15845        self.value_comparison = v.into();
15846        self
15847    }
15848
15849    /// Sets the value of [value][crate::model::IntComparisonFilter::value].
15850    ///
15851    /// # Example
15852    /// ```ignore,no_run
15853    /// # use google_cloud_clouddms_v1::model::IntComparisonFilter;
15854    /// let x = IntComparisonFilter::new().set_value(42);
15855    /// ```
15856    pub fn set_value<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
15857        self.value = v.into();
15858        self
15859    }
15860}
15861
15862impl wkt::message::Message for IntComparisonFilter {
15863    fn typename() -> &'static str {
15864        "type.googleapis.com/google.cloud.clouddms.v1.IntComparisonFilter"
15865    }
15866}
15867
15868/// Filter based on relation between source
15869/// value and compare value of type double in ConditionalColumnSetValue
15870#[derive(Clone, Default, PartialEq)]
15871#[non_exhaustive]
15872pub struct DoubleComparisonFilter {
15873    /// Required. Relation between source value and compare value
15874    pub value_comparison: crate::model::ValueComparison,
15875
15876    /// Required. Double compare value to be used
15877    pub value: f64,
15878
15879    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15880}
15881
15882impl DoubleComparisonFilter {
15883    pub fn new() -> Self {
15884        std::default::Default::default()
15885    }
15886
15887    /// Sets the value of [value_comparison][crate::model::DoubleComparisonFilter::value_comparison].
15888    ///
15889    /// # Example
15890    /// ```ignore,no_run
15891    /// # use google_cloud_clouddms_v1::model::DoubleComparisonFilter;
15892    /// use google_cloud_clouddms_v1::model::ValueComparison;
15893    /// let x0 = DoubleComparisonFilter::new().set_value_comparison(ValueComparison::IfValueSmallerThan);
15894    /// let x1 = DoubleComparisonFilter::new().set_value_comparison(ValueComparison::IfValueSmallerEqualThan);
15895    /// let x2 = DoubleComparisonFilter::new().set_value_comparison(ValueComparison::IfValueLargerThan);
15896    /// ```
15897    pub fn set_value_comparison<T: std::convert::Into<crate::model::ValueComparison>>(
15898        mut self,
15899        v: T,
15900    ) -> Self {
15901        self.value_comparison = v.into();
15902        self
15903    }
15904
15905    /// Sets the value of [value][crate::model::DoubleComparisonFilter::value].
15906    ///
15907    /// # Example
15908    /// ```ignore,no_run
15909    /// # use google_cloud_clouddms_v1::model::DoubleComparisonFilter;
15910    /// let x = DoubleComparisonFilter::new().set_value(42.0);
15911    /// ```
15912    pub fn set_value<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
15913        self.value = v.into();
15914        self
15915    }
15916}
15917
15918impl wkt::message::Message for DoubleComparisonFilter {
15919    fn typename() -> &'static str {
15920        "type.googleapis.com/google.cloud.clouddms.v1.DoubleComparisonFilter"
15921    }
15922}
15923
15924/// Set to a specific value (value is converted to fit the target data type)
15925#[derive(Clone, Default, PartialEq)]
15926#[non_exhaustive]
15927pub struct AssignSpecificValue {
15928    /// Required. Specific value to be assigned
15929    pub value: std::string::String,
15930
15931    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15932}
15933
15934impl AssignSpecificValue {
15935    pub fn new() -> Self {
15936        std::default::Default::default()
15937    }
15938
15939    /// Sets the value of [value][crate::model::AssignSpecificValue::value].
15940    ///
15941    /// # Example
15942    /// ```ignore,no_run
15943    /// # use google_cloud_clouddms_v1::model::AssignSpecificValue;
15944    /// let x = AssignSpecificValue::new().set_value("example");
15945    /// ```
15946    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15947        self.value = v.into();
15948        self
15949    }
15950}
15951
15952impl wkt::message::Message for AssignSpecificValue {
15953    fn typename() -> &'static str {
15954        "type.googleapis.com/google.cloud.clouddms.v1.AssignSpecificValue"
15955    }
15956}
15957
15958/// Apply a hash function on the value.
15959#[derive(Clone, Default, PartialEq)]
15960#[non_exhaustive]
15961pub struct ApplyHash {
15962    pub hash_function: std::option::Option<crate::model::apply_hash::HashFunction>,
15963
15964    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15965}
15966
15967impl ApplyHash {
15968    pub fn new() -> Self {
15969        std::default::Default::default()
15970    }
15971
15972    /// Sets the value of [hash_function][crate::model::ApplyHash::hash_function].
15973    ///
15974    /// Note that all the setters affecting `hash_function` are mutually
15975    /// exclusive.
15976    ///
15977    /// # Example
15978    /// ```ignore,no_run
15979    /// # use google_cloud_clouddms_v1::model::ApplyHash;
15980    /// use wkt::Empty;
15981    /// let x = ApplyHash::new().set_hash_function(Some(
15982    ///     google_cloud_clouddms_v1::model::apply_hash::HashFunction::UuidFromBytes(Empty::default().into())));
15983    /// ```
15984    pub fn set_hash_function<
15985        T: std::convert::Into<std::option::Option<crate::model::apply_hash::HashFunction>>,
15986    >(
15987        mut self,
15988        v: T,
15989    ) -> Self {
15990        self.hash_function = v.into();
15991        self
15992    }
15993
15994    /// The value of [hash_function][crate::model::ApplyHash::hash_function]
15995    /// if it holds a `UuidFromBytes`, `None` if the field is not set or
15996    /// holds a different branch.
15997    pub fn uuid_from_bytes(&self) -> std::option::Option<&std::boxed::Box<wkt::Empty>> {
15998        #[allow(unreachable_patterns)]
15999        self.hash_function.as_ref().and_then(|v| match v {
16000            crate::model::apply_hash::HashFunction::UuidFromBytes(v) => {
16001                std::option::Option::Some(v)
16002            }
16003            _ => std::option::Option::None,
16004        })
16005    }
16006
16007    /// Sets the value of [hash_function][crate::model::ApplyHash::hash_function]
16008    /// to hold a `UuidFromBytes`.
16009    ///
16010    /// Note that all the setters affecting `hash_function` are
16011    /// mutually exclusive.
16012    ///
16013    /// # Example
16014    /// ```ignore,no_run
16015    /// # use google_cloud_clouddms_v1::model::ApplyHash;
16016    /// use wkt::Empty;
16017    /// let x = ApplyHash::new().set_uuid_from_bytes(Empty::default()/* use setters */);
16018    /// assert!(x.uuid_from_bytes().is_some());
16019    /// ```
16020    pub fn set_uuid_from_bytes<T: std::convert::Into<std::boxed::Box<wkt::Empty>>>(
16021        mut self,
16022        v: T,
16023    ) -> Self {
16024        self.hash_function = std::option::Option::Some(
16025            crate::model::apply_hash::HashFunction::UuidFromBytes(v.into()),
16026        );
16027        self
16028    }
16029}
16030
16031impl wkt::message::Message for ApplyHash {
16032    fn typename() -> &'static str {
16033        "type.googleapis.com/google.cloud.clouddms.v1.ApplyHash"
16034    }
16035}
16036
16037/// Defines additional types related to [ApplyHash].
16038pub mod apply_hash {
16039    #[allow(unused_imports)]
16040    use super::*;
16041
16042    #[derive(Clone, Debug, PartialEq)]
16043    #[non_exhaustive]
16044    pub enum HashFunction {
16045        /// Optional. Generate UUID from the data's byte array
16046        UuidFromBytes(std::boxed::Box<wkt::Empty>),
16047    }
16048}
16049
16050/// This allows the data to change scale, for example if the source is 2 digits
16051/// after the decimal point, specify round to scale value = 2. If for example the
16052/// value needs to be converted to an integer, use round to scale value = 0.
16053#[derive(Clone, Default, PartialEq)]
16054#[non_exhaustive]
16055pub struct RoundToScale {
16056    /// Required. Scale value to be used
16057    pub scale: i32,
16058
16059    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16060}
16061
16062impl RoundToScale {
16063    pub fn new() -> Self {
16064        std::default::Default::default()
16065    }
16066
16067    /// Sets the value of [scale][crate::model::RoundToScale::scale].
16068    ///
16069    /// # Example
16070    /// ```ignore,no_run
16071    /// # use google_cloud_clouddms_v1::model::RoundToScale;
16072    /// let x = RoundToScale::new().set_scale(42);
16073    /// ```
16074    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16075        self.scale = v.into();
16076        self
16077    }
16078}
16079
16080impl wkt::message::Message for RoundToScale {
16081    fn typename() -> &'static str {
16082        "type.googleapis.com/google.cloud.clouddms.v1.RoundToScale"
16083    }
16084}
16085
16086/// The base entity type for all the database related entities.
16087/// The message contains the entity name, the name of its parent, the entity
16088/// type, and the specific details per entity type.
16089#[derive(Clone, Default, PartialEq)]
16090#[non_exhaustive]
16091pub struct DatabaseEntity {
16092    /// The short name (e.g. table name) of the entity.
16093    pub short_name: std::string::String,
16094
16095    /// The full name of the parent entity (e.g. schema name).
16096    pub parent_entity: std::string::String,
16097
16098    /// The type of tree the entity belongs to.
16099    pub tree: crate::model::database_entity::TreeType,
16100
16101    /// The type of the database entity (table, view, index, ...).
16102    pub entity_type: crate::model::DatabaseEntityType,
16103
16104    /// Details about entity mappings.
16105    /// For source tree entities, this holds the draft entities which were
16106    /// generated by the mapping rules.
16107    /// For draft tree entities, this holds the source entities which were
16108    /// converted to form the draft entity.
16109    /// Destination entities will have no mapping details.
16110    pub mappings: std::vec::Vec<crate::model::EntityMapping>,
16111
16112    /// Details about the entity DDL script. Multiple DDL scripts are provided for
16113    /// child entities such as a table entity will have one DDL for the table with
16114    /// additional DDLs for each index, constraint and such.
16115    pub entity_ddl: std::vec::Vec<crate::model::EntityDdl>,
16116
16117    /// Details about the various issues found for the entity.
16118    pub issues: std::vec::Vec<crate::model::EntityIssue>,
16119
16120    /// The specific body for each entity type.
16121    pub entity_body: std::option::Option<crate::model::database_entity::EntityBody>,
16122
16123    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16124}
16125
16126impl DatabaseEntity {
16127    pub fn new() -> Self {
16128        std::default::Default::default()
16129    }
16130
16131    /// Sets the value of [short_name][crate::model::DatabaseEntity::short_name].
16132    ///
16133    /// # Example
16134    /// ```ignore,no_run
16135    /// # use google_cloud_clouddms_v1::model::DatabaseEntity;
16136    /// let x = DatabaseEntity::new().set_short_name("example");
16137    /// ```
16138    pub fn set_short_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16139        self.short_name = v.into();
16140        self
16141    }
16142
16143    /// Sets the value of [parent_entity][crate::model::DatabaseEntity::parent_entity].
16144    ///
16145    /// # Example
16146    /// ```ignore,no_run
16147    /// # use google_cloud_clouddms_v1::model::DatabaseEntity;
16148    /// let x = DatabaseEntity::new().set_parent_entity("example");
16149    /// ```
16150    pub fn set_parent_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16151        self.parent_entity = v.into();
16152        self
16153    }
16154
16155    /// Sets the value of [tree][crate::model::DatabaseEntity::tree].
16156    ///
16157    /// # Example
16158    /// ```ignore,no_run
16159    /// # use google_cloud_clouddms_v1::model::DatabaseEntity;
16160    /// use google_cloud_clouddms_v1::model::database_entity::TreeType;
16161    /// let x0 = DatabaseEntity::new().set_tree(TreeType::Source);
16162    /// let x1 = DatabaseEntity::new().set_tree(TreeType::Draft);
16163    /// let x2 = DatabaseEntity::new().set_tree(TreeType::Destination);
16164    /// ```
16165    pub fn set_tree<T: std::convert::Into<crate::model::database_entity::TreeType>>(
16166        mut self,
16167        v: T,
16168    ) -> Self {
16169        self.tree = v.into();
16170        self
16171    }
16172
16173    /// Sets the value of [entity_type][crate::model::DatabaseEntity::entity_type].
16174    ///
16175    /// # Example
16176    /// ```ignore,no_run
16177    /// # use google_cloud_clouddms_v1::model::DatabaseEntity;
16178    /// use google_cloud_clouddms_v1::model::DatabaseEntityType;
16179    /// let x0 = DatabaseEntity::new().set_entity_type(DatabaseEntityType::Schema);
16180    /// let x1 = DatabaseEntity::new().set_entity_type(DatabaseEntityType::Table);
16181    /// let x2 = DatabaseEntity::new().set_entity_type(DatabaseEntityType::Column);
16182    /// ```
16183    pub fn set_entity_type<T: std::convert::Into<crate::model::DatabaseEntityType>>(
16184        mut self,
16185        v: T,
16186    ) -> Self {
16187        self.entity_type = v.into();
16188        self
16189    }
16190
16191    /// Sets the value of [mappings][crate::model::DatabaseEntity::mappings].
16192    ///
16193    /// # Example
16194    /// ```ignore,no_run
16195    /// # use google_cloud_clouddms_v1::model::DatabaseEntity;
16196    /// use google_cloud_clouddms_v1::model::EntityMapping;
16197    /// let x = DatabaseEntity::new()
16198    ///     .set_mappings([
16199    ///         EntityMapping::default()/* use setters */,
16200    ///         EntityMapping::default()/* use (different) setters */,
16201    ///     ]);
16202    /// ```
16203    pub fn set_mappings<T, V>(mut self, v: T) -> Self
16204    where
16205        T: std::iter::IntoIterator<Item = V>,
16206        V: std::convert::Into<crate::model::EntityMapping>,
16207    {
16208        use std::iter::Iterator;
16209        self.mappings = v.into_iter().map(|i| i.into()).collect();
16210        self
16211    }
16212
16213    /// Sets the value of [entity_ddl][crate::model::DatabaseEntity::entity_ddl].
16214    ///
16215    /// # Example
16216    /// ```ignore,no_run
16217    /// # use google_cloud_clouddms_v1::model::DatabaseEntity;
16218    /// use google_cloud_clouddms_v1::model::EntityDdl;
16219    /// let x = DatabaseEntity::new()
16220    ///     .set_entity_ddl([
16221    ///         EntityDdl::default()/* use setters */,
16222    ///         EntityDdl::default()/* use (different) setters */,
16223    ///     ]);
16224    /// ```
16225    pub fn set_entity_ddl<T, V>(mut self, v: T) -> Self
16226    where
16227        T: std::iter::IntoIterator<Item = V>,
16228        V: std::convert::Into<crate::model::EntityDdl>,
16229    {
16230        use std::iter::Iterator;
16231        self.entity_ddl = v.into_iter().map(|i| i.into()).collect();
16232        self
16233    }
16234
16235    /// Sets the value of [issues][crate::model::DatabaseEntity::issues].
16236    ///
16237    /// # Example
16238    /// ```ignore,no_run
16239    /// # use google_cloud_clouddms_v1::model::DatabaseEntity;
16240    /// use google_cloud_clouddms_v1::model::EntityIssue;
16241    /// let x = DatabaseEntity::new()
16242    ///     .set_issues([
16243    ///         EntityIssue::default()/* use setters */,
16244    ///         EntityIssue::default()/* use (different) setters */,
16245    ///     ]);
16246    /// ```
16247    pub fn set_issues<T, V>(mut self, v: T) -> Self
16248    where
16249        T: std::iter::IntoIterator<Item = V>,
16250        V: std::convert::Into<crate::model::EntityIssue>,
16251    {
16252        use std::iter::Iterator;
16253        self.issues = v.into_iter().map(|i| i.into()).collect();
16254        self
16255    }
16256
16257    /// Sets the value of [entity_body][crate::model::DatabaseEntity::entity_body].
16258    ///
16259    /// Note that all the setters affecting `entity_body` are mutually
16260    /// exclusive.
16261    ///
16262    /// # Example
16263    /// ```ignore,no_run
16264    /// # use google_cloud_clouddms_v1::model::DatabaseEntity;
16265    /// use google_cloud_clouddms_v1::model::DatabaseInstanceEntity;
16266    /// let x = DatabaseEntity::new().set_entity_body(Some(
16267    ///     google_cloud_clouddms_v1::model::database_entity::EntityBody::Database(DatabaseInstanceEntity::default().into())));
16268    /// ```
16269    pub fn set_entity_body<
16270        T: std::convert::Into<std::option::Option<crate::model::database_entity::EntityBody>>,
16271    >(
16272        mut self,
16273        v: T,
16274    ) -> Self {
16275        self.entity_body = v.into();
16276        self
16277    }
16278
16279    /// The value of [entity_body][crate::model::DatabaseEntity::entity_body]
16280    /// if it holds a `Database`, `None` if the field is not set or
16281    /// holds a different branch.
16282    pub fn database(
16283        &self,
16284    ) -> std::option::Option<&std::boxed::Box<crate::model::DatabaseInstanceEntity>> {
16285        #[allow(unreachable_patterns)]
16286        self.entity_body.as_ref().and_then(|v| match v {
16287            crate::model::database_entity::EntityBody::Database(v) => std::option::Option::Some(v),
16288            _ => std::option::Option::None,
16289        })
16290    }
16291
16292    /// Sets the value of [entity_body][crate::model::DatabaseEntity::entity_body]
16293    /// to hold a `Database`.
16294    ///
16295    /// Note that all the setters affecting `entity_body` are
16296    /// mutually exclusive.
16297    ///
16298    /// # Example
16299    /// ```ignore,no_run
16300    /// # use google_cloud_clouddms_v1::model::DatabaseEntity;
16301    /// use google_cloud_clouddms_v1::model::DatabaseInstanceEntity;
16302    /// let x = DatabaseEntity::new().set_database(DatabaseInstanceEntity::default()/* use setters */);
16303    /// assert!(x.database().is_some());
16304    /// assert!(x.schema().is_none());
16305    /// assert!(x.table().is_none());
16306    /// assert!(x.view().is_none());
16307    /// assert!(x.sequence().is_none());
16308    /// assert!(x.stored_procedure().is_none());
16309    /// assert!(x.database_function().is_none());
16310    /// assert!(x.synonym().is_none());
16311    /// assert!(x.database_package().is_none());
16312    /// assert!(x.udt().is_none());
16313    /// assert!(x.materialized_view().is_none());
16314    /// ```
16315    pub fn set_database<
16316        T: std::convert::Into<std::boxed::Box<crate::model::DatabaseInstanceEntity>>,
16317    >(
16318        mut self,
16319        v: T,
16320    ) -> Self {
16321        self.entity_body = std::option::Option::Some(
16322            crate::model::database_entity::EntityBody::Database(v.into()),
16323        );
16324        self
16325    }
16326
16327    /// The value of [entity_body][crate::model::DatabaseEntity::entity_body]
16328    /// if it holds a `Schema`, `None` if the field is not set or
16329    /// holds a different branch.
16330    pub fn schema(&self) -> std::option::Option<&std::boxed::Box<crate::model::SchemaEntity>> {
16331        #[allow(unreachable_patterns)]
16332        self.entity_body.as_ref().and_then(|v| match v {
16333            crate::model::database_entity::EntityBody::Schema(v) => std::option::Option::Some(v),
16334            _ => std::option::Option::None,
16335        })
16336    }
16337
16338    /// Sets the value of [entity_body][crate::model::DatabaseEntity::entity_body]
16339    /// to hold a `Schema`.
16340    ///
16341    /// Note that all the setters affecting `entity_body` are
16342    /// mutually exclusive.
16343    ///
16344    /// # Example
16345    /// ```ignore,no_run
16346    /// # use google_cloud_clouddms_v1::model::DatabaseEntity;
16347    /// use google_cloud_clouddms_v1::model::SchemaEntity;
16348    /// let x = DatabaseEntity::new().set_schema(SchemaEntity::default()/* use setters */);
16349    /// assert!(x.schema().is_some());
16350    /// assert!(x.database().is_none());
16351    /// assert!(x.table().is_none());
16352    /// assert!(x.view().is_none());
16353    /// assert!(x.sequence().is_none());
16354    /// assert!(x.stored_procedure().is_none());
16355    /// assert!(x.database_function().is_none());
16356    /// assert!(x.synonym().is_none());
16357    /// assert!(x.database_package().is_none());
16358    /// assert!(x.udt().is_none());
16359    /// assert!(x.materialized_view().is_none());
16360    /// ```
16361    pub fn set_schema<T: std::convert::Into<std::boxed::Box<crate::model::SchemaEntity>>>(
16362        mut self,
16363        v: T,
16364    ) -> Self {
16365        self.entity_body =
16366            std::option::Option::Some(crate::model::database_entity::EntityBody::Schema(v.into()));
16367        self
16368    }
16369
16370    /// The value of [entity_body][crate::model::DatabaseEntity::entity_body]
16371    /// if it holds a `Table`, `None` if the field is not set or
16372    /// holds a different branch.
16373    pub fn table(&self) -> std::option::Option<&std::boxed::Box<crate::model::TableEntity>> {
16374        #[allow(unreachable_patterns)]
16375        self.entity_body.as_ref().and_then(|v| match v {
16376            crate::model::database_entity::EntityBody::Table(v) => std::option::Option::Some(v),
16377            _ => std::option::Option::None,
16378        })
16379    }
16380
16381    /// Sets the value of [entity_body][crate::model::DatabaseEntity::entity_body]
16382    /// to hold a `Table`.
16383    ///
16384    /// Note that all the setters affecting `entity_body` are
16385    /// mutually exclusive.
16386    ///
16387    /// # Example
16388    /// ```ignore,no_run
16389    /// # use google_cloud_clouddms_v1::model::DatabaseEntity;
16390    /// use google_cloud_clouddms_v1::model::TableEntity;
16391    /// let x = DatabaseEntity::new().set_table(TableEntity::default()/* use setters */);
16392    /// assert!(x.table().is_some());
16393    /// assert!(x.database().is_none());
16394    /// assert!(x.schema().is_none());
16395    /// assert!(x.view().is_none());
16396    /// assert!(x.sequence().is_none());
16397    /// assert!(x.stored_procedure().is_none());
16398    /// assert!(x.database_function().is_none());
16399    /// assert!(x.synonym().is_none());
16400    /// assert!(x.database_package().is_none());
16401    /// assert!(x.udt().is_none());
16402    /// assert!(x.materialized_view().is_none());
16403    /// ```
16404    pub fn set_table<T: std::convert::Into<std::boxed::Box<crate::model::TableEntity>>>(
16405        mut self,
16406        v: T,
16407    ) -> Self {
16408        self.entity_body =
16409            std::option::Option::Some(crate::model::database_entity::EntityBody::Table(v.into()));
16410        self
16411    }
16412
16413    /// The value of [entity_body][crate::model::DatabaseEntity::entity_body]
16414    /// if it holds a `View`, `None` if the field is not set or
16415    /// holds a different branch.
16416    pub fn view(&self) -> std::option::Option<&std::boxed::Box<crate::model::ViewEntity>> {
16417        #[allow(unreachable_patterns)]
16418        self.entity_body.as_ref().and_then(|v| match v {
16419            crate::model::database_entity::EntityBody::View(v) => std::option::Option::Some(v),
16420            _ => std::option::Option::None,
16421        })
16422    }
16423
16424    /// Sets the value of [entity_body][crate::model::DatabaseEntity::entity_body]
16425    /// to hold a `View`.
16426    ///
16427    /// Note that all the setters affecting `entity_body` are
16428    /// mutually exclusive.
16429    ///
16430    /// # Example
16431    /// ```ignore,no_run
16432    /// # use google_cloud_clouddms_v1::model::DatabaseEntity;
16433    /// use google_cloud_clouddms_v1::model::ViewEntity;
16434    /// let x = DatabaseEntity::new().set_view(ViewEntity::default()/* use setters */);
16435    /// assert!(x.view().is_some());
16436    /// assert!(x.database().is_none());
16437    /// assert!(x.schema().is_none());
16438    /// assert!(x.table().is_none());
16439    /// assert!(x.sequence().is_none());
16440    /// assert!(x.stored_procedure().is_none());
16441    /// assert!(x.database_function().is_none());
16442    /// assert!(x.synonym().is_none());
16443    /// assert!(x.database_package().is_none());
16444    /// assert!(x.udt().is_none());
16445    /// assert!(x.materialized_view().is_none());
16446    /// ```
16447    pub fn set_view<T: std::convert::Into<std::boxed::Box<crate::model::ViewEntity>>>(
16448        mut self,
16449        v: T,
16450    ) -> Self {
16451        self.entity_body =
16452            std::option::Option::Some(crate::model::database_entity::EntityBody::View(v.into()));
16453        self
16454    }
16455
16456    /// The value of [entity_body][crate::model::DatabaseEntity::entity_body]
16457    /// if it holds a `Sequence`, `None` if the field is not set or
16458    /// holds a different branch.
16459    pub fn sequence(&self) -> std::option::Option<&std::boxed::Box<crate::model::SequenceEntity>> {
16460        #[allow(unreachable_patterns)]
16461        self.entity_body.as_ref().and_then(|v| match v {
16462            crate::model::database_entity::EntityBody::Sequence(v) => std::option::Option::Some(v),
16463            _ => std::option::Option::None,
16464        })
16465    }
16466
16467    /// Sets the value of [entity_body][crate::model::DatabaseEntity::entity_body]
16468    /// to hold a `Sequence`.
16469    ///
16470    /// Note that all the setters affecting `entity_body` are
16471    /// mutually exclusive.
16472    ///
16473    /// # Example
16474    /// ```ignore,no_run
16475    /// # use google_cloud_clouddms_v1::model::DatabaseEntity;
16476    /// use google_cloud_clouddms_v1::model::SequenceEntity;
16477    /// let x = DatabaseEntity::new().set_sequence(SequenceEntity::default()/* use setters */);
16478    /// assert!(x.sequence().is_some());
16479    /// assert!(x.database().is_none());
16480    /// assert!(x.schema().is_none());
16481    /// assert!(x.table().is_none());
16482    /// assert!(x.view().is_none());
16483    /// assert!(x.stored_procedure().is_none());
16484    /// assert!(x.database_function().is_none());
16485    /// assert!(x.synonym().is_none());
16486    /// assert!(x.database_package().is_none());
16487    /// assert!(x.udt().is_none());
16488    /// assert!(x.materialized_view().is_none());
16489    /// ```
16490    pub fn set_sequence<T: std::convert::Into<std::boxed::Box<crate::model::SequenceEntity>>>(
16491        mut self,
16492        v: T,
16493    ) -> Self {
16494        self.entity_body = std::option::Option::Some(
16495            crate::model::database_entity::EntityBody::Sequence(v.into()),
16496        );
16497        self
16498    }
16499
16500    /// The value of [entity_body][crate::model::DatabaseEntity::entity_body]
16501    /// if it holds a `StoredProcedure`, `None` if the field is not set or
16502    /// holds a different branch.
16503    pub fn stored_procedure(
16504        &self,
16505    ) -> std::option::Option<&std::boxed::Box<crate::model::StoredProcedureEntity>> {
16506        #[allow(unreachable_patterns)]
16507        self.entity_body.as_ref().and_then(|v| match v {
16508            crate::model::database_entity::EntityBody::StoredProcedure(v) => {
16509                std::option::Option::Some(v)
16510            }
16511            _ => std::option::Option::None,
16512        })
16513    }
16514
16515    /// Sets the value of [entity_body][crate::model::DatabaseEntity::entity_body]
16516    /// to hold a `StoredProcedure`.
16517    ///
16518    /// Note that all the setters affecting `entity_body` are
16519    /// mutually exclusive.
16520    ///
16521    /// # Example
16522    /// ```ignore,no_run
16523    /// # use google_cloud_clouddms_v1::model::DatabaseEntity;
16524    /// use google_cloud_clouddms_v1::model::StoredProcedureEntity;
16525    /// let x = DatabaseEntity::new().set_stored_procedure(StoredProcedureEntity::default()/* use setters */);
16526    /// assert!(x.stored_procedure().is_some());
16527    /// assert!(x.database().is_none());
16528    /// assert!(x.schema().is_none());
16529    /// assert!(x.table().is_none());
16530    /// assert!(x.view().is_none());
16531    /// assert!(x.sequence().is_none());
16532    /// assert!(x.database_function().is_none());
16533    /// assert!(x.synonym().is_none());
16534    /// assert!(x.database_package().is_none());
16535    /// assert!(x.udt().is_none());
16536    /// assert!(x.materialized_view().is_none());
16537    /// ```
16538    pub fn set_stored_procedure<
16539        T: std::convert::Into<std::boxed::Box<crate::model::StoredProcedureEntity>>,
16540    >(
16541        mut self,
16542        v: T,
16543    ) -> Self {
16544        self.entity_body = std::option::Option::Some(
16545            crate::model::database_entity::EntityBody::StoredProcedure(v.into()),
16546        );
16547        self
16548    }
16549
16550    /// The value of [entity_body][crate::model::DatabaseEntity::entity_body]
16551    /// if it holds a `DatabaseFunction`, `None` if the field is not set or
16552    /// holds a different branch.
16553    pub fn database_function(
16554        &self,
16555    ) -> std::option::Option<&std::boxed::Box<crate::model::FunctionEntity>> {
16556        #[allow(unreachable_patterns)]
16557        self.entity_body.as_ref().and_then(|v| match v {
16558            crate::model::database_entity::EntityBody::DatabaseFunction(v) => {
16559                std::option::Option::Some(v)
16560            }
16561            _ => std::option::Option::None,
16562        })
16563    }
16564
16565    /// Sets the value of [entity_body][crate::model::DatabaseEntity::entity_body]
16566    /// to hold a `DatabaseFunction`.
16567    ///
16568    /// Note that all the setters affecting `entity_body` are
16569    /// mutually exclusive.
16570    ///
16571    /// # Example
16572    /// ```ignore,no_run
16573    /// # use google_cloud_clouddms_v1::model::DatabaseEntity;
16574    /// use google_cloud_clouddms_v1::model::FunctionEntity;
16575    /// let x = DatabaseEntity::new().set_database_function(FunctionEntity::default()/* use setters */);
16576    /// assert!(x.database_function().is_some());
16577    /// assert!(x.database().is_none());
16578    /// assert!(x.schema().is_none());
16579    /// assert!(x.table().is_none());
16580    /// assert!(x.view().is_none());
16581    /// assert!(x.sequence().is_none());
16582    /// assert!(x.stored_procedure().is_none());
16583    /// assert!(x.synonym().is_none());
16584    /// assert!(x.database_package().is_none());
16585    /// assert!(x.udt().is_none());
16586    /// assert!(x.materialized_view().is_none());
16587    /// ```
16588    pub fn set_database_function<
16589        T: std::convert::Into<std::boxed::Box<crate::model::FunctionEntity>>,
16590    >(
16591        mut self,
16592        v: T,
16593    ) -> Self {
16594        self.entity_body = std::option::Option::Some(
16595            crate::model::database_entity::EntityBody::DatabaseFunction(v.into()),
16596        );
16597        self
16598    }
16599
16600    /// The value of [entity_body][crate::model::DatabaseEntity::entity_body]
16601    /// if it holds a `Synonym`, `None` if the field is not set or
16602    /// holds a different branch.
16603    pub fn synonym(&self) -> std::option::Option<&std::boxed::Box<crate::model::SynonymEntity>> {
16604        #[allow(unreachable_patterns)]
16605        self.entity_body.as_ref().and_then(|v| match v {
16606            crate::model::database_entity::EntityBody::Synonym(v) => std::option::Option::Some(v),
16607            _ => std::option::Option::None,
16608        })
16609    }
16610
16611    /// Sets the value of [entity_body][crate::model::DatabaseEntity::entity_body]
16612    /// to hold a `Synonym`.
16613    ///
16614    /// Note that all the setters affecting `entity_body` are
16615    /// mutually exclusive.
16616    ///
16617    /// # Example
16618    /// ```ignore,no_run
16619    /// # use google_cloud_clouddms_v1::model::DatabaseEntity;
16620    /// use google_cloud_clouddms_v1::model::SynonymEntity;
16621    /// let x = DatabaseEntity::new().set_synonym(SynonymEntity::default()/* use setters */);
16622    /// assert!(x.synonym().is_some());
16623    /// assert!(x.database().is_none());
16624    /// assert!(x.schema().is_none());
16625    /// assert!(x.table().is_none());
16626    /// assert!(x.view().is_none());
16627    /// assert!(x.sequence().is_none());
16628    /// assert!(x.stored_procedure().is_none());
16629    /// assert!(x.database_function().is_none());
16630    /// assert!(x.database_package().is_none());
16631    /// assert!(x.udt().is_none());
16632    /// assert!(x.materialized_view().is_none());
16633    /// ```
16634    pub fn set_synonym<T: std::convert::Into<std::boxed::Box<crate::model::SynonymEntity>>>(
16635        mut self,
16636        v: T,
16637    ) -> Self {
16638        self.entity_body =
16639            std::option::Option::Some(crate::model::database_entity::EntityBody::Synonym(v.into()));
16640        self
16641    }
16642
16643    /// The value of [entity_body][crate::model::DatabaseEntity::entity_body]
16644    /// if it holds a `DatabasePackage`, `None` if the field is not set or
16645    /// holds a different branch.
16646    pub fn database_package(
16647        &self,
16648    ) -> std::option::Option<&std::boxed::Box<crate::model::PackageEntity>> {
16649        #[allow(unreachable_patterns)]
16650        self.entity_body.as_ref().and_then(|v| match v {
16651            crate::model::database_entity::EntityBody::DatabasePackage(v) => {
16652                std::option::Option::Some(v)
16653            }
16654            _ => std::option::Option::None,
16655        })
16656    }
16657
16658    /// Sets the value of [entity_body][crate::model::DatabaseEntity::entity_body]
16659    /// to hold a `DatabasePackage`.
16660    ///
16661    /// Note that all the setters affecting `entity_body` are
16662    /// mutually exclusive.
16663    ///
16664    /// # Example
16665    /// ```ignore,no_run
16666    /// # use google_cloud_clouddms_v1::model::DatabaseEntity;
16667    /// use google_cloud_clouddms_v1::model::PackageEntity;
16668    /// let x = DatabaseEntity::new().set_database_package(PackageEntity::default()/* use setters */);
16669    /// assert!(x.database_package().is_some());
16670    /// assert!(x.database().is_none());
16671    /// assert!(x.schema().is_none());
16672    /// assert!(x.table().is_none());
16673    /// assert!(x.view().is_none());
16674    /// assert!(x.sequence().is_none());
16675    /// assert!(x.stored_procedure().is_none());
16676    /// assert!(x.database_function().is_none());
16677    /// assert!(x.synonym().is_none());
16678    /// assert!(x.udt().is_none());
16679    /// assert!(x.materialized_view().is_none());
16680    /// ```
16681    pub fn set_database_package<
16682        T: std::convert::Into<std::boxed::Box<crate::model::PackageEntity>>,
16683    >(
16684        mut self,
16685        v: T,
16686    ) -> Self {
16687        self.entity_body = std::option::Option::Some(
16688            crate::model::database_entity::EntityBody::DatabasePackage(v.into()),
16689        );
16690        self
16691    }
16692
16693    /// The value of [entity_body][crate::model::DatabaseEntity::entity_body]
16694    /// if it holds a `Udt`, `None` if the field is not set or
16695    /// holds a different branch.
16696    pub fn udt(&self) -> std::option::Option<&std::boxed::Box<crate::model::UDTEntity>> {
16697        #[allow(unreachable_patterns)]
16698        self.entity_body.as_ref().and_then(|v| match v {
16699            crate::model::database_entity::EntityBody::Udt(v) => std::option::Option::Some(v),
16700            _ => std::option::Option::None,
16701        })
16702    }
16703
16704    /// Sets the value of [entity_body][crate::model::DatabaseEntity::entity_body]
16705    /// to hold a `Udt`.
16706    ///
16707    /// Note that all the setters affecting `entity_body` are
16708    /// mutually exclusive.
16709    ///
16710    /// # Example
16711    /// ```ignore,no_run
16712    /// # use google_cloud_clouddms_v1::model::DatabaseEntity;
16713    /// use google_cloud_clouddms_v1::model::UDTEntity;
16714    /// let x = DatabaseEntity::new().set_udt(UDTEntity::default()/* use setters */);
16715    /// assert!(x.udt().is_some());
16716    /// assert!(x.database().is_none());
16717    /// assert!(x.schema().is_none());
16718    /// assert!(x.table().is_none());
16719    /// assert!(x.view().is_none());
16720    /// assert!(x.sequence().is_none());
16721    /// assert!(x.stored_procedure().is_none());
16722    /// assert!(x.database_function().is_none());
16723    /// assert!(x.synonym().is_none());
16724    /// assert!(x.database_package().is_none());
16725    /// assert!(x.materialized_view().is_none());
16726    /// ```
16727    pub fn set_udt<T: std::convert::Into<std::boxed::Box<crate::model::UDTEntity>>>(
16728        mut self,
16729        v: T,
16730    ) -> Self {
16731        self.entity_body =
16732            std::option::Option::Some(crate::model::database_entity::EntityBody::Udt(v.into()));
16733        self
16734    }
16735
16736    /// The value of [entity_body][crate::model::DatabaseEntity::entity_body]
16737    /// if it holds a `MaterializedView`, `None` if the field is not set or
16738    /// holds a different branch.
16739    pub fn materialized_view(
16740        &self,
16741    ) -> std::option::Option<&std::boxed::Box<crate::model::MaterializedViewEntity>> {
16742        #[allow(unreachable_patterns)]
16743        self.entity_body.as_ref().and_then(|v| match v {
16744            crate::model::database_entity::EntityBody::MaterializedView(v) => {
16745                std::option::Option::Some(v)
16746            }
16747            _ => std::option::Option::None,
16748        })
16749    }
16750
16751    /// Sets the value of [entity_body][crate::model::DatabaseEntity::entity_body]
16752    /// to hold a `MaterializedView`.
16753    ///
16754    /// Note that all the setters affecting `entity_body` are
16755    /// mutually exclusive.
16756    ///
16757    /// # Example
16758    /// ```ignore,no_run
16759    /// # use google_cloud_clouddms_v1::model::DatabaseEntity;
16760    /// use google_cloud_clouddms_v1::model::MaterializedViewEntity;
16761    /// let x = DatabaseEntity::new().set_materialized_view(MaterializedViewEntity::default()/* use setters */);
16762    /// assert!(x.materialized_view().is_some());
16763    /// assert!(x.database().is_none());
16764    /// assert!(x.schema().is_none());
16765    /// assert!(x.table().is_none());
16766    /// assert!(x.view().is_none());
16767    /// assert!(x.sequence().is_none());
16768    /// assert!(x.stored_procedure().is_none());
16769    /// assert!(x.database_function().is_none());
16770    /// assert!(x.synonym().is_none());
16771    /// assert!(x.database_package().is_none());
16772    /// assert!(x.udt().is_none());
16773    /// ```
16774    pub fn set_materialized_view<
16775        T: std::convert::Into<std::boxed::Box<crate::model::MaterializedViewEntity>>,
16776    >(
16777        mut self,
16778        v: T,
16779    ) -> Self {
16780        self.entity_body = std::option::Option::Some(
16781            crate::model::database_entity::EntityBody::MaterializedView(v.into()),
16782        );
16783        self
16784    }
16785}
16786
16787impl wkt::message::Message for DatabaseEntity {
16788    fn typename() -> &'static str {
16789        "type.googleapis.com/google.cloud.clouddms.v1.DatabaseEntity"
16790    }
16791}
16792
16793/// Defines additional types related to [DatabaseEntity].
16794pub mod database_entity {
16795    #[allow(unused_imports)]
16796    use super::*;
16797
16798    /// The type of database entities tree.
16799    ///
16800    /// # Working with unknown values
16801    ///
16802    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16803    /// additional enum variants at any time. Adding new variants is not considered
16804    /// a breaking change. Applications should write their code in anticipation of:
16805    ///
16806    /// - New values appearing in future releases of the client library, **and**
16807    /// - New values received dynamically, without application changes.
16808    ///
16809    /// Please consult the [Working with enums] section in the user guide for some
16810    /// guidelines.
16811    ///
16812    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16813    #[derive(Clone, Debug, PartialEq)]
16814    #[non_exhaustive]
16815    pub enum TreeType {
16816        /// Tree type unspecified.
16817        Unspecified,
16818        /// Tree of entities loaded from a source database.
16819        Source,
16820        /// Tree of entities converted from the source tree using the mapping rules.
16821        Draft,
16822        /// Tree of entities observed on the destination database.
16823        Destination,
16824        /// If set, the enum was initialized with an unknown value.
16825        ///
16826        /// Applications can examine the value using [TreeType::value] or
16827        /// [TreeType::name].
16828        UnknownValue(tree_type::UnknownValue),
16829    }
16830
16831    #[doc(hidden)]
16832    pub mod tree_type {
16833        #[allow(unused_imports)]
16834        use super::*;
16835        #[derive(Clone, Debug, PartialEq)]
16836        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16837    }
16838
16839    impl TreeType {
16840        /// Gets the enum value.
16841        ///
16842        /// Returns `None` if the enum contains an unknown value deserialized from
16843        /// the string representation of enums.
16844        pub fn value(&self) -> std::option::Option<i32> {
16845            match self {
16846                Self::Unspecified => std::option::Option::Some(0),
16847                Self::Source => std::option::Option::Some(1),
16848                Self::Draft => std::option::Option::Some(2),
16849                Self::Destination => std::option::Option::Some(3),
16850                Self::UnknownValue(u) => u.0.value(),
16851            }
16852        }
16853
16854        /// Gets the enum value as a string.
16855        ///
16856        /// Returns `None` if the enum contains an unknown value deserialized from
16857        /// the integer representation of enums.
16858        pub fn name(&self) -> std::option::Option<&str> {
16859            match self {
16860                Self::Unspecified => std::option::Option::Some("TREE_TYPE_UNSPECIFIED"),
16861                Self::Source => std::option::Option::Some("SOURCE"),
16862                Self::Draft => std::option::Option::Some("DRAFT"),
16863                Self::Destination => std::option::Option::Some("DESTINATION"),
16864                Self::UnknownValue(u) => u.0.name(),
16865            }
16866        }
16867    }
16868
16869    impl std::default::Default for TreeType {
16870        fn default() -> Self {
16871            use std::convert::From;
16872            Self::from(0)
16873        }
16874    }
16875
16876    impl std::fmt::Display for TreeType {
16877        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16878            wkt::internal::display_enum(f, self.name(), self.value())
16879        }
16880    }
16881
16882    impl std::convert::From<i32> for TreeType {
16883        fn from(value: i32) -> Self {
16884            match value {
16885                0 => Self::Unspecified,
16886                1 => Self::Source,
16887                2 => Self::Draft,
16888                3 => Self::Destination,
16889                _ => Self::UnknownValue(tree_type::UnknownValue(
16890                    wkt::internal::UnknownEnumValue::Integer(value),
16891                )),
16892            }
16893        }
16894    }
16895
16896    impl std::convert::From<&str> for TreeType {
16897        fn from(value: &str) -> Self {
16898            use std::string::ToString;
16899            match value {
16900                "TREE_TYPE_UNSPECIFIED" => Self::Unspecified,
16901                "SOURCE" => Self::Source,
16902                "DRAFT" => Self::Draft,
16903                "DESTINATION" => Self::Destination,
16904                _ => Self::UnknownValue(tree_type::UnknownValue(
16905                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16906                )),
16907            }
16908        }
16909    }
16910
16911    impl serde::ser::Serialize for TreeType {
16912        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16913        where
16914            S: serde::Serializer,
16915        {
16916            match self {
16917                Self::Unspecified => serializer.serialize_i32(0),
16918                Self::Source => serializer.serialize_i32(1),
16919                Self::Draft => serializer.serialize_i32(2),
16920                Self::Destination => serializer.serialize_i32(3),
16921                Self::UnknownValue(u) => u.0.serialize(serializer),
16922            }
16923        }
16924    }
16925
16926    impl<'de> serde::de::Deserialize<'de> for TreeType {
16927        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16928        where
16929            D: serde::Deserializer<'de>,
16930        {
16931            deserializer.deserialize_any(wkt::internal::EnumVisitor::<TreeType>::new(
16932                ".google.cloud.clouddms.v1.DatabaseEntity.TreeType",
16933            ))
16934        }
16935    }
16936
16937    /// The specific body for each entity type.
16938    #[derive(Clone, Debug, PartialEq)]
16939    #[non_exhaustive]
16940    pub enum EntityBody {
16941        /// Database.
16942        Database(std::boxed::Box<crate::model::DatabaseInstanceEntity>),
16943        /// Schema.
16944        Schema(std::boxed::Box<crate::model::SchemaEntity>),
16945        /// Table.
16946        Table(std::boxed::Box<crate::model::TableEntity>),
16947        /// View.
16948        View(std::boxed::Box<crate::model::ViewEntity>),
16949        /// Sequence.
16950        Sequence(std::boxed::Box<crate::model::SequenceEntity>),
16951        /// Stored procedure.
16952        StoredProcedure(std::boxed::Box<crate::model::StoredProcedureEntity>),
16953        /// Function.
16954        DatabaseFunction(std::boxed::Box<crate::model::FunctionEntity>),
16955        /// Synonym.
16956        Synonym(std::boxed::Box<crate::model::SynonymEntity>),
16957        /// Package.
16958        DatabasePackage(std::boxed::Box<crate::model::PackageEntity>),
16959        /// UDT.
16960        Udt(std::boxed::Box<crate::model::UDTEntity>),
16961        /// Materialized view.
16962        MaterializedView(std::boxed::Box<crate::model::MaterializedViewEntity>),
16963    }
16964}
16965
16966/// DatabaseInstance acts as a parent entity to other database entities.
16967#[derive(Clone, Default, PartialEq)]
16968#[non_exhaustive]
16969pub struct DatabaseInstanceEntity {
16970    /// Custom engine specific features.
16971    pub custom_features: std::option::Option<wkt::Struct>,
16972
16973    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16974}
16975
16976impl DatabaseInstanceEntity {
16977    pub fn new() -> Self {
16978        std::default::Default::default()
16979    }
16980
16981    /// Sets the value of [custom_features][crate::model::DatabaseInstanceEntity::custom_features].
16982    ///
16983    /// # Example
16984    /// ```ignore,no_run
16985    /// # use google_cloud_clouddms_v1::model::DatabaseInstanceEntity;
16986    /// use wkt::Struct;
16987    /// let x = DatabaseInstanceEntity::new().set_custom_features(Struct::default()/* use setters */);
16988    /// ```
16989    pub fn set_custom_features<T>(mut self, v: T) -> Self
16990    where
16991        T: std::convert::Into<wkt::Struct>,
16992    {
16993        self.custom_features = std::option::Option::Some(v.into());
16994        self
16995    }
16996
16997    /// Sets or clears the value of [custom_features][crate::model::DatabaseInstanceEntity::custom_features].
16998    ///
16999    /// # Example
17000    /// ```ignore,no_run
17001    /// # use google_cloud_clouddms_v1::model::DatabaseInstanceEntity;
17002    /// use wkt::Struct;
17003    /// let x = DatabaseInstanceEntity::new().set_or_clear_custom_features(Some(Struct::default()/* use setters */));
17004    /// let x = DatabaseInstanceEntity::new().set_or_clear_custom_features(None::<Struct>);
17005    /// ```
17006    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
17007    where
17008        T: std::convert::Into<wkt::Struct>,
17009    {
17010        self.custom_features = v.map(|x| x.into());
17011        self
17012    }
17013}
17014
17015impl wkt::message::Message for DatabaseInstanceEntity {
17016    fn typename() -> &'static str {
17017        "type.googleapis.com/google.cloud.clouddms.v1.DatabaseInstanceEntity"
17018    }
17019}
17020
17021/// Schema typically has no parent entity, but can have a parent entity
17022/// DatabaseInstance (for database engines which support it).  For some database
17023/// engines, the terms  schema and user can be used interchangeably when they
17024/// refer to a namespace or a collection of other database entities. Can store
17025/// additional information which is schema specific.
17026#[derive(Clone, Default, PartialEq)]
17027#[non_exhaustive]
17028pub struct SchemaEntity {
17029    /// Custom engine specific features.
17030    pub custom_features: std::option::Option<wkt::Struct>,
17031
17032    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17033}
17034
17035impl SchemaEntity {
17036    pub fn new() -> Self {
17037        std::default::Default::default()
17038    }
17039
17040    /// Sets the value of [custom_features][crate::model::SchemaEntity::custom_features].
17041    ///
17042    /// # Example
17043    /// ```ignore,no_run
17044    /// # use google_cloud_clouddms_v1::model::SchemaEntity;
17045    /// use wkt::Struct;
17046    /// let x = SchemaEntity::new().set_custom_features(Struct::default()/* use setters */);
17047    /// ```
17048    pub fn set_custom_features<T>(mut self, v: T) -> Self
17049    where
17050        T: std::convert::Into<wkt::Struct>,
17051    {
17052        self.custom_features = std::option::Option::Some(v.into());
17053        self
17054    }
17055
17056    /// Sets or clears the value of [custom_features][crate::model::SchemaEntity::custom_features].
17057    ///
17058    /// # Example
17059    /// ```ignore,no_run
17060    /// # use google_cloud_clouddms_v1::model::SchemaEntity;
17061    /// use wkt::Struct;
17062    /// let x = SchemaEntity::new().set_or_clear_custom_features(Some(Struct::default()/* use setters */));
17063    /// let x = SchemaEntity::new().set_or_clear_custom_features(None::<Struct>);
17064    /// ```
17065    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
17066    where
17067        T: std::convert::Into<wkt::Struct>,
17068    {
17069        self.custom_features = v.map(|x| x.into());
17070        self
17071    }
17072}
17073
17074impl wkt::message::Message for SchemaEntity {
17075    fn typename() -> &'static str {
17076        "type.googleapis.com/google.cloud.clouddms.v1.SchemaEntity"
17077    }
17078}
17079
17080/// Table's parent is a schema.
17081#[derive(Clone, Default, PartialEq)]
17082#[non_exhaustive]
17083pub struct TableEntity {
17084    /// Table columns.
17085    pub columns: std::vec::Vec<crate::model::ColumnEntity>,
17086
17087    /// Table constraints.
17088    pub constraints: std::vec::Vec<crate::model::ConstraintEntity>,
17089
17090    /// Table indices.
17091    pub indices: std::vec::Vec<crate::model::IndexEntity>,
17092
17093    /// Table triggers.
17094    pub triggers: std::vec::Vec<crate::model::TriggerEntity>,
17095
17096    /// Custom engine specific features.
17097    pub custom_features: std::option::Option<wkt::Struct>,
17098
17099    /// Comment associated with the table.
17100    pub comment: std::string::String,
17101
17102    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17103}
17104
17105impl TableEntity {
17106    pub fn new() -> Self {
17107        std::default::Default::default()
17108    }
17109
17110    /// Sets the value of [columns][crate::model::TableEntity::columns].
17111    ///
17112    /// # Example
17113    /// ```ignore,no_run
17114    /// # use google_cloud_clouddms_v1::model::TableEntity;
17115    /// use google_cloud_clouddms_v1::model::ColumnEntity;
17116    /// let x = TableEntity::new()
17117    ///     .set_columns([
17118    ///         ColumnEntity::default()/* use setters */,
17119    ///         ColumnEntity::default()/* use (different) setters */,
17120    ///     ]);
17121    /// ```
17122    pub fn set_columns<T, V>(mut self, v: T) -> Self
17123    where
17124        T: std::iter::IntoIterator<Item = V>,
17125        V: std::convert::Into<crate::model::ColumnEntity>,
17126    {
17127        use std::iter::Iterator;
17128        self.columns = v.into_iter().map(|i| i.into()).collect();
17129        self
17130    }
17131
17132    /// Sets the value of [constraints][crate::model::TableEntity::constraints].
17133    ///
17134    /// # Example
17135    /// ```ignore,no_run
17136    /// # use google_cloud_clouddms_v1::model::TableEntity;
17137    /// use google_cloud_clouddms_v1::model::ConstraintEntity;
17138    /// let x = TableEntity::new()
17139    ///     .set_constraints([
17140    ///         ConstraintEntity::default()/* use setters */,
17141    ///         ConstraintEntity::default()/* use (different) setters */,
17142    ///     ]);
17143    /// ```
17144    pub fn set_constraints<T, V>(mut self, v: T) -> Self
17145    where
17146        T: std::iter::IntoIterator<Item = V>,
17147        V: std::convert::Into<crate::model::ConstraintEntity>,
17148    {
17149        use std::iter::Iterator;
17150        self.constraints = v.into_iter().map(|i| i.into()).collect();
17151        self
17152    }
17153
17154    /// Sets the value of [indices][crate::model::TableEntity::indices].
17155    ///
17156    /// # Example
17157    /// ```ignore,no_run
17158    /// # use google_cloud_clouddms_v1::model::TableEntity;
17159    /// use google_cloud_clouddms_v1::model::IndexEntity;
17160    /// let x = TableEntity::new()
17161    ///     .set_indices([
17162    ///         IndexEntity::default()/* use setters */,
17163    ///         IndexEntity::default()/* use (different) setters */,
17164    ///     ]);
17165    /// ```
17166    pub fn set_indices<T, V>(mut self, v: T) -> Self
17167    where
17168        T: std::iter::IntoIterator<Item = V>,
17169        V: std::convert::Into<crate::model::IndexEntity>,
17170    {
17171        use std::iter::Iterator;
17172        self.indices = v.into_iter().map(|i| i.into()).collect();
17173        self
17174    }
17175
17176    /// Sets the value of [triggers][crate::model::TableEntity::triggers].
17177    ///
17178    /// # Example
17179    /// ```ignore,no_run
17180    /// # use google_cloud_clouddms_v1::model::TableEntity;
17181    /// use google_cloud_clouddms_v1::model::TriggerEntity;
17182    /// let x = TableEntity::new()
17183    ///     .set_triggers([
17184    ///         TriggerEntity::default()/* use setters */,
17185    ///         TriggerEntity::default()/* use (different) setters */,
17186    ///     ]);
17187    /// ```
17188    pub fn set_triggers<T, V>(mut self, v: T) -> Self
17189    where
17190        T: std::iter::IntoIterator<Item = V>,
17191        V: std::convert::Into<crate::model::TriggerEntity>,
17192    {
17193        use std::iter::Iterator;
17194        self.triggers = v.into_iter().map(|i| i.into()).collect();
17195        self
17196    }
17197
17198    /// Sets the value of [custom_features][crate::model::TableEntity::custom_features].
17199    ///
17200    /// # Example
17201    /// ```ignore,no_run
17202    /// # use google_cloud_clouddms_v1::model::TableEntity;
17203    /// use wkt::Struct;
17204    /// let x = TableEntity::new().set_custom_features(Struct::default()/* use setters */);
17205    /// ```
17206    pub fn set_custom_features<T>(mut self, v: T) -> Self
17207    where
17208        T: std::convert::Into<wkt::Struct>,
17209    {
17210        self.custom_features = std::option::Option::Some(v.into());
17211        self
17212    }
17213
17214    /// Sets or clears the value of [custom_features][crate::model::TableEntity::custom_features].
17215    ///
17216    /// # Example
17217    /// ```ignore,no_run
17218    /// # use google_cloud_clouddms_v1::model::TableEntity;
17219    /// use wkt::Struct;
17220    /// let x = TableEntity::new().set_or_clear_custom_features(Some(Struct::default()/* use setters */));
17221    /// let x = TableEntity::new().set_or_clear_custom_features(None::<Struct>);
17222    /// ```
17223    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
17224    where
17225        T: std::convert::Into<wkt::Struct>,
17226    {
17227        self.custom_features = v.map(|x| x.into());
17228        self
17229    }
17230
17231    /// Sets the value of [comment][crate::model::TableEntity::comment].
17232    ///
17233    /// # Example
17234    /// ```ignore,no_run
17235    /// # use google_cloud_clouddms_v1::model::TableEntity;
17236    /// let x = TableEntity::new().set_comment("example");
17237    /// ```
17238    pub fn set_comment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17239        self.comment = v.into();
17240        self
17241    }
17242}
17243
17244impl wkt::message::Message for TableEntity {
17245    fn typename() -> &'static str {
17246        "type.googleapis.com/google.cloud.clouddms.v1.TableEntity"
17247    }
17248}
17249
17250/// Column is not used as an independent entity, it is retrieved as part of a
17251/// Table entity.
17252#[derive(Clone, Default, PartialEq)]
17253#[non_exhaustive]
17254pub struct ColumnEntity {
17255    /// Column name.
17256    pub name: std::string::String,
17257
17258    /// Column data type.
17259    pub data_type: std::string::String,
17260
17261    /// Charset override - instead of table level charset.
17262    pub charset: std::string::String,
17263
17264    /// Collation override - instead of table level collation.
17265    pub collation: std::string::String,
17266
17267    /// Column length - e.g. varchar (50).
17268    pub length: i64,
17269
17270    /// Column precision - when relevant.
17271    pub precision: i32,
17272
17273    /// Column scale - when relevant.
17274    pub scale: i32,
17275
17276    /// Column fractional second precision - used for timestamp based datatypes.
17277    pub fractional_seconds_precision: i32,
17278
17279    /// Is the column of array type.
17280    pub array: bool,
17281
17282    /// If the column is array, of which length.
17283    pub array_length: i32,
17284
17285    /// Is the column nullable.
17286    pub nullable: bool,
17287
17288    /// Is the column auto-generated/identity.
17289    pub auto_generated: bool,
17290
17291    /// Is the column a UDT.
17292    pub udt: bool,
17293
17294    /// Custom engine specific features.
17295    pub custom_features: std::option::Option<wkt::Struct>,
17296
17297    /// Specifies the list of values allowed in the column.
17298    /// Only used for set data type.
17299    pub set_values: std::vec::Vec<std::string::String>,
17300
17301    /// Comment associated with the column.
17302    pub comment: std::string::String,
17303
17304    /// Column order in the table.
17305    pub ordinal_position: i32,
17306
17307    /// Default value of the column.
17308    pub default_value: std::string::String,
17309
17310    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17311}
17312
17313impl ColumnEntity {
17314    pub fn new() -> Self {
17315        std::default::Default::default()
17316    }
17317
17318    /// Sets the value of [name][crate::model::ColumnEntity::name].
17319    ///
17320    /// # Example
17321    /// ```ignore,no_run
17322    /// # use google_cloud_clouddms_v1::model::ColumnEntity;
17323    /// let x = ColumnEntity::new().set_name("example");
17324    /// ```
17325    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17326        self.name = v.into();
17327        self
17328    }
17329
17330    /// Sets the value of [data_type][crate::model::ColumnEntity::data_type].
17331    ///
17332    /// # Example
17333    /// ```ignore,no_run
17334    /// # use google_cloud_clouddms_v1::model::ColumnEntity;
17335    /// let x = ColumnEntity::new().set_data_type("example");
17336    /// ```
17337    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17338        self.data_type = v.into();
17339        self
17340    }
17341
17342    /// Sets the value of [charset][crate::model::ColumnEntity::charset].
17343    ///
17344    /// # Example
17345    /// ```ignore,no_run
17346    /// # use google_cloud_clouddms_v1::model::ColumnEntity;
17347    /// let x = ColumnEntity::new().set_charset("example");
17348    /// ```
17349    pub fn set_charset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17350        self.charset = v.into();
17351        self
17352    }
17353
17354    /// Sets the value of [collation][crate::model::ColumnEntity::collation].
17355    ///
17356    /// # Example
17357    /// ```ignore,no_run
17358    /// # use google_cloud_clouddms_v1::model::ColumnEntity;
17359    /// let x = ColumnEntity::new().set_collation("example");
17360    /// ```
17361    pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17362        self.collation = v.into();
17363        self
17364    }
17365
17366    /// Sets the value of [length][crate::model::ColumnEntity::length].
17367    ///
17368    /// # Example
17369    /// ```ignore,no_run
17370    /// # use google_cloud_clouddms_v1::model::ColumnEntity;
17371    /// let x = ColumnEntity::new().set_length(42);
17372    /// ```
17373    pub fn set_length<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
17374        self.length = v.into();
17375        self
17376    }
17377
17378    /// Sets the value of [precision][crate::model::ColumnEntity::precision].
17379    ///
17380    /// # Example
17381    /// ```ignore,no_run
17382    /// # use google_cloud_clouddms_v1::model::ColumnEntity;
17383    /// let x = ColumnEntity::new().set_precision(42);
17384    /// ```
17385    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17386        self.precision = v.into();
17387        self
17388    }
17389
17390    /// Sets the value of [scale][crate::model::ColumnEntity::scale].
17391    ///
17392    /// # Example
17393    /// ```ignore,no_run
17394    /// # use google_cloud_clouddms_v1::model::ColumnEntity;
17395    /// let x = ColumnEntity::new().set_scale(42);
17396    /// ```
17397    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17398        self.scale = v.into();
17399        self
17400    }
17401
17402    /// Sets the value of [fractional_seconds_precision][crate::model::ColumnEntity::fractional_seconds_precision].
17403    ///
17404    /// # Example
17405    /// ```ignore,no_run
17406    /// # use google_cloud_clouddms_v1::model::ColumnEntity;
17407    /// let x = ColumnEntity::new().set_fractional_seconds_precision(42);
17408    /// ```
17409    pub fn set_fractional_seconds_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17410        self.fractional_seconds_precision = v.into();
17411        self
17412    }
17413
17414    /// Sets the value of [array][crate::model::ColumnEntity::array].
17415    ///
17416    /// # Example
17417    /// ```ignore,no_run
17418    /// # use google_cloud_clouddms_v1::model::ColumnEntity;
17419    /// let x = ColumnEntity::new().set_array(true);
17420    /// ```
17421    pub fn set_array<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
17422        self.array = v.into();
17423        self
17424    }
17425
17426    /// Sets the value of [array_length][crate::model::ColumnEntity::array_length].
17427    ///
17428    /// # Example
17429    /// ```ignore,no_run
17430    /// # use google_cloud_clouddms_v1::model::ColumnEntity;
17431    /// let x = ColumnEntity::new().set_array_length(42);
17432    /// ```
17433    pub fn set_array_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17434        self.array_length = v.into();
17435        self
17436    }
17437
17438    /// Sets the value of [nullable][crate::model::ColumnEntity::nullable].
17439    ///
17440    /// # Example
17441    /// ```ignore,no_run
17442    /// # use google_cloud_clouddms_v1::model::ColumnEntity;
17443    /// let x = ColumnEntity::new().set_nullable(true);
17444    /// ```
17445    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
17446        self.nullable = v.into();
17447        self
17448    }
17449
17450    /// Sets the value of [auto_generated][crate::model::ColumnEntity::auto_generated].
17451    ///
17452    /// # Example
17453    /// ```ignore,no_run
17454    /// # use google_cloud_clouddms_v1::model::ColumnEntity;
17455    /// let x = ColumnEntity::new().set_auto_generated(true);
17456    /// ```
17457    pub fn set_auto_generated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
17458        self.auto_generated = v.into();
17459        self
17460    }
17461
17462    /// Sets the value of [udt][crate::model::ColumnEntity::udt].
17463    ///
17464    /// # Example
17465    /// ```ignore,no_run
17466    /// # use google_cloud_clouddms_v1::model::ColumnEntity;
17467    /// let x = ColumnEntity::new().set_udt(true);
17468    /// ```
17469    pub fn set_udt<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
17470        self.udt = v.into();
17471        self
17472    }
17473
17474    /// Sets the value of [custom_features][crate::model::ColumnEntity::custom_features].
17475    ///
17476    /// # Example
17477    /// ```ignore,no_run
17478    /// # use google_cloud_clouddms_v1::model::ColumnEntity;
17479    /// use wkt::Struct;
17480    /// let x = ColumnEntity::new().set_custom_features(Struct::default()/* use setters */);
17481    /// ```
17482    pub fn set_custom_features<T>(mut self, v: T) -> Self
17483    where
17484        T: std::convert::Into<wkt::Struct>,
17485    {
17486        self.custom_features = std::option::Option::Some(v.into());
17487        self
17488    }
17489
17490    /// Sets or clears the value of [custom_features][crate::model::ColumnEntity::custom_features].
17491    ///
17492    /// # Example
17493    /// ```ignore,no_run
17494    /// # use google_cloud_clouddms_v1::model::ColumnEntity;
17495    /// use wkt::Struct;
17496    /// let x = ColumnEntity::new().set_or_clear_custom_features(Some(Struct::default()/* use setters */));
17497    /// let x = ColumnEntity::new().set_or_clear_custom_features(None::<Struct>);
17498    /// ```
17499    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
17500    where
17501        T: std::convert::Into<wkt::Struct>,
17502    {
17503        self.custom_features = v.map(|x| x.into());
17504        self
17505    }
17506
17507    /// Sets the value of [set_values][crate::model::ColumnEntity::set_values].
17508    ///
17509    /// # Example
17510    /// ```ignore,no_run
17511    /// # use google_cloud_clouddms_v1::model::ColumnEntity;
17512    /// let x = ColumnEntity::new().set_set_values(["a", "b", "c"]);
17513    /// ```
17514    pub fn set_set_values<T, V>(mut self, v: T) -> Self
17515    where
17516        T: std::iter::IntoIterator<Item = V>,
17517        V: std::convert::Into<std::string::String>,
17518    {
17519        use std::iter::Iterator;
17520        self.set_values = v.into_iter().map(|i| i.into()).collect();
17521        self
17522    }
17523
17524    /// Sets the value of [comment][crate::model::ColumnEntity::comment].
17525    ///
17526    /// # Example
17527    /// ```ignore,no_run
17528    /// # use google_cloud_clouddms_v1::model::ColumnEntity;
17529    /// let x = ColumnEntity::new().set_comment("example");
17530    /// ```
17531    pub fn set_comment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17532        self.comment = v.into();
17533        self
17534    }
17535
17536    /// Sets the value of [ordinal_position][crate::model::ColumnEntity::ordinal_position].
17537    ///
17538    /// # Example
17539    /// ```ignore,no_run
17540    /// # use google_cloud_clouddms_v1::model::ColumnEntity;
17541    /// let x = ColumnEntity::new().set_ordinal_position(42);
17542    /// ```
17543    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17544        self.ordinal_position = v.into();
17545        self
17546    }
17547
17548    /// Sets the value of [default_value][crate::model::ColumnEntity::default_value].
17549    ///
17550    /// # Example
17551    /// ```ignore,no_run
17552    /// # use google_cloud_clouddms_v1::model::ColumnEntity;
17553    /// let x = ColumnEntity::new().set_default_value("example");
17554    /// ```
17555    pub fn set_default_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17556        self.default_value = v.into();
17557        self
17558    }
17559}
17560
17561impl wkt::message::Message for ColumnEntity {
17562    fn typename() -> &'static str {
17563        "type.googleapis.com/google.cloud.clouddms.v1.ColumnEntity"
17564    }
17565}
17566
17567/// Constraint is not used as an independent entity, it is retrieved
17568/// as part of another entity such as Table or View.
17569#[derive(Clone, Default, PartialEq)]
17570#[non_exhaustive]
17571pub struct ConstraintEntity {
17572    /// The name of the table constraint.
17573    pub name: std::string::String,
17574
17575    /// Type of constraint, for example unique, primary key, foreign key (currently
17576    /// only primary key is supported).
17577    pub r#type: std::string::String,
17578
17579    /// Table columns used as part of the Constraint, for example primary key
17580    /// constraint should list the columns which constitutes the key.
17581    pub table_columns: std::vec::Vec<std::string::String>,
17582
17583    /// Custom engine specific features.
17584    pub custom_features: std::option::Option<wkt::Struct>,
17585
17586    /// Reference columns which may be associated with the constraint. For example,
17587    /// if the constraint is a FOREIGN_KEY, this represents the list of full names
17588    /// of referenced columns by the foreign key.
17589    pub reference_columns: std::vec::Vec<std::string::String>,
17590
17591    /// Reference table which may be associated with the constraint. For example,
17592    /// if the constraint is a FOREIGN_KEY, this represents the list of full name
17593    /// of the referenced table by the foreign key.
17594    pub reference_table: std::string::String,
17595
17596    /// Table which is associated with the constraint. In case the constraint
17597    /// is defined on a table, this field is left empty as this information is
17598    /// stored in parent_name. However, if constraint is defined on a view, this
17599    /// field stores the table name on which the view is defined.
17600    pub table_name: std::string::String,
17601
17602    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17603}
17604
17605impl ConstraintEntity {
17606    pub fn new() -> Self {
17607        std::default::Default::default()
17608    }
17609
17610    /// Sets the value of [name][crate::model::ConstraintEntity::name].
17611    ///
17612    /// # Example
17613    /// ```ignore,no_run
17614    /// # use google_cloud_clouddms_v1::model::ConstraintEntity;
17615    /// let x = ConstraintEntity::new().set_name("example");
17616    /// ```
17617    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17618        self.name = v.into();
17619        self
17620    }
17621
17622    /// Sets the value of [r#type][crate::model::ConstraintEntity::type].
17623    ///
17624    /// # Example
17625    /// ```ignore,no_run
17626    /// # use google_cloud_clouddms_v1::model::ConstraintEntity;
17627    /// let x = ConstraintEntity::new().set_type("example");
17628    /// ```
17629    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17630        self.r#type = v.into();
17631        self
17632    }
17633
17634    /// Sets the value of [table_columns][crate::model::ConstraintEntity::table_columns].
17635    ///
17636    /// # Example
17637    /// ```ignore,no_run
17638    /// # use google_cloud_clouddms_v1::model::ConstraintEntity;
17639    /// let x = ConstraintEntity::new().set_table_columns(["a", "b", "c"]);
17640    /// ```
17641    pub fn set_table_columns<T, V>(mut self, v: T) -> Self
17642    where
17643        T: std::iter::IntoIterator<Item = V>,
17644        V: std::convert::Into<std::string::String>,
17645    {
17646        use std::iter::Iterator;
17647        self.table_columns = v.into_iter().map(|i| i.into()).collect();
17648        self
17649    }
17650
17651    /// Sets the value of [custom_features][crate::model::ConstraintEntity::custom_features].
17652    ///
17653    /// # Example
17654    /// ```ignore,no_run
17655    /// # use google_cloud_clouddms_v1::model::ConstraintEntity;
17656    /// use wkt::Struct;
17657    /// let x = ConstraintEntity::new().set_custom_features(Struct::default()/* use setters */);
17658    /// ```
17659    pub fn set_custom_features<T>(mut self, v: T) -> Self
17660    where
17661        T: std::convert::Into<wkt::Struct>,
17662    {
17663        self.custom_features = std::option::Option::Some(v.into());
17664        self
17665    }
17666
17667    /// Sets or clears the value of [custom_features][crate::model::ConstraintEntity::custom_features].
17668    ///
17669    /// # Example
17670    /// ```ignore,no_run
17671    /// # use google_cloud_clouddms_v1::model::ConstraintEntity;
17672    /// use wkt::Struct;
17673    /// let x = ConstraintEntity::new().set_or_clear_custom_features(Some(Struct::default()/* use setters */));
17674    /// let x = ConstraintEntity::new().set_or_clear_custom_features(None::<Struct>);
17675    /// ```
17676    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
17677    where
17678        T: std::convert::Into<wkt::Struct>,
17679    {
17680        self.custom_features = v.map(|x| x.into());
17681        self
17682    }
17683
17684    /// Sets the value of [reference_columns][crate::model::ConstraintEntity::reference_columns].
17685    ///
17686    /// # Example
17687    /// ```ignore,no_run
17688    /// # use google_cloud_clouddms_v1::model::ConstraintEntity;
17689    /// let x = ConstraintEntity::new().set_reference_columns(["a", "b", "c"]);
17690    /// ```
17691    pub fn set_reference_columns<T, V>(mut self, v: T) -> Self
17692    where
17693        T: std::iter::IntoIterator<Item = V>,
17694        V: std::convert::Into<std::string::String>,
17695    {
17696        use std::iter::Iterator;
17697        self.reference_columns = v.into_iter().map(|i| i.into()).collect();
17698        self
17699    }
17700
17701    /// Sets the value of [reference_table][crate::model::ConstraintEntity::reference_table].
17702    ///
17703    /// # Example
17704    /// ```ignore,no_run
17705    /// # use google_cloud_clouddms_v1::model::ConstraintEntity;
17706    /// let x = ConstraintEntity::new().set_reference_table("example");
17707    /// ```
17708    pub fn set_reference_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17709        self.reference_table = v.into();
17710        self
17711    }
17712
17713    /// Sets the value of [table_name][crate::model::ConstraintEntity::table_name].
17714    ///
17715    /// # Example
17716    /// ```ignore,no_run
17717    /// # use google_cloud_clouddms_v1::model::ConstraintEntity;
17718    /// let x = ConstraintEntity::new().set_table_name("example");
17719    /// ```
17720    pub fn set_table_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17721        self.table_name = v.into();
17722        self
17723    }
17724}
17725
17726impl wkt::message::Message for ConstraintEntity {
17727    fn typename() -> &'static str {
17728        "type.googleapis.com/google.cloud.clouddms.v1.ConstraintEntity"
17729    }
17730}
17731
17732/// Index is not used as an independent entity, it is retrieved as part of a
17733/// Table entity.
17734#[derive(Clone, Default, PartialEq)]
17735#[non_exhaustive]
17736pub struct IndexEntity {
17737    /// The name of the index.
17738    pub name: std::string::String,
17739
17740    /// Type of index, for example B-TREE.
17741    pub r#type: std::string::String,
17742
17743    /// Table columns used as part of the Index, for example B-TREE index should
17744    /// list the columns which constitutes the index.
17745    pub table_columns: std::vec::Vec<std::string::String>,
17746
17747    /// Boolean value indicating whether the index is unique.
17748    pub unique: bool,
17749
17750    /// Custom engine specific features.
17751    pub custom_features: std::option::Option<wkt::Struct>,
17752
17753    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17754}
17755
17756impl IndexEntity {
17757    pub fn new() -> Self {
17758        std::default::Default::default()
17759    }
17760
17761    /// Sets the value of [name][crate::model::IndexEntity::name].
17762    ///
17763    /// # Example
17764    /// ```ignore,no_run
17765    /// # use google_cloud_clouddms_v1::model::IndexEntity;
17766    /// let x = IndexEntity::new().set_name("example");
17767    /// ```
17768    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17769        self.name = v.into();
17770        self
17771    }
17772
17773    /// Sets the value of [r#type][crate::model::IndexEntity::type].
17774    ///
17775    /// # Example
17776    /// ```ignore,no_run
17777    /// # use google_cloud_clouddms_v1::model::IndexEntity;
17778    /// let x = IndexEntity::new().set_type("example");
17779    /// ```
17780    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17781        self.r#type = v.into();
17782        self
17783    }
17784
17785    /// Sets the value of [table_columns][crate::model::IndexEntity::table_columns].
17786    ///
17787    /// # Example
17788    /// ```ignore,no_run
17789    /// # use google_cloud_clouddms_v1::model::IndexEntity;
17790    /// let x = IndexEntity::new().set_table_columns(["a", "b", "c"]);
17791    /// ```
17792    pub fn set_table_columns<T, V>(mut self, v: T) -> Self
17793    where
17794        T: std::iter::IntoIterator<Item = V>,
17795        V: std::convert::Into<std::string::String>,
17796    {
17797        use std::iter::Iterator;
17798        self.table_columns = v.into_iter().map(|i| i.into()).collect();
17799        self
17800    }
17801
17802    /// Sets the value of [unique][crate::model::IndexEntity::unique].
17803    ///
17804    /// # Example
17805    /// ```ignore,no_run
17806    /// # use google_cloud_clouddms_v1::model::IndexEntity;
17807    /// let x = IndexEntity::new().set_unique(true);
17808    /// ```
17809    pub fn set_unique<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
17810        self.unique = v.into();
17811        self
17812    }
17813
17814    /// Sets the value of [custom_features][crate::model::IndexEntity::custom_features].
17815    ///
17816    /// # Example
17817    /// ```ignore,no_run
17818    /// # use google_cloud_clouddms_v1::model::IndexEntity;
17819    /// use wkt::Struct;
17820    /// let x = IndexEntity::new().set_custom_features(Struct::default()/* use setters */);
17821    /// ```
17822    pub fn set_custom_features<T>(mut self, v: T) -> Self
17823    where
17824        T: std::convert::Into<wkt::Struct>,
17825    {
17826        self.custom_features = std::option::Option::Some(v.into());
17827        self
17828    }
17829
17830    /// Sets or clears the value of [custom_features][crate::model::IndexEntity::custom_features].
17831    ///
17832    /// # Example
17833    /// ```ignore,no_run
17834    /// # use google_cloud_clouddms_v1::model::IndexEntity;
17835    /// use wkt::Struct;
17836    /// let x = IndexEntity::new().set_or_clear_custom_features(Some(Struct::default()/* use setters */));
17837    /// let x = IndexEntity::new().set_or_clear_custom_features(None::<Struct>);
17838    /// ```
17839    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
17840    where
17841        T: std::convert::Into<wkt::Struct>,
17842    {
17843        self.custom_features = v.map(|x| x.into());
17844        self
17845    }
17846}
17847
17848impl wkt::message::Message for IndexEntity {
17849    fn typename() -> &'static str {
17850        "type.googleapis.com/google.cloud.clouddms.v1.IndexEntity"
17851    }
17852}
17853
17854/// Trigger is not used as an independent entity, it is retrieved as part of a
17855/// Table entity.
17856#[derive(Clone, Default, PartialEq)]
17857#[non_exhaustive]
17858pub struct TriggerEntity {
17859    /// The name of the trigger.
17860    pub name: std::string::String,
17861
17862    /// The DML, DDL, or database events that fire the trigger, for example
17863    /// INSERT, UPDATE.
17864    pub triggering_events: std::vec::Vec<std::string::String>,
17865
17866    /// Indicates when the trigger fires, for example BEFORE STATEMENT, AFTER EACH
17867    /// ROW.
17868    pub trigger_type: std::string::String,
17869
17870    /// The SQL code which creates the trigger.
17871    pub sql_code: std::string::String,
17872
17873    /// Custom engine specific features.
17874    pub custom_features: std::option::Option<wkt::Struct>,
17875
17876    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17877}
17878
17879impl TriggerEntity {
17880    pub fn new() -> Self {
17881        std::default::Default::default()
17882    }
17883
17884    /// Sets the value of [name][crate::model::TriggerEntity::name].
17885    ///
17886    /// # Example
17887    /// ```ignore,no_run
17888    /// # use google_cloud_clouddms_v1::model::TriggerEntity;
17889    /// let x = TriggerEntity::new().set_name("example");
17890    /// ```
17891    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17892        self.name = v.into();
17893        self
17894    }
17895
17896    /// Sets the value of [triggering_events][crate::model::TriggerEntity::triggering_events].
17897    ///
17898    /// # Example
17899    /// ```ignore,no_run
17900    /// # use google_cloud_clouddms_v1::model::TriggerEntity;
17901    /// let x = TriggerEntity::new().set_triggering_events(["a", "b", "c"]);
17902    /// ```
17903    pub fn set_triggering_events<T, V>(mut self, v: T) -> Self
17904    where
17905        T: std::iter::IntoIterator<Item = V>,
17906        V: std::convert::Into<std::string::String>,
17907    {
17908        use std::iter::Iterator;
17909        self.triggering_events = v.into_iter().map(|i| i.into()).collect();
17910        self
17911    }
17912
17913    /// Sets the value of [trigger_type][crate::model::TriggerEntity::trigger_type].
17914    ///
17915    /// # Example
17916    /// ```ignore,no_run
17917    /// # use google_cloud_clouddms_v1::model::TriggerEntity;
17918    /// let x = TriggerEntity::new().set_trigger_type("example");
17919    /// ```
17920    pub fn set_trigger_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17921        self.trigger_type = v.into();
17922        self
17923    }
17924
17925    /// Sets the value of [sql_code][crate::model::TriggerEntity::sql_code].
17926    ///
17927    /// # Example
17928    /// ```ignore,no_run
17929    /// # use google_cloud_clouddms_v1::model::TriggerEntity;
17930    /// let x = TriggerEntity::new().set_sql_code("example");
17931    /// ```
17932    pub fn set_sql_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17933        self.sql_code = v.into();
17934        self
17935    }
17936
17937    /// Sets the value of [custom_features][crate::model::TriggerEntity::custom_features].
17938    ///
17939    /// # Example
17940    /// ```ignore,no_run
17941    /// # use google_cloud_clouddms_v1::model::TriggerEntity;
17942    /// use wkt::Struct;
17943    /// let x = TriggerEntity::new().set_custom_features(Struct::default()/* use setters */);
17944    /// ```
17945    pub fn set_custom_features<T>(mut self, v: T) -> Self
17946    where
17947        T: std::convert::Into<wkt::Struct>,
17948    {
17949        self.custom_features = std::option::Option::Some(v.into());
17950        self
17951    }
17952
17953    /// Sets or clears the value of [custom_features][crate::model::TriggerEntity::custom_features].
17954    ///
17955    /// # Example
17956    /// ```ignore,no_run
17957    /// # use google_cloud_clouddms_v1::model::TriggerEntity;
17958    /// use wkt::Struct;
17959    /// let x = TriggerEntity::new().set_or_clear_custom_features(Some(Struct::default()/* use setters */));
17960    /// let x = TriggerEntity::new().set_or_clear_custom_features(None::<Struct>);
17961    /// ```
17962    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
17963    where
17964        T: std::convert::Into<wkt::Struct>,
17965    {
17966        self.custom_features = v.map(|x| x.into());
17967        self
17968    }
17969}
17970
17971impl wkt::message::Message for TriggerEntity {
17972    fn typename() -> &'static str {
17973        "type.googleapis.com/google.cloud.clouddms.v1.TriggerEntity"
17974    }
17975}
17976
17977/// View's parent is a schema.
17978#[derive(Clone, Default, PartialEq)]
17979#[non_exhaustive]
17980pub struct ViewEntity {
17981    /// The SQL code which creates the view.
17982    pub sql_code: std::string::String,
17983
17984    /// Custom engine specific features.
17985    pub custom_features: std::option::Option<wkt::Struct>,
17986
17987    /// View constraints.
17988    pub constraints: std::vec::Vec<crate::model::ConstraintEntity>,
17989
17990    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17991}
17992
17993impl ViewEntity {
17994    pub fn new() -> Self {
17995        std::default::Default::default()
17996    }
17997
17998    /// Sets the value of [sql_code][crate::model::ViewEntity::sql_code].
17999    ///
18000    /// # Example
18001    /// ```ignore,no_run
18002    /// # use google_cloud_clouddms_v1::model::ViewEntity;
18003    /// let x = ViewEntity::new().set_sql_code("example");
18004    /// ```
18005    pub fn set_sql_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18006        self.sql_code = v.into();
18007        self
18008    }
18009
18010    /// Sets the value of [custom_features][crate::model::ViewEntity::custom_features].
18011    ///
18012    /// # Example
18013    /// ```ignore,no_run
18014    /// # use google_cloud_clouddms_v1::model::ViewEntity;
18015    /// use wkt::Struct;
18016    /// let x = ViewEntity::new().set_custom_features(Struct::default()/* use setters */);
18017    /// ```
18018    pub fn set_custom_features<T>(mut self, v: T) -> Self
18019    where
18020        T: std::convert::Into<wkt::Struct>,
18021    {
18022        self.custom_features = std::option::Option::Some(v.into());
18023        self
18024    }
18025
18026    /// Sets or clears the value of [custom_features][crate::model::ViewEntity::custom_features].
18027    ///
18028    /// # Example
18029    /// ```ignore,no_run
18030    /// # use google_cloud_clouddms_v1::model::ViewEntity;
18031    /// use wkt::Struct;
18032    /// let x = ViewEntity::new().set_or_clear_custom_features(Some(Struct::default()/* use setters */));
18033    /// let x = ViewEntity::new().set_or_clear_custom_features(None::<Struct>);
18034    /// ```
18035    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
18036    where
18037        T: std::convert::Into<wkt::Struct>,
18038    {
18039        self.custom_features = v.map(|x| x.into());
18040        self
18041    }
18042
18043    /// Sets the value of [constraints][crate::model::ViewEntity::constraints].
18044    ///
18045    /// # Example
18046    /// ```ignore,no_run
18047    /// # use google_cloud_clouddms_v1::model::ViewEntity;
18048    /// use google_cloud_clouddms_v1::model::ConstraintEntity;
18049    /// let x = ViewEntity::new()
18050    ///     .set_constraints([
18051    ///         ConstraintEntity::default()/* use setters */,
18052    ///         ConstraintEntity::default()/* use (different) setters */,
18053    ///     ]);
18054    /// ```
18055    pub fn set_constraints<T, V>(mut self, v: T) -> Self
18056    where
18057        T: std::iter::IntoIterator<Item = V>,
18058        V: std::convert::Into<crate::model::ConstraintEntity>,
18059    {
18060        use std::iter::Iterator;
18061        self.constraints = v.into_iter().map(|i| i.into()).collect();
18062        self
18063    }
18064}
18065
18066impl wkt::message::Message for ViewEntity {
18067    fn typename() -> &'static str {
18068        "type.googleapis.com/google.cloud.clouddms.v1.ViewEntity"
18069    }
18070}
18071
18072/// Sequence's parent is a schema.
18073#[derive(Clone, Default, PartialEq)]
18074#[non_exhaustive]
18075pub struct SequenceEntity {
18076    /// Increment value for the sequence.
18077    pub increment: i64,
18078
18079    /// Start number for the sequence represented as bytes to accommodate large.
18080    /// numbers
18081    pub start_value: ::bytes::Bytes,
18082
18083    /// Maximum number for the sequence represented as bytes to accommodate large.
18084    /// numbers
18085    pub max_value: ::bytes::Bytes,
18086
18087    /// Minimum number for the sequence represented as bytes to accommodate large.
18088    /// numbers
18089    pub min_value: ::bytes::Bytes,
18090
18091    /// Indicates whether the sequence value should cycle through.
18092    pub cycle: bool,
18093
18094    /// Indicates number of entries to cache / precreate.
18095    pub cache: i64,
18096
18097    /// Custom engine specific features.
18098    pub custom_features: std::option::Option<wkt::Struct>,
18099
18100    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18101}
18102
18103impl SequenceEntity {
18104    pub fn new() -> Self {
18105        std::default::Default::default()
18106    }
18107
18108    /// Sets the value of [increment][crate::model::SequenceEntity::increment].
18109    ///
18110    /// # Example
18111    /// ```ignore,no_run
18112    /// # use google_cloud_clouddms_v1::model::SequenceEntity;
18113    /// let x = SequenceEntity::new().set_increment(42);
18114    /// ```
18115    pub fn set_increment<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
18116        self.increment = v.into();
18117        self
18118    }
18119
18120    /// Sets the value of [start_value][crate::model::SequenceEntity::start_value].
18121    ///
18122    /// # Example
18123    /// ```ignore,no_run
18124    /// # use google_cloud_clouddms_v1::model::SequenceEntity;
18125    /// let x = SequenceEntity::new().set_start_value(bytes::Bytes::from_static(b"example"));
18126    /// ```
18127    pub fn set_start_value<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
18128        self.start_value = v.into();
18129        self
18130    }
18131
18132    /// Sets the value of [max_value][crate::model::SequenceEntity::max_value].
18133    ///
18134    /// # Example
18135    /// ```ignore,no_run
18136    /// # use google_cloud_clouddms_v1::model::SequenceEntity;
18137    /// let x = SequenceEntity::new().set_max_value(bytes::Bytes::from_static(b"example"));
18138    /// ```
18139    pub fn set_max_value<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
18140        self.max_value = v.into();
18141        self
18142    }
18143
18144    /// Sets the value of [min_value][crate::model::SequenceEntity::min_value].
18145    ///
18146    /// # Example
18147    /// ```ignore,no_run
18148    /// # use google_cloud_clouddms_v1::model::SequenceEntity;
18149    /// let x = SequenceEntity::new().set_min_value(bytes::Bytes::from_static(b"example"));
18150    /// ```
18151    pub fn set_min_value<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
18152        self.min_value = v.into();
18153        self
18154    }
18155
18156    /// Sets the value of [cycle][crate::model::SequenceEntity::cycle].
18157    ///
18158    /// # Example
18159    /// ```ignore,no_run
18160    /// # use google_cloud_clouddms_v1::model::SequenceEntity;
18161    /// let x = SequenceEntity::new().set_cycle(true);
18162    /// ```
18163    pub fn set_cycle<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
18164        self.cycle = v.into();
18165        self
18166    }
18167
18168    /// Sets the value of [cache][crate::model::SequenceEntity::cache].
18169    ///
18170    /// # Example
18171    /// ```ignore,no_run
18172    /// # use google_cloud_clouddms_v1::model::SequenceEntity;
18173    /// let x = SequenceEntity::new().set_cache(42);
18174    /// ```
18175    pub fn set_cache<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
18176        self.cache = v.into();
18177        self
18178    }
18179
18180    /// Sets the value of [custom_features][crate::model::SequenceEntity::custom_features].
18181    ///
18182    /// # Example
18183    /// ```ignore,no_run
18184    /// # use google_cloud_clouddms_v1::model::SequenceEntity;
18185    /// use wkt::Struct;
18186    /// let x = SequenceEntity::new().set_custom_features(Struct::default()/* use setters */);
18187    /// ```
18188    pub fn set_custom_features<T>(mut self, v: T) -> Self
18189    where
18190        T: std::convert::Into<wkt::Struct>,
18191    {
18192        self.custom_features = std::option::Option::Some(v.into());
18193        self
18194    }
18195
18196    /// Sets or clears the value of [custom_features][crate::model::SequenceEntity::custom_features].
18197    ///
18198    /// # Example
18199    /// ```ignore,no_run
18200    /// # use google_cloud_clouddms_v1::model::SequenceEntity;
18201    /// use wkt::Struct;
18202    /// let x = SequenceEntity::new().set_or_clear_custom_features(Some(Struct::default()/* use setters */));
18203    /// let x = SequenceEntity::new().set_or_clear_custom_features(None::<Struct>);
18204    /// ```
18205    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
18206    where
18207        T: std::convert::Into<wkt::Struct>,
18208    {
18209        self.custom_features = v.map(|x| x.into());
18210        self
18211    }
18212}
18213
18214impl wkt::message::Message for SequenceEntity {
18215    fn typename() -> &'static str {
18216        "type.googleapis.com/google.cloud.clouddms.v1.SequenceEntity"
18217    }
18218}
18219
18220/// Stored procedure's parent is a schema.
18221#[derive(Clone, Default, PartialEq)]
18222#[non_exhaustive]
18223pub struct StoredProcedureEntity {
18224    /// The SQL code which creates the stored procedure.
18225    pub sql_code: std::string::String,
18226
18227    /// Custom engine specific features.
18228    pub custom_features: std::option::Option<wkt::Struct>,
18229
18230    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18231}
18232
18233impl StoredProcedureEntity {
18234    pub fn new() -> Self {
18235        std::default::Default::default()
18236    }
18237
18238    /// Sets the value of [sql_code][crate::model::StoredProcedureEntity::sql_code].
18239    ///
18240    /// # Example
18241    /// ```ignore,no_run
18242    /// # use google_cloud_clouddms_v1::model::StoredProcedureEntity;
18243    /// let x = StoredProcedureEntity::new().set_sql_code("example");
18244    /// ```
18245    pub fn set_sql_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18246        self.sql_code = v.into();
18247        self
18248    }
18249
18250    /// Sets the value of [custom_features][crate::model::StoredProcedureEntity::custom_features].
18251    ///
18252    /// # Example
18253    /// ```ignore,no_run
18254    /// # use google_cloud_clouddms_v1::model::StoredProcedureEntity;
18255    /// use wkt::Struct;
18256    /// let x = StoredProcedureEntity::new().set_custom_features(Struct::default()/* use setters */);
18257    /// ```
18258    pub fn set_custom_features<T>(mut self, v: T) -> Self
18259    where
18260        T: std::convert::Into<wkt::Struct>,
18261    {
18262        self.custom_features = std::option::Option::Some(v.into());
18263        self
18264    }
18265
18266    /// Sets or clears the value of [custom_features][crate::model::StoredProcedureEntity::custom_features].
18267    ///
18268    /// # Example
18269    /// ```ignore,no_run
18270    /// # use google_cloud_clouddms_v1::model::StoredProcedureEntity;
18271    /// use wkt::Struct;
18272    /// let x = StoredProcedureEntity::new().set_or_clear_custom_features(Some(Struct::default()/* use setters */));
18273    /// let x = StoredProcedureEntity::new().set_or_clear_custom_features(None::<Struct>);
18274    /// ```
18275    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
18276    where
18277        T: std::convert::Into<wkt::Struct>,
18278    {
18279        self.custom_features = v.map(|x| x.into());
18280        self
18281    }
18282}
18283
18284impl wkt::message::Message for StoredProcedureEntity {
18285    fn typename() -> &'static str {
18286        "type.googleapis.com/google.cloud.clouddms.v1.StoredProcedureEntity"
18287    }
18288}
18289
18290/// Function's parent is a schema.
18291#[derive(Clone, Default, PartialEq)]
18292#[non_exhaustive]
18293pub struct FunctionEntity {
18294    /// The SQL code which creates the function.
18295    pub sql_code: std::string::String,
18296
18297    /// Custom engine specific features.
18298    pub custom_features: std::option::Option<wkt::Struct>,
18299
18300    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18301}
18302
18303impl FunctionEntity {
18304    pub fn new() -> Self {
18305        std::default::Default::default()
18306    }
18307
18308    /// Sets the value of [sql_code][crate::model::FunctionEntity::sql_code].
18309    ///
18310    /// # Example
18311    /// ```ignore,no_run
18312    /// # use google_cloud_clouddms_v1::model::FunctionEntity;
18313    /// let x = FunctionEntity::new().set_sql_code("example");
18314    /// ```
18315    pub fn set_sql_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18316        self.sql_code = v.into();
18317        self
18318    }
18319
18320    /// Sets the value of [custom_features][crate::model::FunctionEntity::custom_features].
18321    ///
18322    /// # Example
18323    /// ```ignore,no_run
18324    /// # use google_cloud_clouddms_v1::model::FunctionEntity;
18325    /// use wkt::Struct;
18326    /// let x = FunctionEntity::new().set_custom_features(Struct::default()/* use setters */);
18327    /// ```
18328    pub fn set_custom_features<T>(mut self, v: T) -> Self
18329    where
18330        T: std::convert::Into<wkt::Struct>,
18331    {
18332        self.custom_features = std::option::Option::Some(v.into());
18333        self
18334    }
18335
18336    /// Sets or clears the value of [custom_features][crate::model::FunctionEntity::custom_features].
18337    ///
18338    /// # Example
18339    /// ```ignore,no_run
18340    /// # use google_cloud_clouddms_v1::model::FunctionEntity;
18341    /// use wkt::Struct;
18342    /// let x = FunctionEntity::new().set_or_clear_custom_features(Some(Struct::default()/* use setters */));
18343    /// let x = FunctionEntity::new().set_or_clear_custom_features(None::<Struct>);
18344    /// ```
18345    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
18346    where
18347        T: std::convert::Into<wkt::Struct>,
18348    {
18349        self.custom_features = v.map(|x| x.into());
18350        self
18351    }
18352}
18353
18354impl wkt::message::Message for FunctionEntity {
18355    fn typename() -> &'static str {
18356        "type.googleapis.com/google.cloud.clouddms.v1.FunctionEntity"
18357    }
18358}
18359
18360/// MaterializedView's parent is a schema.
18361#[derive(Clone, Default, PartialEq)]
18362#[non_exhaustive]
18363pub struct MaterializedViewEntity {
18364    /// The SQL code which creates the view.
18365    pub sql_code: std::string::String,
18366
18367    /// Custom engine specific features.
18368    pub custom_features: std::option::Option<wkt::Struct>,
18369
18370    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18371}
18372
18373impl MaterializedViewEntity {
18374    pub fn new() -> Self {
18375        std::default::Default::default()
18376    }
18377
18378    /// Sets the value of [sql_code][crate::model::MaterializedViewEntity::sql_code].
18379    ///
18380    /// # Example
18381    /// ```ignore,no_run
18382    /// # use google_cloud_clouddms_v1::model::MaterializedViewEntity;
18383    /// let x = MaterializedViewEntity::new().set_sql_code("example");
18384    /// ```
18385    pub fn set_sql_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18386        self.sql_code = v.into();
18387        self
18388    }
18389
18390    /// Sets the value of [custom_features][crate::model::MaterializedViewEntity::custom_features].
18391    ///
18392    /// # Example
18393    /// ```ignore,no_run
18394    /// # use google_cloud_clouddms_v1::model::MaterializedViewEntity;
18395    /// use wkt::Struct;
18396    /// let x = MaterializedViewEntity::new().set_custom_features(Struct::default()/* use setters */);
18397    /// ```
18398    pub fn set_custom_features<T>(mut self, v: T) -> Self
18399    where
18400        T: std::convert::Into<wkt::Struct>,
18401    {
18402        self.custom_features = std::option::Option::Some(v.into());
18403        self
18404    }
18405
18406    /// Sets or clears the value of [custom_features][crate::model::MaterializedViewEntity::custom_features].
18407    ///
18408    /// # Example
18409    /// ```ignore,no_run
18410    /// # use google_cloud_clouddms_v1::model::MaterializedViewEntity;
18411    /// use wkt::Struct;
18412    /// let x = MaterializedViewEntity::new().set_or_clear_custom_features(Some(Struct::default()/* use setters */));
18413    /// let x = MaterializedViewEntity::new().set_or_clear_custom_features(None::<Struct>);
18414    /// ```
18415    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
18416    where
18417        T: std::convert::Into<wkt::Struct>,
18418    {
18419        self.custom_features = v.map(|x| x.into());
18420        self
18421    }
18422}
18423
18424impl wkt::message::Message for MaterializedViewEntity {
18425    fn typename() -> &'static str {
18426        "type.googleapis.com/google.cloud.clouddms.v1.MaterializedViewEntity"
18427    }
18428}
18429
18430/// Synonym's parent is a schema.
18431#[derive(Clone, Default, PartialEq)]
18432#[non_exhaustive]
18433pub struct SynonymEntity {
18434    /// The name of the entity for which the synonym is being created (the source).
18435    pub source_entity: std::string::String,
18436
18437    /// The type of the entity for which the synonym is being created
18438    /// (usually a table or a sequence).
18439    pub source_type: crate::model::DatabaseEntityType,
18440
18441    /// Custom engine specific features.
18442    pub custom_features: std::option::Option<wkt::Struct>,
18443
18444    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18445}
18446
18447impl SynonymEntity {
18448    pub fn new() -> Self {
18449        std::default::Default::default()
18450    }
18451
18452    /// Sets the value of [source_entity][crate::model::SynonymEntity::source_entity].
18453    ///
18454    /// # Example
18455    /// ```ignore,no_run
18456    /// # use google_cloud_clouddms_v1::model::SynonymEntity;
18457    /// let x = SynonymEntity::new().set_source_entity("example");
18458    /// ```
18459    pub fn set_source_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18460        self.source_entity = v.into();
18461        self
18462    }
18463
18464    /// Sets the value of [source_type][crate::model::SynonymEntity::source_type].
18465    ///
18466    /// # Example
18467    /// ```ignore,no_run
18468    /// # use google_cloud_clouddms_v1::model::SynonymEntity;
18469    /// use google_cloud_clouddms_v1::model::DatabaseEntityType;
18470    /// let x0 = SynonymEntity::new().set_source_type(DatabaseEntityType::Schema);
18471    /// let x1 = SynonymEntity::new().set_source_type(DatabaseEntityType::Table);
18472    /// let x2 = SynonymEntity::new().set_source_type(DatabaseEntityType::Column);
18473    /// ```
18474    pub fn set_source_type<T: std::convert::Into<crate::model::DatabaseEntityType>>(
18475        mut self,
18476        v: T,
18477    ) -> Self {
18478        self.source_type = v.into();
18479        self
18480    }
18481
18482    /// Sets the value of [custom_features][crate::model::SynonymEntity::custom_features].
18483    ///
18484    /// # Example
18485    /// ```ignore,no_run
18486    /// # use google_cloud_clouddms_v1::model::SynonymEntity;
18487    /// use wkt::Struct;
18488    /// let x = SynonymEntity::new().set_custom_features(Struct::default()/* use setters */);
18489    /// ```
18490    pub fn set_custom_features<T>(mut self, v: T) -> Self
18491    where
18492        T: std::convert::Into<wkt::Struct>,
18493    {
18494        self.custom_features = std::option::Option::Some(v.into());
18495        self
18496    }
18497
18498    /// Sets or clears the value of [custom_features][crate::model::SynonymEntity::custom_features].
18499    ///
18500    /// # Example
18501    /// ```ignore,no_run
18502    /// # use google_cloud_clouddms_v1::model::SynonymEntity;
18503    /// use wkt::Struct;
18504    /// let x = SynonymEntity::new().set_or_clear_custom_features(Some(Struct::default()/* use setters */));
18505    /// let x = SynonymEntity::new().set_or_clear_custom_features(None::<Struct>);
18506    /// ```
18507    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
18508    where
18509        T: std::convert::Into<wkt::Struct>,
18510    {
18511        self.custom_features = v.map(|x| x.into());
18512        self
18513    }
18514}
18515
18516impl wkt::message::Message for SynonymEntity {
18517    fn typename() -> &'static str {
18518        "type.googleapis.com/google.cloud.clouddms.v1.SynonymEntity"
18519    }
18520}
18521
18522/// Package's parent is a schema.
18523#[derive(Clone, Default, PartialEq)]
18524#[non_exhaustive]
18525pub struct PackageEntity {
18526    /// The SQL code which creates the package.
18527    pub package_sql_code: std::string::String,
18528
18529    /// The SQL code which creates the package body. If the package specification
18530    /// has cursors or subprograms, then the package body is mandatory.
18531    pub package_body: std::string::String,
18532
18533    /// Custom engine specific features.
18534    pub custom_features: std::option::Option<wkt::Struct>,
18535
18536    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18537}
18538
18539impl PackageEntity {
18540    pub fn new() -> Self {
18541        std::default::Default::default()
18542    }
18543
18544    /// Sets the value of [package_sql_code][crate::model::PackageEntity::package_sql_code].
18545    ///
18546    /// # Example
18547    /// ```ignore,no_run
18548    /// # use google_cloud_clouddms_v1::model::PackageEntity;
18549    /// let x = PackageEntity::new().set_package_sql_code("example");
18550    /// ```
18551    pub fn set_package_sql_code<T: std::convert::Into<std::string::String>>(
18552        mut self,
18553        v: T,
18554    ) -> Self {
18555        self.package_sql_code = v.into();
18556        self
18557    }
18558
18559    /// Sets the value of [package_body][crate::model::PackageEntity::package_body].
18560    ///
18561    /// # Example
18562    /// ```ignore,no_run
18563    /// # use google_cloud_clouddms_v1::model::PackageEntity;
18564    /// let x = PackageEntity::new().set_package_body("example");
18565    /// ```
18566    pub fn set_package_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18567        self.package_body = v.into();
18568        self
18569    }
18570
18571    /// Sets the value of [custom_features][crate::model::PackageEntity::custom_features].
18572    ///
18573    /// # Example
18574    /// ```ignore,no_run
18575    /// # use google_cloud_clouddms_v1::model::PackageEntity;
18576    /// use wkt::Struct;
18577    /// let x = PackageEntity::new().set_custom_features(Struct::default()/* use setters */);
18578    /// ```
18579    pub fn set_custom_features<T>(mut self, v: T) -> Self
18580    where
18581        T: std::convert::Into<wkt::Struct>,
18582    {
18583        self.custom_features = std::option::Option::Some(v.into());
18584        self
18585    }
18586
18587    /// Sets or clears the value of [custom_features][crate::model::PackageEntity::custom_features].
18588    ///
18589    /// # Example
18590    /// ```ignore,no_run
18591    /// # use google_cloud_clouddms_v1::model::PackageEntity;
18592    /// use wkt::Struct;
18593    /// let x = PackageEntity::new().set_or_clear_custom_features(Some(Struct::default()/* use setters */));
18594    /// let x = PackageEntity::new().set_or_clear_custom_features(None::<Struct>);
18595    /// ```
18596    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
18597    where
18598        T: std::convert::Into<wkt::Struct>,
18599    {
18600        self.custom_features = v.map(|x| x.into());
18601        self
18602    }
18603}
18604
18605impl wkt::message::Message for PackageEntity {
18606    fn typename() -> &'static str {
18607        "type.googleapis.com/google.cloud.clouddms.v1.PackageEntity"
18608    }
18609}
18610
18611/// UDT's parent is a schema.
18612#[derive(Clone, Default, PartialEq)]
18613#[non_exhaustive]
18614pub struct UDTEntity {
18615    /// The SQL code which creates the udt.
18616    pub udt_sql_code: std::string::String,
18617
18618    /// The SQL code which creates the udt body.
18619    pub udt_body: std::string::String,
18620
18621    /// Custom engine specific features.
18622    pub custom_features: std::option::Option<wkt::Struct>,
18623
18624    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18625}
18626
18627impl UDTEntity {
18628    pub fn new() -> Self {
18629        std::default::Default::default()
18630    }
18631
18632    /// Sets the value of [udt_sql_code][crate::model::UDTEntity::udt_sql_code].
18633    ///
18634    /// # Example
18635    /// ```ignore,no_run
18636    /// # use google_cloud_clouddms_v1::model::UDTEntity;
18637    /// let x = UDTEntity::new().set_udt_sql_code("example");
18638    /// ```
18639    pub fn set_udt_sql_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18640        self.udt_sql_code = v.into();
18641        self
18642    }
18643
18644    /// Sets the value of [udt_body][crate::model::UDTEntity::udt_body].
18645    ///
18646    /// # Example
18647    /// ```ignore,no_run
18648    /// # use google_cloud_clouddms_v1::model::UDTEntity;
18649    /// let x = UDTEntity::new().set_udt_body("example");
18650    /// ```
18651    pub fn set_udt_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18652        self.udt_body = v.into();
18653        self
18654    }
18655
18656    /// Sets the value of [custom_features][crate::model::UDTEntity::custom_features].
18657    ///
18658    /// # Example
18659    /// ```ignore,no_run
18660    /// # use google_cloud_clouddms_v1::model::UDTEntity;
18661    /// use wkt::Struct;
18662    /// let x = UDTEntity::new().set_custom_features(Struct::default()/* use setters */);
18663    /// ```
18664    pub fn set_custom_features<T>(mut self, v: T) -> Self
18665    where
18666        T: std::convert::Into<wkt::Struct>,
18667    {
18668        self.custom_features = std::option::Option::Some(v.into());
18669        self
18670    }
18671
18672    /// Sets or clears the value of [custom_features][crate::model::UDTEntity::custom_features].
18673    ///
18674    /// # Example
18675    /// ```ignore,no_run
18676    /// # use google_cloud_clouddms_v1::model::UDTEntity;
18677    /// use wkt::Struct;
18678    /// let x = UDTEntity::new().set_or_clear_custom_features(Some(Struct::default()/* use setters */));
18679    /// let x = UDTEntity::new().set_or_clear_custom_features(None::<Struct>);
18680    /// ```
18681    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
18682    where
18683        T: std::convert::Into<wkt::Struct>,
18684    {
18685        self.custom_features = v.map(|x| x.into());
18686        self
18687    }
18688}
18689
18690impl wkt::message::Message for UDTEntity {
18691    fn typename() -> &'static str {
18692        "type.googleapis.com/google.cloud.clouddms.v1.UDTEntity"
18693    }
18694}
18695
18696/// Details of the mappings of a database entity.
18697#[derive(Clone, Default, PartialEq)]
18698#[non_exhaustive]
18699pub struct EntityMapping {
18700    /// Source entity full name.
18701    /// The source entity can also be a column, index or constraint using the
18702    /// same naming notation schema.table.column.
18703    pub source_entity: std::string::String,
18704
18705    /// Target entity full name.
18706    /// The draft entity can also include a column, index or constraint using the
18707    /// same naming notation schema.table.column.
18708    pub draft_entity: std::string::String,
18709
18710    /// Type of source entity.
18711    pub source_type: crate::model::DatabaseEntityType,
18712
18713    /// Type of draft entity.
18714    pub draft_type: crate::model::DatabaseEntityType,
18715
18716    /// Entity mapping log entries.
18717    /// Multiple rules can be effective and contribute changes to a converted
18718    /// entity, such as a rule can handle the entity name, another rule can handle
18719    /// an entity type. In addition, rules which did not change the entity are also
18720    /// logged along with the reason preventing them to do so.
18721    pub mapping_log: std::vec::Vec<crate::model::EntityMappingLogEntry>,
18722
18723    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18724}
18725
18726impl EntityMapping {
18727    pub fn new() -> Self {
18728        std::default::Default::default()
18729    }
18730
18731    /// Sets the value of [source_entity][crate::model::EntityMapping::source_entity].
18732    ///
18733    /// # Example
18734    /// ```ignore,no_run
18735    /// # use google_cloud_clouddms_v1::model::EntityMapping;
18736    /// let x = EntityMapping::new().set_source_entity("example");
18737    /// ```
18738    pub fn set_source_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18739        self.source_entity = v.into();
18740        self
18741    }
18742
18743    /// Sets the value of [draft_entity][crate::model::EntityMapping::draft_entity].
18744    ///
18745    /// # Example
18746    /// ```ignore,no_run
18747    /// # use google_cloud_clouddms_v1::model::EntityMapping;
18748    /// let x = EntityMapping::new().set_draft_entity("example");
18749    /// ```
18750    pub fn set_draft_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18751        self.draft_entity = v.into();
18752        self
18753    }
18754
18755    /// Sets the value of [source_type][crate::model::EntityMapping::source_type].
18756    ///
18757    /// # Example
18758    /// ```ignore,no_run
18759    /// # use google_cloud_clouddms_v1::model::EntityMapping;
18760    /// use google_cloud_clouddms_v1::model::DatabaseEntityType;
18761    /// let x0 = EntityMapping::new().set_source_type(DatabaseEntityType::Schema);
18762    /// let x1 = EntityMapping::new().set_source_type(DatabaseEntityType::Table);
18763    /// let x2 = EntityMapping::new().set_source_type(DatabaseEntityType::Column);
18764    /// ```
18765    pub fn set_source_type<T: std::convert::Into<crate::model::DatabaseEntityType>>(
18766        mut self,
18767        v: T,
18768    ) -> Self {
18769        self.source_type = v.into();
18770        self
18771    }
18772
18773    /// Sets the value of [draft_type][crate::model::EntityMapping::draft_type].
18774    ///
18775    /// # Example
18776    /// ```ignore,no_run
18777    /// # use google_cloud_clouddms_v1::model::EntityMapping;
18778    /// use google_cloud_clouddms_v1::model::DatabaseEntityType;
18779    /// let x0 = EntityMapping::new().set_draft_type(DatabaseEntityType::Schema);
18780    /// let x1 = EntityMapping::new().set_draft_type(DatabaseEntityType::Table);
18781    /// let x2 = EntityMapping::new().set_draft_type(DatabaseEntityType::Column);
18782    /// ```
18783    pub fn set_draft_type<T: std::convert::Into<crate::model::DatabaseEntityType>>(
18784        mut self,
18785        v: T,
18786    ) -> Self {
18787        self.draft_type = v.into();
18788        self
18789    }
18790
18791    /// Sets the value of [mapping_log][crate::model::EntityMapping::mapping_log].
18792    ///
18793    /// # Example
18794    /// ```ignore,no_run
18795    /// # use google_cloud_clouddms_v1::model::EntityMapping;
18796    /// use google_cloud_clouddms_v1::model::EntityMappingLogEntry;
18797    /// let x = EntityMapping::new()
18798    ///     .set_mapping_log([
18799    ///         EntityMappingLogEntry::default()/* use setters */,
18800    ///         EntityMappingLogEntry::default()/* use (different) setters */,
18801    ///     ]);
18802    /// ```
18803    pub fn set_mapping_log<T, V>(mut self, v: T) -> Self
18804    where
18805        T: std::iter::IntoIterator<Item = V>,
18806        V: std::convert::Into<crate::model::EntityMappingLogEntry>,
18807    {
18808        use std::iter::Iterator;
18809        self.mapping_log = v.into_iter().map(|i| i.into()).collect();
18810        self
18811    }
18812}
18813
18814impl wkt::message::Message for EntityMapping {
18815    fn typename() -> &'static str {
18816        "type.googleapis.com/google.cloud.clouddms.v1.EntityMapping"
18817    }
18818}
18819
18820/// A single record of a rule which was used for a mapping.
18821#[derive(Clone, Default, PartialEq)]
18822#[non_exhaustive]
18823pub struct EntityMappingLogEntry {
18824    /// Which rule caused this log entry.
18825    pub rule_id: std::string::String,
18826
18827    /// Rule revision ID.
18828    pub rule_revision_id: std::string::String,
18829
18830    /// Comment.
18831    pub mapping_comment: std::string::String,
18832
18833    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18834}
18835
18836impl EntityMappingLogEntry {
18837    pub fn new() -> Self {
18838        std::default::Default::default()
18839    }
18840
18841    /// Sets the value of [rule_id][crate::model::EntityMappingLogEntry::rule_id].
18842    ///
18843    /// # Example
18844    /// ```ignore,no_run
18845    /// # use google_cloud_clouddms_v1::model::EntityMappingLogEntry;
18846    /// let x = EntityMappingLogEntry::new().set_rule_id("example");
18847    /// ```
18848    pub fn set_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18849        self.rule_id = v.into();
18850        self
18851    }
18852
18853    /// Sets the value of [rule_revision_id][crate::model::EntityMappingLogEntry::rule_revision_id].
18854    ///
18855    /// # Example
18856    /// ```ignore,no_run
18857    /// # use google_cloud_clouddms_v1::model::EntityMappingLogEntry;
18858    /// let x = EntityMappingLogEntry::new().set_rule_revision_id("example");
18859    /// ```
18860    pub fn set_rule_revision_id<T: std::convert::Into<std::string::String>>(
18861        mut self,
18862        v: T,
18863    ) -> Self {
18864        self.rule_revision_id = v.into();
18865        self
18866    }
18867
18868    /// Sets the value of [mapping_comment][crate::model::EntityMappingLogEntry::mapping_comment].
18869    ///
18870    /// # Example
18871    /// ```ignore,no_run
18872    /// # use google_cloud_clouddms_v1::model::EntityMappingLogEntry;
18873    /// let x = EntityMappingLogEntry::new().set_mapping_comment("example");
18874    /// ```
18875    pub fn set_mapping_comment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18876        self.mapping_comment = v.into();
18877        self
18878    }
18879}
18880
18881impl wkt::message::Message for EntityMappingLogEntry {
18882    fn typename() -> &'static str {
18883        "type.googleapis.com/google.cloud.clouddms.v1.EntityMappingLogEntry"
18884    }
18885}
18886
18887/// A single DDL statement for a specific entity
18888#[derive(Clone, Default, PartialEq)]
18889#[non_exhaustive]
18890pub struct EntityDdl {
18891    /// Type of DDL (Create, Alter).
18892    pub ddl_type: std::string::String,
18893
18894    /// The name of the database entity the ddl refers to.
18895    pub entity: std::string::String,
18896
18897    /// The actual ddl code.
18898    pub ddl: std::string::String,
18899
18900    /// The entity type (if the DDL is for a sub entity).
18901    pub entity_type: crate::model::DatabaseEntityType,
18902
18903    /// EntityIssues found for this ddl.
18904    pub issue_id: std::vec::Vec<std::string::String>,
18905
18906    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18907}
18908
18909impl EntityDdl {
18910    pub fn new() -> Self {
18911        std::default::Default::default()
18912    }
18913
18914    /// Sets the value of [ddl_type][crate::model::EntityDdl::ddl_type].
18915    ///
18916    /// # Example
18917    /// ```ignore,no_run
18918    /// # use google_cloud_clouddms_v1::model::EntityDdl;
18919    /// let x = EntityDdl::new().set_ddl_type("example");
18920    /// ```
18921    pub fn set_ddl_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18922        self.ddl_type = v.into();
18923        self
18924    }
18925
18926    /// Sets the value of [entity][crate::model::EntityDdl::entity].
18927    ///
18928    /// # Example
18929    /// ```ignore,no_run
18930    /// # use google_cloud_clouddms_v1::model::EntityDdl;
18931    /// let x = EntityDdl::new().set_entity("example");
18932    /// ```
18933    pub fn set_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18934        self.entity = v.into();
18935        self
18936    }
18937
18938    /// Sets the value of [ddl][crate::model::EntityDdl::ddl].
18939    ///
18940    /// # Example
18941    /// ```ignore,no_run
18942    /// # use google_cloud_clouddms_v1::model::EntityDdl;
18943    /// let x = EntityDdl::new().set_ddl("example");
18944    /// ```
18945    pub fn set_ddl<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18946        self.ddl = v.into();
18947        self
18948    }
18949
18950    /// Sets the value of [entity_type][crate::model::EntityDdl::entity_type].
18951    ///
18952    /// # Example
18953    /// ```ignore,no_run
18954    /// # use google_cloud_clouddms_v1::model::EntityDdl;
18955    /// use google_cloud_clouddms_v1::model::DatabaseEntityType;
18956    /// let x0 = EntityDdl::new().set_entity_type(DatabaseEntityType::Schema);
18957    /// let x1 = EntityDdl::new().set_entity_type(DatabaseEntityType::Table);
18958    /// let x2 = EntityDdl::new().set_entity_type(DatabaseEntityType::Column);
18959    /// ```
18960    pub fn set_entity_type<T: std::convert::Into<crate::model::DatabaseEntityType>>(
18961        mut self,
18962        v: T,
18963    ) -> Self {
18964        self.entity_type = v.into();
18965        self
18966    }
18967
18968    /// Sets the value of [issue_id][crate::model::EntityDdl::issue_id].
18969    ///
18970    /// # Example
18971    /// ```ignore,no_run
18972    /// # use google_cloud_clouddms_v1::model::EntityDdl;
18973    /// let x = EntityDdl::new().set_issue_id(["a", "b", "c"]);
18974    /// ```
18975    pub fn set_issue_id<T, V>(mut self, v: T) -> Self
18976    where
18977        T: std::iter::IntoIterator<Item = V>,
18978        V: std::convert::Into<std::string::String>,
18979    {
18980        use std::iter::Iterator;
18981        self.issue_id = v.into_iter().map(|i| i.into()).collect();
18982        self
18983    }
18984}
18985
18986impl wkt::message::Message for EntityDdl {
18987    fn typename() -> &'static str {
18988        "type.googleapis.com/google.cloud.clouddms.v1.EntityDdl"
18989    }
18990}
18991
18992/// Issue related to the entity.
18993#[derive(Clone, Default, PartialEq)]
18994#[non_exhaustive]
18995pub struct EntityIssue {
18996    /// Unique Issue ID.
18997    pub id: std::string::String,
18998
18999    /// The type of the issue.
19000    pub r#type: crate::model::entity_issue::IssueType,
19001
19002    /// Severity of the issue
19003    pub severity: crate::model::entity_issue::IssueSeverity,
19004
19005    /// Issue detailed message
19006    pub message: std::string::String,
19007
19008    /// Error/Warning code
19009    pub code: std::string::String,
19010
19011    /// The ddl which caused the issue, if relevant.
19012    pub ddl: std::option::Option<std::string::String>,
19013
19014    /// The position of the issue found, if relevant.
19015    pub position: std::option::Option<crate::model::entity_issue::Position>,
19016
19017    /// The entity type (if the DDL is for a sub entity).
19018    pub entity_type: crate::model::DatabaseEntityType,
19019
19020    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19021}
19022
19023impl EntityIssue {
19024    pub fn new() -> Self {
19025        std::default::Default::default()
19026    }
19027
19028    /// Sets the value of [id][crate::model::EntityIssue::id].
19029    ///
19030    /// # Example
19031    /// ```ignore,no_run
19032    /// # use google_cloud_clouddms_v1::model::EntityIssue;
19033    /// let x = EntityIssue::new().set_id("example");
19034    /// ```
19035    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19036        self.id = v.into();
19037        self
19038    }
19039
19040    /// Sets the value of [r#type][crate::model::EntityIssue::type].
19041    ///
19042    /// # Example
19043    /// ```ignore,no_run
19044    /// # use google_cloud_clouddms_v1::model::EntityIssue;
19045    /// use google_cloud_clouddms_v1::model::entity_issue::IssueType;
19046    /// let x0 = EntityIssue::new().set_type(IssueType::Ddl);
19047    /// let x1 = EntityIssue::new().set_type(IssueType::Apply);
19048    /// let x2 = EntityIssue::new().set_type(IssueType::Convert);
19049    /// ```
19050    pub fn set_type<T: std::convert::Into<crate::model::entity_issue::IssueType>>(
19051        mut self,
19052        v: T,
19053    ) -> Self {
19054        self.r#type = v.into();
19055        self
19056    }
19057
19058    /// Sets the value of [severity][crate::model::EntityIssue::severity].
19059    ///
19060    /// # Example
19061    /// ```ignore,no_run
19062    /// # use google_cloud_clouddms_v1::model::EntityIssue;
19063    /// use google_cloud_clouddms_v1::model::entity_issue::IssueSeverity;
19064    /// let x0 = EntityIssue::new().set_severity(IssueSeverity::Info);
19065    /// let x1 = EntityIssue::new().set_severity(IssueSeverity::Warning);
19066    /// let x2 = EntityIssue::new().set_severity(IssueSeverity::Error);
19067    /// ```
19068    pub fn set_severity<T: std::convert::Into<crate::model::entity_issue::IssueSeverity>>(
19069        mut self,
19070        v: T,
19071    ) -> Self {
19072        self.severity = v.into();
19073        self
19074    }
19075
19076    /// Sets the value of [message][crate::model::EntityIssue::message].
19077    ///
19078    /// # Example
19079    /// ```ignore,no_run
19080    /// # use google_cloud_clouddms_v1::model::EntityIssue;
19081    /// let x = EntityIssue::new().set_message("example");
19082    /// ```
19083    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19084        self.message = v.into();
19085        self
19086    }
19087
19088    /// Sets the value of [code][crate::model::EntityIssue::code].
19089    ///
19090    /// # Example
19091    /// ```ignore,no_run
19092    /// # use google_cloud_clouddms_v1::model::EntityIssue;
19093    /// let x = EntityIssue::new().set_code("example");
19094    /// ```
19095    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19096        self.code = v.into();
19097        self
19098    }
19099
19100    /// Sets the value of [ddl][crate::model::EntityIssue::ddl].
19101    ///
19102    /// # Example
19103    /// ```ignore,no_run
19104    /// # use google_cloud_clouddms_v1::model::EntityIssue;
19105    /// let x = EntityIssue::new().set_ddl("example");
19106    /// ```
19107    pub fn set_ddl<T>(mut self, v: T) -> Self
19108    where
19109        T: std::convert::Into<std::string::String>,
19110    {
19111        self.ddl = std::option::Option::Some(v.into());
19112        self
19113    }
19114
19115    /// Sets or clears the value of [ddl][crate::model::EntityIssue::ddl].
19116    ///
19117    /// # Example
19118    /// ```ignore,no_run
19119    /// # use google_cloud_clouddms_v1::model::EntityIssue;
19120    /// let x = EntityIssue::new().set_or_clear_ddl(Some("example"));
19121    /// let x = EntityIssue::new().set_or_clear_ddl(None::<String>);
19122    /// ```
19123    pub fn set_or_clear_ddl<T>(mut self, v: std::option::Option<T>) -> Self
19124    where
19125        T: std::convert::Into<std::string::String>,
19126    {
19127        self.ddl = v.map(|x| x.into());
19128        self
19129    }
19130
19131    /// Sets the value of [position][crate::model::EntityIssue::position].
19132    ///
19133    /// # Example
19134    /// ```ignore,no_run
19135    /// # use google_cloud_clouddms_v1::model::EntityIssue;
19136    /// use google_cloud_clouddms_v1::model::entity_issue::Position;
19137    /// let x = EntityIssue::new().set_position(Position::default()/* use setters */);
19138    /// ```
19139    pub fn set_position<T>(mut self, v: T) -> Self
19140    where
19141        T: std::convert::Into<crate::model::entity_issue::Position>,
19142    {
19143        self.position = std::option::Option::Some(v.into());
19144        self
19145    }
19146
19147    /// Sets or clears the value of [position][crate::model::EntityIssue::position].
19148    ///
19149    /// # Example
19150    /// ```ignore,no_run
19151    /// # use google_cloud_clouddms_v1::model::EntityIssue;
19152    /// use google_cloud_clouddms_v1::model::entity_issue::Position;
19153    /// let x = EntityIssue::new().set_or_clear_position(Some(Position::default()/* use setters */));
19154    /// let x = EntityIssue::new().set_or_clear_position(None::<Position>);
19155    /// ```
19156    pub fn set_or_clear_position<T>(mut self, v: std::option::Option<T>) -> Self
19157    where
19158        T: std::convert::Into<crate::model::entity_issue::Position>,
19159    {
19160        self.position = v.map(|x| x.into());
19161        self
19162    }
19163
19164    /// Sets the value of [entity_type][crate::model::EntityIssue::entity_type].
19165    ///
19166    /// # Example
19167    /// ```ignore,no_run
19168    /// # use google_cloud_clouddms_v1::model::EntityIssue;
19169    /// use google_cloud_clouddms_v1::model::DatabaseEntityType;
19170    /// let x0 = EntityIssue::new().set_entity_type(DatabaseEntityType::Schema);
19171    /// let x1 = EntityIssue::new().set_entity_type(DatabaseEntityType::Table);
19172    /// let x2 = EntityIssue::new().set_entity_type(DatabaseEntityType::Column);
19173    /// ```
19174    pub fn set_entity_type<T: std::convert::Into<crate::model::DatabaseEntityType>>(
19175        mut self,
19176        v: T,
19177    ) -> Self {
19178        self.entity_type = v.into();
19179        self
19180    }
19181}
19182
19183impl wkt::message::Message for EntityIssue {
19184    fn typename() -> &'static str {
19185        "type.googleapis.com/google.cloud.clouddms.v1.EntityIssue"
19186    }
19187}
19188
19189/// Defines additional types related to [EntityIssue].
19190pub mod entity_issue {
19191    #[allow(unused_imports)]
19192    use super::*;
19193
19194    /// Issue position.
19195    #[derive(Clone, Default, PartialEq)]
19196    #[non_exhaustive]
19197    pub struct Position {
19198        /// Issue line number
19199        pub line: i32,
19200
19201        /// Issue column number
19202        pub column: i32,
19203
19204        /// Issue offset
19205        pub offset: i32,
19206
19207        /// Issue length
19208        pub length: i32,
19209
19210        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19211    }
19212
19213    impl Position {
19214        pub fn new() -> Self {
19215            std::default::Default::default()
19216        }
19217
19218        /// Sets the value of [line][crate::model::entity_issue::Position::line].
19219        ///
19220        /// # Example
19221        /// ```ignore,no_run
19222        /// # use google_cloud_clouddms_v1::model::entity_issue::Position;
19223        /// let x = Position::new().set_line(42);
19224        /// ```
19225        pub fn set_line<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19226            self.line = v.into();
19227            self
19228        }
19229
19230        /// Sets the value of [column][crate::model::entity_issue::Position::column].
19231        ///
19232        /// # Example
19233        /// ```ignore,no_run
19234        /// # use google_cloud_clouddms_v1::model::entity_issue::Position;
19235        /// let x = Position::new().set_column(42);
19236        /// ```
19237        pub fn set_column<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19238            self.column = v.into();
19239            self
19240        }
19241
19242        /// Sets the value of [offset][crate::model::entity_issue::Position::offset].
19243        ///
19244        /// # Example
19245        /// ```ignore,no_run
19246        /// # use google_cloud_clouddms_v1::model::entity_issue::Position;
19247        /// let x = Position::new().set_offset(42);
19248        /// ```
19249        pub fn set_offset<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19250            self.offset = v.into();
19251            self
19252        }
19253
19254        /// Sets the value of [length][crate::model::entity_issue::Position::length].
19255        ///
19256        /// # Example
19257        /// ```ignore,no_run
19258        /// # use google_cloud_clouddms_v1::model::entity_issue::Position;
19259        /// let x = Position::new().set_length(42);
19260        /// ```
19261        pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19262            self.length = v.into();
19263            self
19264        }
19265    }
19266
19267    impl wkt::message::Message for Position {
19268        fn typename() -> &'static str {
19269            "type.googleapis.com/google.cloud.clouddms.v1.EntityIssue.Position"
19270        }
19271    }
19272
19273    /// Type of issue.
19274    ///
19275    /// # Working with unknown values
19276    ///
19277    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19278    /// additional enum variants at any time. Adding new variants is not considered
19279    /// a breaking change. Applications should write their code in anticipation of:
19280    ///
19281    /// - New values appearing in future releases of the client library, **and**
19282    /// - New values received dynamically, without application changes.
19283    ///
19284    /// Please consult the [Working with enums] section in the user guide for some
19285    /// guidelines.
19286    ///
19287    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
19288    #[derive(Clone, Debug, PartialEq)]
19289    #[non_exhaustive]
19290    pub enum IssueType {
19291        /// Unspecified issue type.
19292        Unspecified,
19293        /// Issue originated from the DDL
19294        Ddl,
19295        /// Issue originated during the apply process
19296        Apply,
19297        /// Issue originated during the convert process
19298        Convert,
19299        /// If set, the enum was initialized with an unknown value.
19300        ///
19301        /// Applications can examine the value using [IssueType::value] or
19302        /// [IssueType::name].
19303        UnknownValue(issue_type::UnknownValue),
19304    }
19305
19306    #[doc(hidden)]
19307    pub mod issue_type {
19308        #[allow(unused_imports)]
19309        use super::*;
19310        #[derive(Clone, Debug, PartialEq)]
19311        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19312    }
19313
19314    impl IssueType {
19315        /// Gets the enum value.
19316        ///
19317        /// Returns `None` if the enum contains an unknown value deserialized from
19318        /// the string representation of enums.
19319        pub fn value(&self) -> std::option::Option<i32> {
19320            match self {
19321                Self::Unspecified => std::option::Option::Some(0),
19322                Self::Ddl => std::option::Option::Some(1),
19323                Self::Apply => std::option::Option::Some(2),
19324                Self::Convert => std::option::Option::Some(3),
19325                Self::UnknownValue(u) => u.0.value(),
19326            }
19327        }
19328
19329        /// Gets the enum value as a string.
19330        ///
19331        /// Returns `None` if the enum contains an unknown value deserialized from
19332        /// the integer representation of enums.
19333        pub fn name(&self) -> std::option::Option<&str> {
19334            match self {
19335                Self::Unspecified => std::option::Option::Some("ISSUE_TYPE_UNSPECIFIED"),
19336                Self::Ddl => std::option::Option::Some("ISSUE_TYPE_DDL"),
19337                Self::Apply => std::option::Option::Some("ISSUE_TYPE_APPLY"),
19338                Self::Convert => std::option::Option::Some("ISSUE_TYPE_CONVERT"),
19339                Self::UnknownValue(u) => u.0.name(),
19340            }
19341        }
19342    }
19343
19344    impl std::default::Default for IssueType {
19345        fn default() -> Self {
19346            use std::convert::From;
19347            Self::from(0)
19348        }
19349    }
19350
19351    impl std::fmt::Display for IssueType {
19352        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19353            wkt::internal::display_enum(f, self.name(), self.value())
19354        }
19355    }
19356
19357    impl std::convert::From<i32> for IssueType {
19358        fn from(value: i32) -> Self {
19359            match value {
19360                0 => Self::Unspecified,
19361                1 => Self::Ddl,
19362                2 => Self::Apply,
19363                3 => Self::Convert,
19364                _ => Self::UnknownValue(issue_type::UnknownValue(
19365                    wkt::internal::UnknownEnumValue::Integer(value),
19366                )),
19367            }
19368        }
19369    }
19370
19371    impl std::convert::From<&str> for IssueType {
19372        fn from(value: &str) -> Self {
19373            use std::string::ToString;
19374            match value {
19375                "ISSUE_TYPE_UNSPECIFIED" => Self::Unspecified,
19376                "ISSUE_TYPE_DDL" => Self::Ddl,
19377                "ISSUE_TYPE_APPLY" => Self::Apply,
19378                "ISSUE_TYPE_CONVERT" => Self::Convert,
19379                _ => Self::UnknownValue(issue_type::UnknownValue(
19380                    wkt::internal::UnknownEnumValue::String(value.to_string()),
19381                )),
19382            }
19383        }
19384    }
19385
19386    impl serde::ser::Serialize for IssueType {
19387        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19388        where
19389            S: serde::Serializer,
19390        {
19391            match self {
19392                Self::Unspecified => serializer.serialize_i32(0),
19393                Self::Ddl => serializer.serialize_i32(1),
19394                Self::Apply => serializer.serialize_i32(2),
19395                Self::Convert => serializer.serialize_i32(3),
19396                Self::UnknownValue(u) => u.0.serialize(serializer),
19397            }
19398        }
19399    }
19400
19401    impl<'de> serde::de::Deserialize<'de> for IssueType {
19402        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19403        where
19404            D: serde::Deserializer<'de>,
19405        {
19406            deserializer.deserialize_any(wkt::internal::EnumVisitor::<IssueType>::new(
19407                ".google.cloud.clouddms.v1.EntityIssue.IssueType",
19408            ))
19409        }
19410    }
19411
19412    /// Severity of issue.
19413    ///
19414    /// # Working with unknown values
19415    ///
19416    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19417    /// additional enum variants at any time. Adding new variants is not considered
19418    /// a breaking change. Applications should write their code in anticipation of:
19419    ///
19420    /// - New values appearing in future releases of the client library, **and**
19421    /// - New values received dynamically, without application changes.
19422    ///
19423    /// Please consult the [Working with enums] section in the user guide for some
19424    /// guidelines.
19425    ///
19426    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
19427    #[derive(Clone, Debug, PartialEq)]
19428    #[non_exhaustive]
19429    pub enum IssueSeverity {
19430        /// Unspecified issue severity
19431        Unspecified,
19432        /// Info
19433        Info,
19434        /// Warning
19435        Warning,
19436        /// Error
19437        Error,
19438        /// If set, the enum was initialized with an unknown value.
19439        ///
19440        /// Applications can examine the value using [IssueSeverity::value] or
19441        /// [IssueSeverity::name].
19442        UnknownValue(issue_severity::UnknownValue),
19443    }
19444
19445    #[doc(hidden)]
19446    pub mod issue_severity {
19447        #[allow(unused_imports)]
19448        use super::*;
19449        #[derive(Clone, Debug, PartialEq)]
19450        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19451    }
19452
19453    impl IssueSeverity {
19454        /// Gets the enum value.
19455        ///
19456        /// Returns `None` if the enum contains an unknown value deserialized from
19457        /// the string representation of enums.
19458        pub fn value(&self) -> std::option::Option<i32> {
19459            match self {
19460                Self::Unspecified => std::option::Option::Some(0),
19461                Self::Info => std::option::Option::Some(1),
19462                Self::Warning => std::option::Option::Some(2),
19463                Self::Error => std::option::Option::Some(3),
19464                Self::UnknownValue(u) => u.0.value(),
19465            }
19466        }
19467
19468        /// Gets the enum value as a string.
19469        ///
19470        /// Returns `None` if the enum contains an unknown value deserialized from
19471        /// the integer representation of enums.
19472        pub fn name(&self) -> std::option::Option<&str> {
19473            match self {
19474                Self::Unspecified => std::option::Option::Some("ISSUE_SEVERITY_UNSPECIFIED"),
19475                Self::Info => std::option::Option::Some("ISSUE_SEVERITY_INFO"),
19476                Self::Warning => std::option::Option::Some("ISSUE_SEVERITY_WARNING"),
19477                Self::Error => std::option::Option::Some("ISSUE_SEVERITY_ERROR"),
19478                Self::UnknownValue(u) => u.0.name(),
19479            }
19480        }
19481    }
19482
19483    impl std::default::Default for IssueSeverity {
19484        fn default() -> Self {
19485            use std::convert::From;
19486            Self::from(0)
19487        }
19488    }
19489
19490    impl std::fmt::Display for IssueSeverity {
19491        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19492            wkt::internal::display_enum(f, self.name(), self.value())
19493        }
19494    }
19495
19496    impl std::convert::From<i32> for IssueSeverity {
19497        fn from(value: i32) -> Self {
19498            match value {
19499                0 => Self::Unspecified,
19500                1 => Self::Info,
19501                2 => Self::Warning,
19502                3 => Self::Error,
19503                _ => Self::UnknownValue(issue_severity::UnknownValue(
19504                    wkt::internal::UnknownEnumValue::Integer(value),
19505                )),
19506            }
19507        }
19508    }
19509
19510    impl std::convert::From<&str> for IssueSeverity {
19511        fn from(value: &str) -> Self {
19512            use std::string::ToString;
19513            match value {
19514                "ISSUE_SEVERITY_UNSPECIFIED" => Self::Unspecified,
19515                "ISSUE_SEVERITY_INFO" => Self::Info,
19516                "ISSUE_SEVERITY_WARNING" => Self::Warning,
19517                "ISSUE_SEVERITY_ERROR" => Self::Error,
19518                _ => Self::UnknownValue(issue_severity::UnknownValue(
19519                    wkt::internal::UnknownEnumValue::String(value.to_string()),
19520                )),
19521            }
19522        }
19523    }
19524
19525    impl serde::ser::Serialize for IssueSeverity {
19526        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19527        where
19528            S: serde::Serializer,
19529        {
19530            match self {
19531                Self::Unspecified => serializer.serialize_i32(0),
19532                Self::Info => serializer.serialize_i32(1),
19533                Self::Warning => serializer.serialize_i32(2),
19534                Self::Error => serializer.serialize_i32(3),
19535                Self::UnknownValue(u) => u.0.serialize(serializer),
19536            }
19537        }
19538    }
19539
19540    impl<'de> serde::de::Deserialize<'de> for IssueSeverity {
19541        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19542        where
19543            D: serde::Deserializer<'de>,
19544        {
19545            deserializer.deserialize_any(wkt::internal::EnumVisitor::<IssueSeverity>::new(
19546                ".google.cloud.clouddms.v1.EntityIssue.IssueSeverity",
19547            ))
19548        }
19549    }
19550}
19551
19552/// AIP-157 Partial Response view for Database Entity.
19553///
19554/// # Working with unknown values
19555///
19556/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19557/// additional enum variants at any time. Adding new variants is not considered
19558/// a breaking change. Applications should write their code in anticipation of:
19559///
19560/// - New values appearing in future releases of the client library, **and**
19561/// - New values received dynamically, without application changes.
19562///
19563/// Please consult the [Working with enums] section in the user guide for some
19564/// guidelines.
19565///
19566/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
19567#[derive(Clone, Debug, PartialEq)]
19568#[non_exhaustive]
19569pub enum DatabaseEntityView {
19570    /// Unspecified view. Defaults to basic view.
19571    Unspecified,
19572    /// Default view. Does not return DDLs or Issues.
19573    Basic,
19574    /// Return full entity details including mappings, ddl and issues.
19575    Full,
19576    /// Top-most (Database, Schema) nodes which are returned contains summary
19577    /// details for their decendents such as the number of entities per type and
19578    /// issues rollups. When this view is used, only a single page of result is
19579    /// returned and the page_size property of the request is ignored. The
19580    /// returned page will only include the top-most node types.
19581    RootSummary,
19582    /// If set, the enum was initialized with an unknown value.
19583    ///
19584    /// Applications can examine the value using [DatabaseEntityView::value] or
19585    /// [DatabaseEntityView::name].
19586    UnknownValue(database_entity_view::UnknownValue),
19587}
19588
19589#[doc(hidden)]
19590pub mod database_entity_view {
19591    #[allow(unused_imports)]
19592    use super::*;
19593    #[derive(Clone, Debug, PartialEq)]
19594    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19595}
19596
19597impl DatabaseEntityView {
19598    /// Gets the enum value.
19599    ///
19600    /// Returns `None` if the enum contains an unknown value deserialized from
19601    /// the string representation of enums.
19602    pub fn value(&self) -> std::option::Option<i32> {
19603        match self {
19604            Self::Unspecified => std::option::Option::Some(0),
19605            Self::Basic => std::option::Option::Some(1),
19606            Self::Full => std::option::Option::Some(2),
19607            Self::RootSummary => std::option::Option::Some(3),
19608            Self::UnknownValue(u) => u.0.value(),
19609        }
19610    }
19611
19612    /// Gets the enum value as a string.
19613    ///
19614    /// Returns `None` if the enum contains an unknown value deserialized from
19615    /// the integer representation of enums.
19616    pub fn name(&self) -> std::option::Option<&str> {
19617        match self {
19618            Self::Unspecified => std::option::Option::Some("DATABASE_ENTITY_VIEW_UNSPECIFIED"),
19619            Self::Basic => std::option::Option::Some("DATABASE_ENTITY_VIEW_BASIC"),
19620            Self::Full => std::option::Option::Some("DATABASE_ENTITY_VIEW_FULL"),
19621            Self::RootSummary => std::option::Option::Some("DATABASE_ENTITY_VIEW_ROOT_SUMMARY"),
19622            Self::UnknownValue(u) => u.0.name(),
19623        }
19624    }
19625}
19626
19627impl std::default::Default for DatabaseEntityView {
19628    fn default() -> Self {
19629        use std::convert::From;
19630        Self::from(0)
19631    }
19632}
19633
19634impl std::fmt::Display for DatabaseEntityView {
19635    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19636        wkt::internal::display_enum(f, self.name(), self.value())
19637    }
19638}
19639
19640impl std::convert::From<i32> for DatabaseEntityView {
19641    fn from(value: i32) -> Self {
19642        match value {
19643            0 => Self::Unspecified,
19644            1 => Self::Basic,
19645            2 => Self::Full,
19646            3 => Self::RootSummary,
19647            _ => Self::UnknownValue(database_entity_view::UnknownValue(
19648                wkt::internal::UnknownEnumValue::Integer(value),
19649            )),
19650        }
19651    }
19652}
19653
19654impl std::convert::From<&str> for DatabaseEntityView {
19655    fn from(value: &str) -> Self {
19656        use std::string::ToString;
19657        match value {
19658            "DATABASE_ENTITY_VIEW_UNSPECIFIED" => Self::Unspecified,
19659            "DATABASE_ENTITY_VIEW_BASIC" => Self::Basic,
19660            "DATABASE_ENTITY_VIEW_FULL" => Self::Full,
19661            "DATABASE_ENTITY_VIEW_ROOT_SUMMARY" => Self::RootSummary,
19662            _ => Self::UnknownValue(database_entity_view::UnknownValue(
19663                wkt::internal::UnknownEnumValue::String(value.to_string()),
19664            )),
19665        }
19666    }
19667}
19668
19669impl serde::ser::Serialize for DatabaseEntityView {
19670    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19671    where
19672        S: serde::Serializer,
19673    {
19674        match self {
19675            Self::Unspecified => serializer.serialize_i32(0),
19676            Self::Basic => serializer.serialize_i32(1),
19677            Self::Full => serializer.serialize_i32(2),
19678            Self::RootSummary => serializer.serialize_i32(3),
19679            Self::UnknownValue(u) => u.0.serialize(serializer),
19680        }
19681    }
19682}
19683
19684impl<'de> serde::de::Deserialize<'de> for DatabaseEntityView {
19685    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19686    where
19687        D: serde::Deserializer<'de>,
19688    {
19689        deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseEntityView>::new(
19690            ".google.cloud.clouddms.v1.DatabaseEntityView",
19691        ))
19692    }
19693}
19694
19695///
19696/// # Working with unknown values
19697///
19698/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19699/// additional enum variants at any time. Adding new variants is not considered
19700/// a breaking change. Applications should write their code in anticipation of:
19701///
19702/// - New values appearing in future releases of the client library, **and**
19703/// - New values received dynamically, without application changes.
19704///
19705/// Please consult the [Working with enums] section in the user guide for some
19706/// guidelines.
19707///
19708/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
19709#[derive(Clone, Debug, PartialEq)]
19710#[non_exhaustive]
19711pub enum NetworkArchitecture {
19712    Unspecified,
19713    /// Instance is in Cloud SQL's old producer network architecture.
19714    OldCsqlProducer,
19715    /// Instance is in Cloud SQL's new producer network architecture.
19716    NewCsqlProducer,
19717    /// If set, the enum was initialized with an unknown value.
19718    ///
19719    /// Applications can examine the value using [NetworkArchitecture::value] or
19720    /// [NetworkArchitecture::name].
19721    UnknownValue(network_architecture::UnknownValue),
19722}
19723
19724#[doc(hidden)]
19725pub mod network_architecture {
19726    #[allow(unused_imports)]
19727    use super::*;
19728    #[derive(Clone, Debug, PartialEq)]
19729    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19730}
19731
19732impl NetworkArchitecture {
19733    /// Gets the enum value.
19734    ///
19735    /// Returns `None` if the enum contains an unknown value deserialized from
19736    /// the string representation of enums.
19737    pub fn value(&self) -> std::option::Option<i32> {
19738        match self {
19739            Self::Unspecified => std::option::Option::Some(0),
19740            Self::OldCsqlProducer => std::option::Option::Some(1),
19741            Self::NewCsqlProducer => std::option::Option::Some(2),
19742            Self::UnknownValue(u) => u.0.value(),
19743        }
19744    }
19745
19746    /// Gets the enum value as a string.
19747    ///
19748    /// Returns `None` if the enum contains an unknown value deserialized from
19749    /// the integer representation of enums.
19750    pub fn name(&self) -> std::option::Option<&str> {
19751        match self {
19752            Self::Unspecified => std::option::Option::Some("NETWORK_ARCHITECTURE_UNSPECIFIED"),
19753            Self::OldCsqlProducer => {
19754                std::option::Option::Some("NETWORK_ARCHITECTURE_OLD_CSQL_PRODUCER")
19755            }
19756            Self::NewCsqlProducer => {
19757                std::option::Option::Some("NETWORK_ARCHITECTURE_NEW_CSQL_PRODUCER")
19758            }
19759            Self::UnknownValue(u) => u.0.name(),
19760        }
19761    }
19762}
19763
19764impl std::default::Default for NetworkArchitecture {
19765    fn default() -> Self {
19766        use std::convert::From;
19767        Self::from(0)
19768    }
19769}
19770
19771impl std::fmt::Display for NetworkArchitecture {
19772    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19773        wkt::internal::display_enum(f, self.name(), self.value())
19774    }
19775}
19776
19777impl std::convert::From<i32> for NetworkArchitecture {
19778    fn from(value: i32) -> Self {
19779        match value {
19780            0 => Self::Unspecified,
19781            1 => Self::OldCsqlProducer,
19782            2 => Self::NewCsqlProducer,
19783            _ => Self::UnknownValue(network_architecture::UnknownValue(
19784                wkt::internal::UnknownEnumValue::Integer(value),
19785            )),
19786        }
19787    }
19788}
19789
19790impl std::convert::From<&str> for NetworkArchitecture {
19791    fn from(value: &str) -> Self {
19792        use std::string::ToString;
19793        match value {
19794            "NETWORK_ARCHITECTURE_UNSPECIFIED" => Self::Unspecified,
19795            "NETWORK_ARCHITECTURE_OLD_CSQL_PRODUCER" => Self::OldCsqlProducer,
19796            "NETWORK_ARCHITECTURE_NEW_CSQL_PRODUCER" => Self::NewCsqlProducer,
19797            _ => Self::UnknownValue(network_architecture::UnknownValue(
19798                wkt::internal::UnknownEnumValue::String(value.to_string()),
19799            )),
19800        }
19801    }
19802}
19803
19804impl serde::ser::Serialize for NetworkArchitecture {
19805    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19806    where
19807        S: serde::Serializer,
19808    {
19809        match self {
19810            Self::Unspecified => serializer.serialize_i32(0),
19811            Self::OldCsqlProducer => serializer.serialize_i32(1),
19812            Self::NewCsqlProducer => serializer.serialize_i32(2),
19813            Self::UnknownValue(u) => u.0.serialize(serializer),
19814        }
19815    }
19816}
19817
19818impl<'de> serde::de::Deserialize<'de> for NetworkArchitecture {
19819    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19820    where
19821        D: serde::Deserializer<'de>,
19822    {
19823        deserializer.deserialize_any(wkt::internal::EnumVisitor::<NetworkArchitecture>::new(
19824            ".google.cloud.clouddms.v1.NetworkArchitecture",
19825        ))
19826    }
19827}
19828
19829/// The database engine types.
19830///
19831/// # Working with unknown values
19832///
19833/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19834/// additional enum variants at any time. Adding new variants is not considered
19835/// a breaking change. Applications should write their code in anticipation of:
19836///
19837/// - New values appearing in future releases of the client library, **and**
19838/// - New values received dynamically, without application changes.
19839///
19840/// Please consult the [Working with enums] section in the user guide for some
19841/// guidelines.
19842///
19843/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
19844#[derive(Clone, Debug, PartialEq)]
19845#[non_exhaustive]
19846pub enum DatabaseEngine {
19847    /// The source database engine of the migration job is unknown.
19848    Unspecified,
19849    /// The source engine is MySQL.
19850    Mysql,
19851    /// The source engine is PostgreSQL.
19852    Postgresql,
19853    /// The source engine is Oracle.
19854    Oracle,
19855    /// If set, the enum was initialized with an unknown value.
19856    ///
19857    /// Applications can examine the value using [DatabaseEngine::value] or
19858    /// [DatabaseEngine::name].
19859    UnknownValue(database_engine::UnknownValue),
19860}
19861
19862#[doc(hidden)]
19863pub mod database_engine {
19864    #[allow(unused_imports)]
19865    use super::*;
19866    #[derive(Clone, Debug, PartialEq)]
19867    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19868}
19869
19870impl DatabaseEngine {
19871    /// Gets the enum value.
19872    ///
19873    /// Returns `None` if the enum contains an unknown value deserialized from
19874    /// the string representation of enums.
19875    pub fn value(&self) -> std::option::Option<i32> {
19876        match self {
19877            Self::Unspecified => std::option::Option::Some(0),
19878            Self::Mysql => std::option::Option::Some(1),
19879            Self::Postgresql => std::option::Option::Some(2),
19880            Self::Oracle => std::option::Option::Some(4),
19881            Self::UnknownValue(u) => u.0.value(),
19882        }
19883    }
19884
19885    /// Gets the enum value as a string.
19886    ///
19887    /// Returns `None` if the enum contains an unknown value deserialized from
19888    /// the integer representation of enums.
19889    pub fn name(&self) -> std::option::Option<&str> {
19890        match self {
19891            Self::Unspecified => std::option::Option::Some("DATABASE_ENGINE_UNSPECIFIED"),
19892            Self::Mysql => std::option::Option::Some("MYSQL"),
19893            Self::Postgresql => std::option::Option::Some("POSTGRESQL"),
19894            Self::Oracle => std::option::Option::Some("ORACLE"),
19895            Self::UnknownValue(u) => u.0.name(),
19896        }
19897    }
19898}
19899
19900impl std::default::Default for DatabaseEngine {
19901    fn default() -> Self {
19902        use std::convert::From;
19903        Self::from(0)
19904    }
19905}
19906
19907impl std::fmt::Display for DatabaseEngine {
19908    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19909        wkt::internal::display_enum(f, self.name(), self.value())
19910    }
19911}
19912
19913impl std::convert::From<i32> for DatabaseEngine {
19914    fn from(value: i32) -> Self {
19915        match value {
19916            0 => Self::Unspecified,
19917            1 => Self::Mysql,
19918            2 => Self::Postgresql,
19919            4 => Self::Oracle,
19920            _ => Self::UnknownValue(database_engine::UnknownValue(
19921                wkt::internal::UnknownEnumValue::Integer(value),
19922            )),
19923        }
19924    }
19925}
19926
19927impl std::convert::From<&str> for DatabaseEngine {
19928    fn from(value: &str) -> Self {
19929        use std::string::ToString;
19930        match value {
19931            "DATABASE_ENGINE_UNSPECIFIED" => Self::Unspecified,
19932            "MYSQL" => Self::Mysql,
19933            "POSTGRESQL" => Self::Postgresql,
19934            "ORACLE" => Self::Oracle,
19935            _ => Self::UnknownValue(database_engine::UnknownValue(
19936                wkt::internal::UnknownEnumValue::String(value.to_string()),
19937            )),
19938        }
19939    }
19940}
19941
19942impl serde::ser::Serialize for DatabaseEngine {
19943    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19944    where
19945        S: serde::Serializer,
19946    {
19947        match self {
19948            Self::Unspecified => serializer.serialize_i32(0),
19949            Self::Mysql => serializer.serialize_i32(1),
19950            Self::Postgresql => serializer.serialize_i32(2),
19951            Self::Oracle => serializer.serialize_i32(4),
19952            Self::UnknownValue(u) => u.0.serialize(serializer),
19953        }
19954    }
19955}
19956
19957impl<'de> serde::de::Deserialize<'de> for DatabaseEngine {
19958    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19959    where
19960        D: serde::Deserializer<'de>,
19961    {
19962        deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseEngine>::new(
19963            ".google.cloud.clouddms.v1.DatabaseEngine",
19964        ))
19965    }
19966}
19967
19968/// The database providers.
19969///
19970/// # Working with unknown values
19971///
19972/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19973/// additional enum variants at any time. Adding new variants is not considered
19974/// a breaking change. Applications should write their code in anticipation of:
19975///
19976/// - New values appearing in future releases of the client library, **and**
19977/// - New values received dynamically, without application changes.
19978///
19979/// Please consult the [Working with enums] section in the user guide for some
19980/// guidelines.
19981///
19982/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
19983#[derive(Clone, Debug, PartialEq)]
19984#[non_exhaustive]
19985pub enum DatabaseProvider {
19986    /// The database provider is unknown.
19987    Unspecified,
19988    /// CloudSQL runs the database.
19989    Cloudsql,
19990    /// RDS runs the database.
19991    Rds,
19992    /// Amazon Aurora.
19993    Aurora,
19994    /// AlloyDB.
19995    Alloydb,
19996    /// If set, the enum was initialized with an unknown value.
19997    ///
19998    /// Applications can examine the value using [DatabaseProvider::value] or
19999    /// [DatabaseProvider::name].
20000    UnknownValue(database_provider::UnknownValue),
20001}
20002
20003#[doc(hidden)]
20004pub mod database_provider {
20005    #[allow(unused_imports)]
20006    use super::*;
20007    #[derive(Clone, Debug, PartialEq)]
20008    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
20009}
20010
20011impl DatabaseProvider {
20012    /// Gets the enum value.
20013    ///
20014    /// Returns `None` if the enum contains an unknown value deserialized from
20015    /// the string representation of enums.
20016    pub fn value(&self) -> std::option::Option<i32> {
20017        match self {
20018            Self::Unspecified => std::option::Option::Some(0),
20019            Self::Cloudsql => std::option::Option::Some(1),
20020            Self::Rds => std::option::Option::Some(2),
20021            Self::Aurora => std::option::Option::Some(3),
20022            Self::Alloydb => std::option::Option::Some(4),
20023            Self::UnknownValue(u) => u.0.value(),
20024        }
20025    }
20026
20027    /// Gets the enum value as a string.
20028    ///
20029    /// Returns `None` if the enum contains an unknown value deserialized from
20030    /// the integer representation of enums.
20031    pub fn name(&self) -> std::option::Option<&str> {
20032        match self {
20033            Self::Unspecified => std::option::Option::Some("DATABASE_PROVIDER_UNSPECIFIED"),
20034            Self::Cloudsql => std::option::Option::Some("CLOUDSQL"),
20035            Self::Rds => std::option::Option::Some("RDS"),
20036            Self::Aurora => std::option::Option::Some("AURORA"),
20037            Self::Alloydb => std::option::Option::Some("ALLOYDB"),
20038            Self::UnknownValue(u) => u.0.name(),
20039        }
20040    }
20041}
20042
20043impl std::default::Default for DatabaseProvider {
20044    fn default() -> Self {
20045        use std::convert::From;
20046        Self::from(0)
20047    }
20048}
20049
20050impl std::fmt::Display for DatabaseProvider {
20051    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20052        wkt::internal::display_enum(f, self.name(), self.value())
20053    }
20054}
20055
20056impl std::convert::From<i32> for DatabaseProvider {
20057    fn from(value: i32) -> Self {
20058        match value {
20059            0 => Self::Unspecified,
20060            1 => Self::Cloudsql,
20061            2 => Self::Rds,
20062            3 => Self::Aurora,
20063            4 => Self::Alloydb,
20064            _ => Self::UnknownValue(database_provider::UnknownValue(
20065                wkt::internal::UnknownEnumValue::Integer(value),
20066            )),
20067        }
20068    }
20069}
20070
20071impl std::convert::From<&str> for DatabaseProvider {
20072    fn from(value: &str) -> Self {
20073        use std::string::ToString;
20074        match value {
20075            "DATABASE_PROVIDER_UNSPECIFIED" => Self::Unspecified,
20076            "CLOUDSQL" => Self::Cloudsql,
20077            "RDS" => Self::Rds,
20078            "AURORA" => Self::Aurora,
20079            "ALLOYDB" => Self::Alloydb,
20080            _ => Self::UnknownValue(database_provider::UnknownValue(
20081                wkt::internal::UnknownEnumValue::String(value.to_string()),
20082            )),
20083        }
20084    }
20085}
20086
20087impl serde::ser::Serialize for DatabaseProvider {
20088    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20089    where
20090        S: serde::Serializer,
20091    {
20092        match self {
20093            Self::Unspecified => serializer.serialize_i32(0),
20094            Self::Cloudsql => serializer.serialize_i32(1),
20095            Self::Rds => serializer.serialize_i32(2),
20096            Self::Aurora => serializer.serialize_i32(3),
20097            Self::Alloydb => serializer.serialize_i32(4),
20098            Self::UnknownValue(u) => u.0.serialize(serializer),
20099        }
20100    }
20101}
20102
20103impl<'de> serde::de::Deserialize<'de> for DatabaseProvider {
20104    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20105    where
20106        D: serde::Deserializer<'de>,
20107    {
20108        deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseProvider>::new(
20109            ".google.cloud.clouddms.v1.DatabaseProvider",
20110        ))
20111    }
20112}
20113
20114/// Enum used by ValueListFilter to indicate whether the source value is in the
20115/// supplied list
20116///
20117/// # Working with unknown values
20118///
20119/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
20120/// additional enum variants at any time. Adding new variants is not considered
20121/// a breaking change. Applications should write their code in anticipation of:
20122///
20123/// - New values appearing in future releases of the client library, **and**
20124/// - New values received dynamically, without application changes.
20125///
20126/// Please consult the [Working with enums] section in the user guide for some
20127/// guidelines.
20128///
20129/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
20130#[derive(Clone, Debug, PartialEq)]
20131#[non_exhaustive]
20132pub enum ValuePresentInList {
20133    /// Value present in list unspecified
20134    Unspecified,
20135    /// If the source value is in the supplied list at value_list
20136    IfValueList,
20137    /// If the source value is not in the supplied list at value_list
20138    IfValueNotList,
20139    /// If set, the enum was initialized with an unknown value.
20140    ///
20141    /// Applications can examine the value using [ValuePresentInList::value] or
20142    /// [ValuePresentInList::name].
20143    UnknownValue(value_present_in_list::UnknownValue),
20144}
20145
20146#[doc(hidden)]
20147pub mod value_present_in_list {
20148    #[allow(unused_imports)]
20149    use super::*;
20150    #[derive(Clone, Debug, PartialEq)]
20151    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
20152}
20153
20154impl ValuePresentInList {
20155    /// Gets the enum value.
20156    ///
20157    /// Returns `None` if the enum contains an unknown value deserialized from
20158    /// the string representation of enums.
20159    pub fn value(&self) -> std::option::Option<i32> {
20160        match self {
20161            Self::Unspecified => std::option::Option::Some(0),
20162            Self::IfValueList => std::option::Option::Some(1),
20163            Self::IfValueNotList => std::option::Option::Some(2),
20164            Self::UnknownValue(u) => u.0.value(),
20165        }
20166    }
20167
20168    /// Gets the enum value as a string.
20169    ///
20170    /// Returns `None` if the enum contains an unknown value deserialized from
20171    /// the integer representation of enums.
20172    pub fn name(&self) -> std::option::Option<&str> {
20173        match self {
20174            Self::Unspecified => std::option::Option::Some("VALUE_PRESENT_IN_LIST_UNSPECIFIED"),
20175            Self::IfValueList => std::option::Option::Some("VALUE_PRESENT_IN_LIST_IF_VALUE_LIST"),
20176            Self::IfValueNotList => {
20177                std::option::Option::Some("VALUE_PRESENT_IN_LIST_IF_VALUE_NOT_LIST")
20178            }
20179            Self::UnknownValue(u) => u.0.name(),
20180        }
20181    }
20182}
20183
20184impl std::default::Default for ValuePresentInList {
20185    fn default() -> Self {
20186        use std::convert::From;
20187        Self::from(0)
20188    }
20189}
20190
20191impl std::fmt::Display for ValuePresentInList {
20192    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20193        wkt::internal::display_enum(f, self.name(), self.value())
20194    }
20195}
20196
20197impl std::convert::From<i32> for ValuePresentInList {
20198    fn from(value: i32) -> Self {
20199        match value {
20200            0 => Self::Unspecified,
20201            1 => Self::IfValueList,
20202            2 => Self::IfValueNotList,
20203            _ => Self::UnknownValue(value_present_in_list::UnknownValue(
20204                wkt::internal::UnknownEnumValue::Integer(value),
20205            )),
20206        }
20207    }
20208}
20209
20210impl std::convert::From<&str> for ValuePresentInList {
20211    fn from(value: &str) -> Self {
20212        use std::string::ToString;
20213        match value {
20214            "VALUE_PRESENT_IN_LIST_UNSPECIFIED" => Self::Unspecified,
20215            "VALUE_PRESENT_IN_LIST_IF_VALUE_LIST" => Self::IfValueList,
20216            "VALUE_PRESENT_IN_LIST_IF_VALUE_NOT_LIST" => Self::IfValueNotList,
20217            _ => Self::UnknownValue(value_present_in_list::UnknownValue(
20218                wkt::internal::UnknownEnumValue::String(value.to_string()),
20219            )),
20220        }
20221    }
20222}
20223
20224impl serde::ser::Serialize for ValuePresentInList {
20225    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20226    where
20227        S: serde::Serializer,
20228    {
20229        match self {
20230            Self::Unspecified => serializer.serialize_i32(0),
20231            Self::IfValueList => serializer.serialize_i32(1),
20232            Self::IfValueNotList => serializer.serialize_i32(2),
20233            Self::UnknownValue(u) => u.0.serialize(serializer),
20234        }
20235    }
20236}
20237
20238impl<'de> serde::de::Deserialize<'de> for ValuePresentInList {
20239    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20240    where
20241        D: serde::Deserializer<'de>,
20242    {
20243        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ValuePresentInList>::new(
20244            ".google.cloud.clouddms.v1.ValuePresentInList",
20245        ))
20246    }
20247}
20248
20249/// The type of database entities supported,
20250///
20251/// # Working with unknown values
20252///
20253/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
20254/// additional enum variants at any time. Adding new variants is not considered
20255/// a breaking change. Applications should write their code in anticipation of:
20256///
20257/// - New values appearing in future releases of the client library, **and**
20258/// - New values received dynamically, without application changes.
20259///
20260/// Please consult the [Working with enums] section in the user guide for some
20261/// guidelines.
20262///
20263/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
20264#[derive(Clone, Debug, PartialEq)]
20265#[non_exhaustive]
20266pub enum DatabaseEntityType {
20267    /// Unspecified database entity type.
20268    Unspecified,
20269    /// Schema.
20270    Schema,
20271    /// Table.
20272    Table,
20273    /// Column.
20274    Column,
20275    /// Constraint.
20276    Constraint,
20277    /// Index.
20278    Index,
20279    /// Trigger.
20280    Trigger,
20281    /// View.
20282    View,
20283    /// Sequence.
20284    Sequence,
20285    /// Stored Procedure.
20286    StoredProcedure,
20287    /// Function.
20288    Function,
20289    /// Synonym.
20290    Synonym,
20291    /// Package.
20292    DatabasePackage,
20293    /// UDT.
20294    Udt,
20295    /// Materialized View.
20296    MaterializedView,
20297    /// Database.
20298    Database,
20299    /// If set, the enum was initialized with an unknown value.
20300    ///
20301    /// Applications can examine the value using [DatabaseEntityType::value] or
20302    /// [DatabaseEntityType::name].
20303    UnknownValue(database_entity_type::UnknownValue),
20304}
20305
20306#[doc(hidden)]
20307pub mod database_entity_type {
20308    #[allow(unused_imports)]
20309    use super::*;
20310    #[derive(Clone, Debug, PartialEq)]
20311    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
20312}
20313
20314impl DatabaseEntityType {
20315    /// Gets the enum value.
20316    ///
20317    /// Returns `None` if the enum contains an unknown value deserialized from
20318    /// the string representation of enums.
20319    pub fn value(&self) -> std::option::Option<i32> {
20320        match self {
20321            Self::Unspecified => std::option::Option::Some(0),
20322            Self::Schema => std::option::Option::Some(1),
20323            Self::Table => std::option::Option::Some(2),
20324            Self::Column => std::option::Option::Some(3),
20325            Self::Constraint => std::option::Option::Some(4),
20326            Self::Index => std::option::Option::Some(5),
20327            Self::Trigger => std::option::Option::Some(6),
20328            Self::View => std::option::Option::Some(7),
20329            Self::Sequence => std::option::Option::Some(8),
20330            Self::StoredProcedure => std::option::Option::Some(9),
20331            Self::Function => std::option::Option::Some(10),
20332            Self::Synonym => std::option::Option::Some(11),
20333            Self::DatabasePackage => std::option::Option::Some(12),
20334            Self::Udt => std::option::Option::Some(13),
20335            Self::MaterializedView => std::option::Option::Some(14),
20336            Self::Database => std::option::Option::Some(15),
20337            Self::UnknownValue(u) => u.0.value(),
20338        }
20339    }
20340
20341    /// Gets the enum value as a string.
20342    ///
20343    /// Returns `None` if the enum contains an unknown value deserialized from
20344    /// the integer representation of enums.
20345    pub fn name(&self) -> std::option::Option<&str> {
20346        match self {
20347            Self::Unspecified => std::option::Option::Some("DATABASE_ENTITY_TYPE_UNSPECIFIED"),
20348            Self::Schema => std::option::Option::Some("DATABASE_ENTITY_TYPE_SCHEMA"),
20349            Self::Table => std::option::Option::Some("DATABASE_ENTITY_TYPE_TABLE"),
20350            Self::Column => std::option::Option::Some("DATABASE_ENTITY_TYPE_COLUMN"),
20351            Self::Constraint => std::option::Option::Some("DATABASE_ENTITY_TYPE_CONSTRAINT"),
20352            Self::Index => std::option::Option::Some("DATABASE_ENTITY_TYPE_INDEX"),
20353            Self::Trigger => std::option::Option::Some("DATABASE_ENTITY_TYPE_TRIGGER"),
20354            Self::View => std::option::Option::Some("DATABASE_ENTITY_TYPE_VIEW"),
20355            Self::Sequence => std::option::Option::Some("DATABASE_ENTITY_TYPE_SEQUENCE"),
20356            Self::StoredProcedure => {
20357                std::option::Option::Some("DATABASE_ENTITY_TYPE_STORED_PROCEDURE")
20358            }
20359            Self::Function => std::option::Option::Some("DATABASE_ENTITY_TYPE_FUNCTION"),
20360            Self::Synonym => std::option::Option::Some("DATABASE_ENTITY_TYPE_SYNONYM"),
20361            Self::DatabasePackage => {
20362                std::option::Option::Some("DATABASE_ENTITY_TYPE_DATABASE_PACKAGE")
20363            }
20364            Self::Udt => std::option::Option::Some("DATABASE_ENTITY_TYPE_UDT"),
20365            Self::MaterializedView => {
20366                std::option::Option::Some("DATABASE_ENTITY_TYPE_MATERIALIZED_VIEW")
20367            }
20368            Self::Database => std::option::Option::Some("DATABASE_ENTITY_TYPE_DATABASE"),
20369            Self::UnknownValue(u) => u.0.name(),
20370        }
20371    }
20372}
20373
20374impl std::default::Default for DatabaseEntityType {
20375    fn default() -> Self {
20376        use std::convert::From;
20377        Self::from(0)
20378    }
20379}
20380
20381impl std::fmt::Display for DatabaseEntityType {
20382    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20383        wkt::internal::display_enum(f, self.name(), self.value())
20384    }
20385}
20386
20387impl std::convert::From<i32> for DatabaseEntityType {
20388    fn from(value: i32) -> Self {
20389        match value {
20390            0 => Self::Unspecified,
20391            1 => Self::Schema,
20392            2 => Self::Table,
20393            3 => Self::Column,
20394            4 => Self::Constraint,
20395            5 => Self::Index,
20396            6 => Self::Trigger,
20397            7 => Self::View,
20398            8 => Self::Sequence,
20399            9 => Self::StoredProcedure,
20400            10 => Self::Function,
20401            11 => Self::Synonym,
20402            12 => Self::DatabasePackage,
20403            13 => Self::Udt,
20404            14 => Self::MaterializedView,
20405            15 => Self::Database,
20406            _ => Self::UnknownValue(database_entity_type::UnknownValue(
20407                wkt::internal::UnknownEnumValue::Integer(value),
20408            )),
20409        }
20410    }
20411}
20412
20413impl std::convert::From<&str> for DatabaseEntityType {
20414    fn from(value: &str) -> Self {
20415        use std::string::ToString;
20416        match value {
20417            "DATABASE_ENTITY_TYPE_UNSPECIFIED" => Self::Unspecified,
20418            "DATABASE_ENTITY_TYPE_SCHEMA" => Self::Schema,
20419            "DATABASE_ENTITY_TYPE_TABLE" => Self::Table,
20420            "DATABASE_ENTITY_TYPE_COLUMN" => Self::Column,
20421            "DATABASE_ENTITY_TYPE_CONSTRAINT" => Self::Constraint,
20422            "DATABASE_ENTITY_TYPE_INDEX" => Self::Index,
20423            "DATABASE_ENTITY_TYPE_TRIGGER" => Self::Trigger,
20424            "DATABASE_ENTITY_TYPE_VIEW" => Self::View,
20425            "DATABASE_ENTITY_TYPE_SEQUENCE" => Self::Sequence,
20426            "DATABASE_ENTITY_TYPE_STORED_PROCEDURE" => Self::StoredProcedure,
20427            "DATABASE_ENTITY_TYPE_FUNCTION" => Self::Function,
20428            "DATABASE_ENTITY_TYPE_SYNONYM" => Self::Synonym,
20429            "DATABASE_ENTITY_TYPE_DATABASE_PACKAGE" => Self::DatabasePackage,
20430            "DATABASE_ENTITY_TYPE_UDT" => Self::Udt,
20431            "DATABASE_ENTITY_TYPE_MATERIALIZED_VIEW" => Self::MaterializedView,
20432            "DATABASE_ENTITY_TYPE_DATABASE" => Self::Database,
20433            _ => Self::UnknownValue(database_entity_type::UnknownValue(
20434                wkt::internal::UnknownEnumValue::String(value.to_string()),
20435            )),
20436        }
20437    }
20438}
20439
20440impl serde::ser::Serialize for DatabaseEntityType {
20441    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20442    where
20443        S: serde::Serializer,
20444    {
20445        match self {
20446            Self::Unspecified => serializer.serialize_i32(0),
20447            Self::Schema => serializer.serialize_i32(1),
20448            Self::Table => serializer.serialize_i32(2),
20449            Self::Column => serializer.serialize_i32(3),
20450            Self::Constraint => serializer.serialize_i32(4),
20451            Self::Index => serializer.serialize_i32(5),
20452            Self::Trigger => serializer.serialize_i32(6),
20453            Self::View => serializer.serialize_i32(7),
20454            Self::Sequence => serializer.serialize_i32(8),
20455            Self::StoredProcedure => serializer.serialize_i32(9),
20456            Self::Function => serializer.serialize_i32(10),
20457            Self::Synonym => serializer.serialize_i32(11),
20458            Self::DatabasePackage => serializer.serialize_i32(12),
20459            Self::Udt => serializer.serialize_i32(13),
20460            Self::MaterializedView => serializer.serialize_i32(14),
20461            Self::Database => serializer.serialize_i32(15),
20462            Self::UnknownValue(u) => u.0.serialize(serializer),
20463        }
20464    }
20465}
20466
20467impl<'de> serde::de::Deserialize<'de> for DatabaseEntityType {
20468    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20469    where
20470        D: serde::Deserializer<'de>,
20471    {
20472        deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseEntityType>::new(
20473            ".google.cloud.clouddms.v1.DatabaseEntityType",
20474        ))
20475    }
20476}
20477
20478/// Entity Name Transformation Types
20479///
20480/// # Working with unknown values
20481///
20482/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
20483/// additional enum variants at any time. Adding new variants is not considered
20484/// a breaking change. Applications should write their code in anticipation of:
20485///
20486/// - New values appearing in future releases of the client library, **and**
20487/// - New values received dynamically, without application changes.
20488///
20489/// Please consult the [Working with enums] section in the user guide for some
20490/// guidelines.
20491///
20492/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
20493#[derive(Clone, Debug, PartialEq)]
20494#[non_exhaustive]
20495pub enum EntityNameTransformation {
20496    /// Entity name transformation unspecified.
20497    Unspecified,
20498    /// No transformation.
20499    NoTransformation,
20500    /// Transform to lower case.
20501    LowerCase,
20502    /// Transform to upper case.
20503    UpperCase,
20504    /// Transform to capitalized case.
20505    CapitalizedCase,
20506    /// If set, the enum was initialized with an unknown value.
20507    ///
20508    /// Applications can examine the value using [EntityNameTransformation::value] or
20509    /// [EntityNameTransformation::name].
20510    UnknownValue(entity_name_transformation::UnknownValue),
20511}
20512
20513#[doc(hidden)]
20514pub mod entity_name_transformation {
20515    #[allow(unused_imports)]
20516    use super::*;
20517    #[derive(Clone, Debug, PartialEq)]
20518    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
20519}
20520
20521impl EntityNameTransformation {
20522    /// Gets the enum value.
20523    ///
20524    /// Returns `None` if the enum contains an unknown value deserialized from
20525    /// the string representation of enums.
20526    pub fn value(&self) -> std::option::Option<i32> {
20527        match self {
20528            Self::Unspecified => std::option::Option::Some(0),
20529            Self::NoTransformation => std::option::Option::Some(1),
20530            Self::LowerCase => std::option::Option::Some(2),
20531            Self::UpperCase => std::option::Option::Some(3),
20532            Self::CapitalizedCase => std::option::Option::Some(4),
20533            Self::UnknownValue(u) => u.0.value(),
20534        }
20535    }
20536
20537    /// Gets the enum value as a string.
20538    ///
20539    /// Returns `None` if the enum contains an unknown value deserialized from
20540    /// the integer representation of enums.
20541    pub fn name(&self) -> std::option::Option<&str> {
20542        match self {
20543            Self::Unspecified => {
20544                std::option::Option::Some("ENTITY_NAME_TRANSFORMATION_UNSPECIFIED")
20545            }
20546            Self::NoTransformation => {
20547                std::option::Option::Some("ENTITY_NAME_TRANSFORMATION_NO_TRANSFORMATION")
20548            }
20549            Self::LowerCase => std::option::Option::Some("ENTITY_NAME_TRANSFORMATION_LOWER_CASE"),
20550            Self::UpperCase => std::option::Option::Some("ENTITY_NAME_TRANSFORMATION_UPPER_CASE"),
20551            Self::CapitalizedCase => {
20552                std::option::Option::Some("ENTITY_NAME_TRANSFORMATION_CAPITALIZED_CASE")
20553            }
20554            Self::UnknownValue(u) => u.0.name(),
20555        }
20556    }
20557}
20558
20559impl std::default::Default for EntityNameTransformation {
20560    fn default() -> Self {
20561        use std::convert::From;
20562        Self::from(0)
20563    }
20564}
20565
20566impl std::fmt::Display for EntityNameTransformation {
20567    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20568        wkt::internal::display_enum(f, self.name(), self.value())
20569    }
20570}
20571
20572impl std::convert::From<i32> for EntityNameTransformation {
20573    fn from(value: i32) -> Self {
20574        match value {
20575            0 => Self::Unspecified,
20576            1 => Self::NoTransformation,
20577            2 => Self::LowerCase,
20578            3 => Self::UpperCase,
20579            4 => Self::CapitalizedCase,
20580            _ => Self::UnknownValue(entity_name_transformation::UnknownValue(
20581                wkt::internal::UnknownEnumValue::Integer(value),
20582            )),
20583        }
20584    }
20585}
20586
20587impl std::convert::From<&str> for EntityNameTransformation {
20588    fn from(value: &str) -> Self {
20589        use std::string::ToString;
20590        match value {
20591            "ENTITY_NAME_TRANSFORMATION_UNSPECIFIED" => Self::Unspecified,
20592            "ENTITY_NAME_TRANSFORMATION_NO_TRANSFORMATION" => Self::NoTransformation,
20593            "ENTITY_NAME_TRANSFORMATION_LOWER_CASE" => Self::LowerCase,
20594            "ENTITY_NAME_TRANSFORMATION_UPPER_CASE" => Self::UpperCase,
20595            "ENTITY_NAME_TRANSFORMATION_CAPITALIZED_CASE" => Self::CapitalizedCase,
20596            _ => Self::UnknownValue(entity_name_transformation::UnknownValue(
20597                wkt::internal::UnknownEnumValue::String(value.to_string()),
20598            )),
20599        }
20600    }
20601}
20602
20603impl serde::ser::Serialize for EntityNameTransformation {
20604    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20605    where
20606        S: serde::Serializer,
20607    {
20608        match self {
20609            Self::Unspecified => serializer.serialize_i32(0),
20610            Self::NoTransformation => serializer.serialize_i32(1),
20611            Self::LowerCase => serializer.serialize_i32(2),
20612            Self::UpperCase => serializer.serialize_i32(3),
20613            Self::CapitalizedCase => serializer.serialize_i32(4),
20614            Self::UnknownValue(u) => u.0.serialize(serializer),
20615        }
20616    }
20617}
20618
20619impl<'de> serde::de::Deserialize<'de> for EntityNameTransformation {
20620    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20621    where
20622        D: serde::Deserializer<'de>,
20623    {
20624        deserializer.deserialize_any(wkt::internal::EnumVisitor::<EntityNameTransformation>::new(
20625            ".google.cloud.clouddms.v1.EntityNameTransformation",
20626        ))
20627    }
20628}
20629
20630/// The types of jobs that can be executed in the background.
20631///
20632/// # Working with unknown values
20633///
20634/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
20635/// additional enum variants at any time. Adding new variants is not considered
20636/// a breaking change. Applications should write their code in anticipation of:
20637///
20638/// - New values appearing in future releases of the client library, **and**
20639/// - New values received dynamically, without application changes.
20640///
20641/// Please consult the [Working with enums] section in the user guide for some
20642/// guidelines.
20643///
20644/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
20645#[derive(Clone, Debug, PartialEq)]
20646#[non_exhaustive]
20647pub enum BackgroundJobType {
20648    /// Unspecified background job type.
20649    Unspecified,
20650    /// Job to seed from the source database.
20651    SourceSeed,
20652    /// Job to convert the source database into a draft of the destination
20653    /// database.
20654    Convert,
20655    /// Job to apply the draft tree onto the destination.
20656    ApplyDestination,
20657    /// Job to import and convert mapping rules from an external source such as an
20658    /// ora2pg config file.
20659    ImportRulesFile,
20660    /// If set, the enum was initialized with an unknown value.
20661    ///
20662    /// Applications can examine the value using [BackgroundJobType::value] or
20663    /// [BackgroundJobType::name].
20664    UnknownValue(background_job_type::UnknownValue),
20665}
20666
20667#[doc(hidden)]
20668pub mod background_job_type {
20669    #[allow(unused_imports)]
20670    use super::*;
20671    #[derive(Clone, Debug, PartialEq)]
20672    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
20673}
20674
20675impl BackgroundJobType {
20676    /// Gets the enum value.
20677    ///
20678    /// Returns `None` if the enum contains an unknown value deserialized from
20679    /// the string representation of enums.
20680    pub fn value(&self) -> std::option::Option<i32> {
20681        match self {
20682            Self::Unspecified => std::option::Option::Some(0),
20683            Self::SourceSeed => std::option::Option::Some(1),
20684            Self::Convert => std::option::Option::Some(2),
20685            Self::ApplyDestination => std::option::Option::Some(3),
20686            Self::ImportRulesFile => std::option::Option::Some(5),
20687            Self::UnknownValue(u) => u.0.value(),
20688        }
20689    }
20690
20691    /// Gets the enum value as a string.
20692    ///
20693    /// Returns `None` if the enum contains an unknown value deserialized from
20694    /// the integer representation of enums.
20695    pub fn name(&self) -> std::option::Option<&str> {
20696        match self {
20697            Self::Unspecified => std::option::Option::Some("BACKGROUND_JOB_TYPE_UNSPECIFIED"),
20698            Self::SourceSeed => std::option::Option::Some("BACKGROUND_JOB_TYPE_SOURCE_SEED"),
20699            Self::Convert => std::option::Option::Some("BACKGROUND_JOB_TYPE_CONVERT"),
20700            Self::ApplyDestination => {
20701                std::option::Option::Some("BACKGROUND_JOB_TYPE_APPLY_DESTINATION")
20702            }
20703            Self::ImportRulesFile => {
20704                std::option::Option::Some("BACKGROUND_JOB_TYPE_IMPORT_RULES_FILE")
20705            }
20706            Self::UnknownValue(u) => u.0.name(),
20707        }
20708    }
20709}
20710
20711impl std::default::Default for BackgroundJobType {
20712    fn default() -> Self {
20713        use std::convert::From;
20714        Self::from(0)
20715    }
20716}
20717
20718impl std::fmt::Display for BackgroundJobType {
20719    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20720        wkt::internal::display_enum(f, self.name(), self.value())
20721    }
20722}
20723
20724impl std::convert::From<i32> for BackgroundJobType {
20725    fn from(value: i32) -> Self {
20726        match value {
20727            0 => Self::Unspecified,
20728            1 => Self::SourceSeed,
20729            2 => Self::Convert,
20730            3 => Self::ApplyDestination,
20731            5 => Self::ImportRulesFile,
20732            _ => Self::UnknownValue(background_job_type::UnknownValue(
20733                wkt::internal::UnknownEnumValue::Integer(value),
20734            )),
20735        }
20736    }
20737}
20738
20739impl std::convert::From<&str> for BackgroundJobType {
20740    fn from(value: &str) -> Self {
20741        use std::string::ToString;
20742        match value {
20743            "BACKGROUND_JOB_TYPE_UNSPECIFIED" => Self::Unspecified,
20744            "BACKGROUND_JOB_TYPE_SOURCE_SEED" => Self::SourceSeed,
20745            "BACKGROUND_JOB_TYPE_CONVERT" => Self::Convert,
20746            "BACKGROUND_JOB_TYPE_APPLY_DESTINATION" => Self::ApplyDestination,
20747            "BACKGROUND_JOB_TYPE_IMPORT_RULES_FILE" => Self::ImportRulesFile,
20748            _ => Self::UnknownValue(background_job_type::UnknownValue(
20749                wkt::internal::UnknownEnumValue::String(value.to_string()),
20750            )),
20751        }
20752    }
20753}
20754
20755impl serde::ser::Serialize for BackgroundJobType {
20756    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20757    where
20758        S: serde::Serializer,
20759    {
20760        match self {
20761            Self::Unspecified => serializer.serialize_i32(0),
20762            Self::SourceSeed => serializer.serialize_i32(1),
20763            Self::Convert => serializer.serialize_i32(2),
20764            Self::ApplyDestination => serializer.serialize_i32(3),
20765            Self::ImportRulesFile => serializer.serialize_i32(5),
20766            Self::UnknownValue(u) => u.0.serialize(serializer),
20767        }
20768    }
20769}
20770
20771impl<'de> serde::de::Deserialize<'de> for BackgroundJobType {
20772    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20773    where
20774        D: serde::Deserializer<'de>,
20775    {
20776        deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackgroundJobType>::new(
20777            ".google.cloud.clouddms.v1.BackgroundJobType",
20778        ))
20779    }
20780}
20781
20782/// The format for the import rules file.
20783///
20784/// # Working with unknown values
20785///
20786/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
20787/// additional enum variants at any time. Adding new variants is not considered
20788/// a breaking change. Applications should write their code in anticipation of:
20789///
20790/// - New values appearing in future releases of the client library, **and**
20791/// - New values received dynamically, without application changes.
20792///
20793/// Please consult the [Working with enums] section in the user guide for some
20794/// guidelines.
20795///
20796/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
20797#[derive(Clone, Debug, PartialEq)]
20798#[non_exhaustive]
20799pub enum ImportRulesFileFormat {
20800    /// Unspecified rules format.
20801    Unspecified,
20802    /// HarbourBridge session file.
20803    HarbourBridgeSessionFile,
20804    /// Ora2Pg configuration file.
20805    OratopgConfigFile,
20806    /// If set, the enum was initialized with an unknown value.
20807    ///
20808    /// Applications can examine the value using [ImportRulesFileFormat::value] or
20809    /// [ImportRulesFileFormat::name].
20810    UnknownValue(import_rules_file_format::UnknownValue),
20811}
20812
20813#[doc(hidden)]
20814pub mod import_rules_file_format {
20815    #[allow(unused_imports)]
20816    use super::*;
20817    #[derive(Clone, Debug, PartialEq)]
20818    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
20819}
20820
20821impl ImportRulesFileFormat {
20822    /// Gets the enum value.
20823    ///
20824    /// Returns `None` if the enum contains an unknown value deserialized from
20825    /// the string representation of enums.
20826    pub fn value(&self) -> std::option::Option<i32> {
20827        match self {
20828            Self::Unspecified => std::option::Option::Some(0),
20829            Self::HarbourBridgeSessionFile => std::option::Option::Some(1),
20830            Self::OratopgConfigFile => std::option::Option::Some(2),
20831            Self::UnknownValue(u) => u.0.value(),
20832        }
20833    }
20834
20835    /// Gets the enum value as a string.
20836    ///
20837    /// Returns `None` if the enum contains an unknown value deserialized from
20838    /// the integer representation of enums.
20839    pub fn name(&self) -> std::option::Option<&str> {
20840        match self {
20841            Self::Unspecified => std::option::Option::Some("IMPORT_RULES_FILE_FORMAT_UNSPECIFIED"),
20842            Self::HarbourBridgeSessionFile => {
20843                std::option::Option::Some("IMPORT_RULES_FILE_FORMAT_HARBOUR_BRIDGE_SESSION_FILE")
20844            }
20845            Self::OratopgConfigFile => {
20846                std::option::Option::Some("IMPORT_RULES_FILE_FORMAT_ORATOPG_CONFIG_FILE")
20847            }
20848            Self::UnknownValue(u) => u.0.name(),
20849        }
20850    }
20851}
20852
20853impl std::default::Default for ImportRulesFileFormat {
20854    fn default() -> Self {
20855        use std::convert::From;
20856        Self::from(0)
20857    }
20858}
20859
20860impl std::fmt::Display for ImportRulesFileFormat {
20861    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20862        wkt::internal::display_enum(f, self.name(), self.value())
20863    }
20864}
20865
20866impl std::convert::From<i32> for ImportRulesFileFormat {
20867    fn from(value: i32) -> Self {
20868        match value {
20869            0 => Self::Unspecified,
20870            1 => Self::HarbourBridgeSessionFile,
20871            2 => Self::OratopgConfigFile,
20872            _ => Self::UnknownValue(import_rules_file_format::UnknownValue(
20873                wkt::internal::UnknownEnumValue::Integer(value),
20874            )),
20875        }
20876    }
20877}
20878
20879impl std::convert::From<&str> for ImportRulesFileFormat {
20880    fn from(value: &str) -> Self {
20881        use std::string::ToString;
20882        match value {
20883            "IMPORT_RULES_FILE_FORMAT_UNSPECIFIED" => Self::Unspecified,
20884            "IMPORT_RULES_FILE_FORMAT_HARBOUR_BRIDGE_SESSION_FILE" => {
20885                Self::HarbourBridgeSessionFile
20886            }
20887            "IMPORT_RULES_FILE_FORMAT_ORATOPG_CONFIG_FILE" => Self::OratopgConfigFile,
20888            _ => Self::UnknownValue(import_rules_file_format::UnknownValue(
20889                wkt::internal::UnknownEnumValue::String(value.to_string()),
20890            )),
20891        }
20892    }
20893}
20894
20895impl serde::ser::Serialize for ImportRulesFileFormat {
20896    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20897    where
20898        S: serde::Serializer,
20899    {
20900        match self {
20901            Self::Unspecified => serializer.serialize_i32(0),
20902            Self::HarbourBridgeSessionFile => serializer.serialize_i32(1),
20903            Self::OratopgConfigFile => serializer.serialize_i32(2),
20904            Self::UnknownValue(u) => u.0.serialize(serializer),
20905        }
20906    }
20907}
20908
20909impl<'de> serde::de::Deserialize<'de> for ImportRulesFileFormat {
20910    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20911    where
20912        D: serde::Deserializer<'de>,
20913    {
20914        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ImportRulesFileFormat>::new(
20915            ".google.cloud.clouddms.v1.ImportRulesFileFormat",
20916        ))
20917    }
20918}
20919
20920/// Enum used by IntComparisonFilter and DoubleComparisonFilter to indicate the
20921/// relation between source value and compare value.
20922///
20923/// # Working with unknown values
20924///
20925/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
20926/// additional enum variants at any time. Adding new variants is not considered
20927/// a breaking change. Applications should write their code in anticipation of:
20928///
20929/// - New values appearing in future releases of the client library, **and**
20930/// - New values received dynamically, without application changes.
20931///
20932/// Please consult the [Working with enums] section in the user guide for some
20933/// guidelines.
20934///
20935/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
20936#[derive(Clone, Debug, PartialEq)]
20937#[non_exhaustive]
20938pub enum ValueComparison {
20939    /// Value comparison unspecified.
20940    Unspecified,
20941    /// Value is smaller than the Compare value.
20942    IfValueSmallerThan,
20943    /// Value is smaller or equal than the Compare value.
20944    IfValueSmallerEqualThan,
20945    /// Value is larger than the Compare value.
20946    IfValueLargerThan,
20947    /// Value is larger or equal than the Compare value.
20948    IfValueLargerEqualThan,
20949    /// If set, the enum was initialized with an unknown value.
20950    ///
20951    /// Applications can examine the value using [ValueComparison::value] or
20952    /// [ValueComparison::name].
20953    UnknownValue(value_comparison::UnknownValue),
20954}
20955
20956#[doc(hidden)]
20957pub mod value_comparison {
20958    #[allow(unused_imports)]
20959    use super::*;
20960    #[derive(Clone, Debug, PartialEq)]
20961    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
20962}
20963
20964impl ValueComparison {
20965    /// Gets the enum value.
20966    ///
20967    /// Returns `None` if the enum contains an unknown value deserialized from
20968    /// the string representation of enums.
20969    pub fn value(&self) -> std::option::Option<i32> {
20970        match self {
20971            Self::Unspecified => std::option::Option::Some(0),
20972            Self::IfValueSmallerThan => std::option::Option::Some(1),
20973            Self::IfValueSmallerEqualThan => std::option::Option::Some(2),
20974            Self::IfValueLargerThan => std::option::Option::Some(3),
20975            Self::IfValueLargerEqualThan => std::option::Option::Some(4),
20976            Self::UnknownValue(u) => u.0.value(),
20977        }
20978    }
20979
20980    /// Gets the enum value as a string.
20981    ///
20982    /// Returns `None` if the enum contains an unknown value deserialized from
20983    /// the integer representation of enums.
20984    pub fn name(&self) -> std::option::Option<&str> {
20985        match self {
20986            Self::Unspecified => std::option::Option::Some("VALUE_COMPARISON_UNSPECIFIED"),
20987            Self::IfValueSmallerThan => {
20988                std::option::Option::Some("VALUE_COMPARISON_IF_VALUE_SMALLER_THAN")
20989            }
20990            Self::IfValueSmallerEqualThan => {
20991                std::option::Option::Some("VALUE_COMPARISON_IF_VALUE_SMALLER_EQUAL_THAN")
20992            }
20993            Self::IfValueLargerThan => {
20994                std::option::Option::Some("VALUE_COMPARISON_IF_VALUE_LARGER_THAN")
20995            }
20996            Self::IfValueLargerEqualThan => {
20997                std::option::Option::Some("VALUE_COMPARISON_IF_VALUE_LARGER_EQUAL_THAN")
20998            }
20999            Self::UnknownValue(u) => u.0.name(),
21000        }
21001    }
21002}
21003
21004impl std::default::Default for ValueComparison {
21005    fn default() -> Self {
21006        use std::convert::From;
21007        Self::from(0)
21008    }
21009}
21010
21011impl std::fmt::Display for ValueComparison {
21012    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
21013        wkt::internal::display_enum(f, self.name(), self.value())
21014    }
21015}
21016
21017impl std::convert::From<i32> for ValueComparison {
21018    fn from(value: i32) -> Self {
21019        match value {
21020            0 => Self::Unspecified,
21021            1 => Self::IfValueSmallerThan,
21022            2 => Self::IfValueSmallerEqualThan,
21023            3 => Self::IfValueLargerThan,
21024            4 => Self::IfValueLargerEqualThan,
21025            _ => Self::UnknownValue(value_comparison::UnknownValue(
21026                wkt::internal::UnknownEnumValue::Integer(value),
21027            )),
21028        }
21029    }
21030}
21031
21032impl std::convert::From<&str> for ValueComparison {
21033    fn from(value: &str) -> Self {
21034        use std::string::ToString;
21035        match value {
21036            "VALUE_COMPARISON_UNSPECIFIED" => Self::Unspecified,
21037            "VALUE_COMPARISON_IF_VALUE_SMALLER_THAN" => Self::IfValueSmallerThan,
21038            "VALUE_COMPARISON_IF_VALUE_SMALLER_EQUAL_THAN" => Self::IfValueSmallerEqualThan,
21039            "VALUE_COMPARISON_IF_VALUE_LARGER_THAN" => Self::IfValueLargerThan,
21040            "VALUE_COMPARISON_IF_VALUE_LARGER_EQUAL_THAN" => Self::IfValueLargerEqualThan,
21041            _ => Self::UnknownValue(value_comparison::UnknownValue(
21042                wkt::internal::UnknownEnumValue::String(value.to_string()),
21043            )),
21044        }
21045    }
21046}
21047
21048impl serde::ser::Serialize for ValueComparison {
21049    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21050    where
21051        S: serde::Serializer,
21052    {
21053        match self {
21054            Self::Unspecified => serializer.serialize_i32(0),
21055            Self::IfValueSmallerThan => serializer.serialize_i32(1),
21056            Self::IfValueSmallerEqualThan => serializer.serialize_i32(2),
21057            Self::IfValueLargerThan => serializer.serialize_i32(3),
21058            Self::IfValueLargerEqualThan => serializer.serialize_i32(4),
21059            Self::UnknownValue(u) => u.0.serialize(serializer),
21060        }
21061    }
21062}
21063
21064impl<'de> serde::de::Deserialize<'de> for ValueComparison {
21065    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21066    where
21067        D: serde::Deserializer<'de>,
21068    {
21069        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ValueComparison>::new(
21070            ".google.cloud.clouddms.v1.ValueComparison",
21071        ))
21072    }
21073}
21074
21075/// Specifies the columns on which numeric filter needs to be applied.
21076///
21077/// # Working with unknown values
21078///
21079/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
21080/// additional enum variants at any time. Adding new variants is not considered
21081/// a breaking change. Applications should write their code in anticipation of:
21082///
21083/// - New values appearing in future releases of the client library, **and**
21084/// - New values received dynamically, without application changes.
21085///
21086/// Please consult the [Working with enums] section in the user guide for some
21087/// guidelines.
21088///
21089/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
21090#[derive(Clone, Debug, PartialEq)]
21091#[non_exhaustive]
21092pub enum NumericFilterOption {
21093    /// Numeric filter option unspecified
21094    Unspecified,
21095    /// Numeric filter option that matches all numeric columns.
21096    All,
21097    /// Numeric filter option that matches columns having numeric datatypes with
21098    /// specified precision and scale within the limited range of filter.
21099    Limit,
21100    /// Numeric filter option that matches only the numeric columns with no
21101    /// precision and scale specified.
21102    Limitless,
21103    /// If set, the enum was initialized with an unknown value.
21104    ///
21105    /// Applications can examine the value using [NumericFilterOption::value] or
21106    /// [NumericFilterOption::name].
21107    UnknownValue(numeric_filter_option::UnknownValue),
21108}
21109
21110#[doc(hidden)]
21111pub mod numeric_filter_option {
21112    #[allow(unused_imports)]
21113    use super::*;
21114    #[derive(Clone, Debug, PartialEq)]
21115    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
21116}
21117
21118impl NumericFilterOption {
21119    /// Gets the enum value.
21120    ///
21121    /// Returns `None` if the enum contains an unknown value deserialized from
21122    /// the string representation of enums.
21123    pub fn value(&self) -> std::option::Option<i32> {
21124        match self {
21125            Self::Unspecified => std::option::Option::Some(0),
21126            Self::All => std::option::Option::Some(1),
21127            Self::Limit => std::option::Option::Some(2),
21128            Self::Limitless => std::option::Option::Some(3),
21129            Self::UnknownValue(u) => u.0.value(),
21130        }
21131    }
21132
21133    /// Gets the enum value as a string.
21134    ///
21135    /// Returns `None` if the enum contains an unknown value deserialized from
21136    /// the integer representation of enums.
21137    pub fn name(&self) -> std::option::Option<&str> {
21138        match self {
21139            Self::Unspecified => std::option::Option::Some("NUMERIC_FILTER_OPTION_UNSPECIFIED"),
21140            Self::All => std::option::Option::Some("NUMERIC_FILTER_OPTION_ALL"),
21141            Self::Limit => std::option::Option::Some("NUMERIC_FILTER_OPTION_LIMIT"),
21142            Self::Limitless => std::option::Option::Some("NUMERIC_FILTER_OPTION_LIMITLESS"),
21143            Self::UnknownValue(u) => u.0.name(),
21144        }
21145    }
21146}
21147
21148impl std::default::Default for NumericFilterOption {
21149    fn default() -> Self {
21150        use std::convert::From;
21151        Self::from(0)
21152    }
21153}
21154
21155impl std::fmt::Display for NumericFilterOption {
21156    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
21157        wkt::internal::display_enum(f, self.name(), self.value())
21158    }
21159}
21160
21161impl std::convert::From<i32> for NumericFilterOption {
21162    fn from(value: i32) -> Self {
21163        match value {
21164            0 => Self::Unspecified,
21165            1 => Self::All,
21166            2 => Self::Limit,
21167            3 => Self::Limitless,
21168            _ => Self::UnknownValue(numeric_filter_option::UnknownValue(
21169                wkt::internal::UnknownEnumValue::Integer(value),
21170            )),
21171        }
21172    }
21173}
21174
21175impl std::convert::From<&str> for NumericFilterOption {
21176    fn from(value: &str) -> Self {
21177        use std::string::ToString;
21178        match value {
21179            "NUMERIC_FILTER_OPTION_UNSPECIFIED" => Self::Unspecified,
21180            "NUMERIC_FILTER_OPTION_ALL" => Self::All,
21181            "NUMERIC_FILTER_OPTION_LIMIT" => Self::Limit,
21182            "NUMERIC_FILTER_OPTION_LIMITLESS" => Self::Limitless,
21183            _ => Self::UnknownValue(numeric_filter_option::UnknownValue(
21184                wkt::internal::UnknownEnumValue::String(value.to_string()),
21185            )),
21186        }
21187    }
21188}
21189
21190impl serde::ser::Serialize for NumericFilterOption {
21191    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21192    where
21193        S: serde::Serializer,
21194    {
21195        match self {
21196            Self::Unspecified => serializer.serialize_i32(0),
21197            Self::All => serializer.serialize_i32(1),
21198            Self::Limit => serializer.serialize_i32(2),
21199            Self::Limitless => serializer.serialize_i32(3),
21200            Self::UnknownValue(u) => u.0.serialize(serializer),
21201        }
21202    }
21203}
21204
21205impl<'de> serde::de::Deserialize<'de> for NumericFilterOption {
21206    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21207    where
21208        D: serde::Deserializer<'de>,
21209    {
21210        deserializer.deserialize_any(wkt::internal::EnumVisitor::<NumericFilterOption>::new(
21211            ".google.cloud.clouddms.v1.NumericFilterOption",
21212        ))
21213    }
21214}