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 gax;
23extern crate gaxi;
24extern crate iam_v1;
25extern crate lazy_static;
26extern crate location;
27extern crate longrunning;
28extern crate lro;
29extern crate reqwest;
30extern crate rpc;
31extern crate serde;
32extern crate serde_json;
33extern crate serde_with;
34extern crate std;
35extern crate tracing;
36extern crate wkt;
37
38mod debug;
39mod deserialize;
40mod serialize;
41
42/// Retrieves a list of all migration jobs in a given project and location.
43#[derive(Clone, Default, PartialEq)]
44#[non_exhaustive]
45pub struct ListMigrationJobsRequest {
46    /// Required. The parent which owns this collection of migrationJobs.
47    pub parent: std::string::String,
48
49    /// The maximum number of migration jobs to return. The service may return
50    /// fewer than this value. If unspecified, at most 50 migration jobs will be
51    /// returned. The maximum value is 1000; values above 1000 are coerced to
52    /// 1000.
53    pub page_size: i32,
54
55    /// The nextPageToken value received in the previous call to
56    /// migrationJobs.list, used in the subsequent request to retrieve the next
57    /// page of results. On first call this should be left blank. When paginating,
58    /// all other parameters provided to migrationJobs.list must match the call
59    /// that provided the page token.
60    pub page_token: std::string::String,
61
62    /// A filter expression that filters migration jobs listed in the response.
63    /// The expression must specify the field name, a comparison operator, and the
64    /// value that you want to use for filtering. The value must be a string,
65    /// a number, or a boolean. The comparison operator must be
66    /// either =, !=, >, or <. For example, list migration jobs created this year
67    /// by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.**
68    /// You can also filter nested fields. For example, you could specify
69    /// **reverseSshConnectivity.vmIp = "1.2.3.4"** to select all migration
70    /// jobs connecting through the specific SSH tunnel bastion.
71    pub filter: std::string::String,
72
73    /// Sort the results based on the migration job name.
74    /// Valid values are: "name", "name asc", and "name desc".
75    pub order_by: std::string::String,
76
77    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
78}
79
80impl ListMigrationJobsRequest {
81    pub fn new() -> Self {
82        std::default::Default::default()
83    }
84
85    /// Sets the value of [parent][crate::model::ListMigrationJobsRequest::parent].
86    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
87        self.parent = v.into();
88        self
89    }
90
91    /// Sets the value of [page_size][crate::model::ListMigrationJobsRequest::page_size].
92    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
93        self.page_size = v.into();
94        self
95    }
96
97    /// Sets the value of [page_token][crate::model::ListMigrationJobsRequest::page_token].
98    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
99        self.page_token = v.into();
100        self
101    }
102
103    /// Sets the value of [filter][crate::model::ListMigrationJobsRequest::filter].
104    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
105        self.filter = v.into();
106        self
107    }
108
109    /// Sets the value of [order_by][crate::model::ListMigrationJobsRequest::order_by].
110    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
111        self.order_by = v.into();
112        self
113    }
114}
115
116impl wkt::message::Message for ListMigrationJobsRequest {
117    fn typename() -> &'static str {
118        "type.googleapis.com/google.cloud.clouddms.v1.ListMigrationJobsRequest"
119    }
120}
121
122/// Response message for 'ListMigrationJobs' request.
123#[derive(Clone, Default, PartialEq)]
124#[non_exhaustive]
125pub struct ListMigrationJobsResponse {
126    /// The list of migration jobs objects.
127    pub migration_jobs: std::vec::Vec<crate::model::MigrationJob>,
128
129    /// A token which can be sent as `page_token` to retrieve the next page.
130    /// If this field is omitted, there are no subsequent pages.
131    pub next_page_token: std::string::String,
132
133    /// Locations that could not be reached.
134    pub unreachable: std::vec::Vec<std::string::String>,
135
136    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
137}
138
139impl ListMigrationJobsResponse {
140    pub fn new() -> Self {
141        std::default::Default::default()
142    }
143
144    /// Sets the value of [migration_jobs][crate::model::ListMigrationJobsResponse::migration_jobs].
145    pub fn set_migration_jobs<T, V>(mut self, v: T) -> Self
146    where
147        T: std::iter::IntoIterator<Item = V>,
148        V: std::convert::Into<crate::model::MigrationJob>,
149    {
150        use std::iter::Iterator;
151        self.migration_jobs = v.into_iter().map(|i| i.into()).collect();
152        self
153    }
154
155    /// Sets the value of [next_page_token][crate::model::ListMigrationJobsResponse::next_page_token].
156    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
157        self.next_page_token = v.into();
158        self
159    }
160
161    /// Sets the value of [unreachable][crate::model::ListMigrationJobsResponse::unreachable].
162    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
163    where
164        T: std::iter::IntoIterator<Item = V>,
165        V: std::convert::Into<std::string::String>,
166    {
167        use std::iter::Iterator;
168        self.unreachable = v.into_iter().map(|i| i.into()).collect();
169        self
170    }
171}
172
173impl wkt::message::Message for ListMigrationJobsResponse {
174    fn typename() -> &'static str {
175        "type.googleapis.com/google.cloud.clouddms.v1.ListMigrationJobsResponse"
176    }
177}
178
179#[doc(hidden)]
180impl gax::paginator::internal::PageableResponse for ListMigrationJobsResponse {
181    type PageItem = crate::model::MigrationJob;
182
183    fn items(self) -> std::vec::Vec<Self::PageItem> {
184        self.migration_jobs
185    }
186
187    fn next_page_token(&self) -> std::string::String {
188        use std::clone::Clone;
189        self.next_page_token.clone()
190    }
191}
192
193/// Request message for 'GetMigrationJob' request.
194#[derive(Clone, Default, PartialEq)]
195#[non_exhaustive]
196pub struct GetMigrationJobRequest {
197    /// Required. Name of the migration job resource to get.
198    pub name: std::string::String,
199
200    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
201}
202
203impl GetMigrationJobRequest {
204    pub fn new() -> Self {
205        std::default::Default::default()
206    }
207
208    /// Sets the value of [name][crate::model::GetMigrationJobRequest::name].
209    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
210        self.name = v.into();
211        self
212    }
213}
214
215impl wkt::message::Message for GetMigrationJobRequest {
216    fn typename() -> &'static str {
217        "type.googleapis.com/google.cloud.clouddms.v1.GetMigrationJobRequest"
218    }
219}
220
221/// Request message to create a new Database Migration Service migration job
222/// in the specified project and region.
223#[derive(Clone, Default, PartialEq)]
224#[non_exhaustive]
225pub struct CreateMigrationJobRequest {
226    /// Required. The parent which owns this collection of migration jobs.
227    pub parent: std::string::String,
228
229    /// Required. The ID of the instance to create.
230    pub migration_job_id: std::string::String,
231
232    /// Required. Represents a [migration
233    /// job](https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.migrationJobs)
234    /// object.
235    pub migration_job: std::option::Option<crate::model::MigrationJob>,
236
237    /// Optional. A unique ID used to identify the request. If the server receives
238    /// two requests with the same ID, then the second request is ignored.
239    ///
240    /// It is recommended to always set this value to a UUID.
241    ///
242    /// The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
243    /// (_), and hyphens (-). The maximum length is 40 characters.
244    pub request_id: std::string::String,
245
246    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
247}
248
249impl CreateMigrationJobRequest {
250    pub fn new() -> Self {
251        std::default::Default::default()
252    }
253
254    /// Sets the value of [parent][crate::model::CreateMigrationJobRequest::parent].
255    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
256        self.parent = v.into();
257        self
258    }
259
260    /// Sets the value of [migration_job_id][crate::model::CreateMigrationJobRequest::migration_job_id].
261    pub fn set_migration_job_id<T: std::convert::Into<std::string::String>>(
262        mut self,
263        v: T,
264    ) -> Self {
265        self.migration_job_id = v.into();
266        self
267    }
268
269    /// Sets the value of [migration_job][crate::model::CreateMigrationJobRequest::migration_job].
270    pub fn set_migration_job<T>(mut self, v: T) -> Self
271    where
272        T: std::convert::Into<crate::model::MigrationJob>,
273    {
274        self.migration_job = std::option::Option::Some(v.into());
275        self
276    }
277
278    /// Sets or clears the value of [migration_job][crate::model::CreateMigrationJobRequest::migration_job].
279    pub fn set_or_clear_migration_job<T>(mut self, v: std::option::Option<T>) -> Self
280    where
281        T: std::convert::Into<crate::model::MigrationJob>,
282    {
283        self.migration_job = v.map(|x| x.into());
284        self
285    }
286
287    /// Sets the value of [request_id][crate::model::CreateMigrationJobRequest::request_id].
288    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
289        self.request_id = v.into();
290        self
291    }
292}
293
294impl wkt::message::Message for CreateMigrationJobRequest {
295    fn typename() -> &'static str {
296        "type.googleapis.com/google.cloud.clouddms.v1.CreateMigrationJobRequest"
297    }
298}
299
300/// Request message for 'UpdateMigrationJob' request.
301#[derive(Clone, Default, PartialEq)]
302#[non_exhaustive]
303pub struct UpdateMigrationJobRequest {
304    /// Required. Field mask is used to specify the fields to be overwritten by the
305    /// update in the conversion workspace resource.
306    pub update_mask: std::option::Option<wkt::FieldMask>,
307
308    /// Required. The migration job parameters to update.
309    pub migration_job: std::option::Option<crate::model::MigrationJob>,
310
311    /// A unique ID used to identify the request. If the server receives two
312    /// requests with the same ID, then the second request is ignored.
313    ///
314    /// It is recommended to always set this value to a UUID.
315    ///
316    /// The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
317    /// (_), and hyphens (-). The maximum length is 40 characters.
318    pub request_id: std::string::String,
319
320    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
321}
322
323impl UpdateMigrationJobRequest {
324    pub fn new() -> Self {
325        std::default::Default::default()
326    }
327
328    /// Sets the value of [update_mask][crate::model::UpdateMigrationJobRequest::update_mask].
329    pub fn set_update_mask<T>(mut self, v: T) -> Self
330    where
331        T: std::convert::Into<wkt::FieldMask>,
332    {
333        self.update_mask = std::option::Option::Some(v.into());
334        self
335    }
336
337    /// Sets or clears the value of [update_mask][crate::model::UpdateMigrationJobRequest::update_mask].
338    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
339    where
340        T: std::convert::Into<wkt::FieldMask>,
341    {
342        self.update_mask = v.map(|x| x.into());
343        self
344    }
345
346    /// Sets the value of [migration_job][crate::model::UpdateMigrationJobRequest::migration_job].
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::UpdateMigrationJobRequest::migration_job].
356    pub fn set_or_clear_migration_job<T>(mut self, v: std::option::Option<T>) -> Self
357    where
358        T: std::convert::Into<crate::model::MigrationJob>,
359    {
360        self.migration_job = v.map(|x| x.into());
361        self
362    }
363
364    /// Sets the value of [request_id][crate::model::UpdateMigrationJobRequest::request_id].
365    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
366        self.request_id = v.into();
367        self
368    }
369}
370
371impl wkt::message::Message for UpdateMigrationJobRequest {
372    fn typename() -> &'static str {
373        "type.googleapis.com/google.cloud.clouddms.v1.UpdateMigrationJobRequest"
374    }
375}
376
377/// Request message for 'DeleteMigrationJob' request.
378#[derive(Clone, Default, PartialEq)]
379#[non_exhaustive]
380pub struct DeleteMigrationJobRequest {
381    /// Required. Name of the migration job resource to delete.
382    pub name: std::string::String,
383
384    /// A unique ID used to identify the request. If the server receives two
385    /// requests with the same ID, then the second request is ignored.
386    ///
387    /// It is recommended to always set this value to a UUID.
388    ///
389    /// The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
390    /// (_), and hyphens (-). The maximum length is 40 characters.
391    pub request_id: std::string::String,
392
393    /// The destination CloudSQL connection profile is always deleted with the
394    /// migration job. In case of force delete, the destination CloudSQL replica
395    /// database is also deleted.
396    pub force: bool,
397
398    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
399}
400
401impl DeleteMigrationJobRequest {
402    pub fn new() -> Self {
403        std::default::Default::default()
404    }
405
406    /// Sets the value of [name][crate::model::DeleteMigrationJobRequest::name].
407    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
408        self.name = v.into();
409        self
410    }
411
412    /// Sets the value of [request_id][crate::model::DeleteMigrationJobRequest::request_id].
413    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
414        self.request_id = v.into();
415        self
416    }
417
418    /// Sets the value of [force][crate::model::DeleteMigrationJobRequest::force].
419    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
420        self.force = v.into();
421        self
422    }
423}
424
425impl wkt::message::Message for DeleteMigrationJobRequest {
426    fn typename() -> &'static str {
427        "type.googleapis.com/google.cloud.clouddms.v1.DeleteMigrationJobRequest"
428    }
429}
430
431/// Request message for 'StartMigrationJob' request.
432#[derive(Clone, Default, PartialEq)]
433#[non_exhaustive]
434pub struct StartMigrationJobRequest {
435    /// Name of the migration job resource to start.
436    pub name: std::string::String,
437
438    /// Optional. Start the migration job without running prior configuration
439    /// verification. Defaults to `false`.
440    pub skip_validation: bool,
441
442    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
443}
444
445impl StartMigrationJobRequest {
446    pub fn new() -> Self {
447        std::default::Default::default()
448    }
449
450    /// Sets the value of [name][crate::model::StartMigrationJobRequest::name].
451    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
452        self.name = v.into();
453        self
454    }
455
456    /// Sets the value of [skip_validation][crate::model::StartMigrationJobRequest::skip_validation].
457    pub fn set_skip_validation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
458        self.skip_validation = v.into();
459        self
460    }
461}
462
463impl wkt::message::Message for StartMigrationJobRequest {
464    fn typename() -> &'static str {
465        "type.googleapis.com/google.cloud.clouddms.v1.StartMigrationJobRequest"
466    }
467}
468
469/// Request message for 'StopMigrationJob' request.
470#[derive(Clone, Default, PartialEq)]
471#[non_exhaustive]
472pub struct StopMigrationJobRequest {
473    /// Name of the migration job resource to stop.
474    pub name: std::string::String,
475
476    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
477}
478
479impl StopMigrationJobRequest {
480    pub fn new() -> Self {
481        std::default::Default::default()
482    }
483
484    /// Sets the value of [name][crate::model::StopMigrationJobRequest::name].
485    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
486        self.name = v.into();
487        self
488    }
489}
490
491impl wkt::message::Message for StopMigrationJobRequest {
492    fn typename() -> &'static str {
493        "type.googleapis.com/google.cloud.clouddms.v1.StopMigrationJobRequest"
494    }
495}
496
497/// Request message for 'ResumeMigrationJob' request.
498#[derive(Clone, Default, PartialEq)]
499#[non_exhaustive]
500pub struct ResumeMigrationJobRequest {
501    /// Name of the migration job resource to resume.
502    pub name: std::string::String,
503
504    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
505}
506
507impl ResumeMigrationJobRequest {
508    pub fn new() -> Self {
509        std::default::Default::default()
510    }
511
512    /// Sets the value of [name][crate::model::ResumeMigrationJobRequest::name].
513    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
514        self.name = v.into();
515        self
516    }
517}
518
519impl wkt::message::Message for ResumeMigrationJobRequest {
520    fn typename() -> &'static str {
521        "type.googleapis.com/google.cloud.clouddms.v1.ResumeMigrationJobRequest"
522    }
523}
524
525/// Request message for 'PromoteMigrationJob' request.
526#[derive(Clone, Default, PartialEq)]
527#[non_exhaustive]
528pub struct PromoteMigrationJobRequest {
529    /// Name of the migration job resource to promote.
530    pub name: std::string::String,
531
532    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
533}
534
535impl PromoteMigrationJobRequest {
536    pub fn new() -> Self {
537        std::default::Default::default()
538    }
539
540    /// Sets the value of [name][crate::model::PromoteMigrationJobRequest::name].
541    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
542        self.name = v.into();
543        self
544    }
545}
546
547impl wkt::message::Message for PromoteMigrationJobRequest {
548    fn typename() -> &'static str {
549        "type.googleapis.com/google.cloud.clouddms.v1.PromoteMigrationJobRequest"
550    }
551}
552
553/// Request message for 'VerifyMigrationJob' request.
554#[derive(Clone, Default, PartialEq)]
555#[non_exhaustive]
556pub struct VerifyMigrationJobRequest {
557    /// Name of the migration job resource to verify.
558    pub name: std::string::String,
559
560    /// Optional. Field mask is used to specify the changed fields to be verified.
561    /// It will not update the migration job.
562    pub update_mask: std::option::Option<wkt::FieldMask>,
563
564    /// Optional. The changed migration job parameters to verify.
565    /// It will not update the migration job.
566    pub migration_job: std::option::Option<crate::model::MigrationJob>,
567
568    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
569}
570
571impl VerifyMigrationJobRequest {
572    pub fn new() -> Self {
573        std::default::Default::default()
574    }
575
576    /// Sets the value of [name][crate::model::VerifyMigrationJobRequest::name].
577    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
578        self.name = v.into();
579        self
580    }
581
582    /// Sets the value of [update_mask][crate::model::VerifyMigrationJobRequest::update_mask].
583    pub fn set_update_mask<T>(mut self, v: T) -> Self
584    where
585        T: std::convert::Into<wkt::FieldMask>,
586    {
587        self.update_mask = std::option::Option::Some(v.into());
588        self
589    }
590
591    /// Sets or clears the value of [update_mask][crate::model::VerifyMigrationJobRequest::update_mask].
592    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
593    where
594        T: std::convert::Into<wkt::FieldMask>,
595    {
596        self.update_mask = v.map(|x| x.into());
597        self
598    }
599
600    /// Sets the value of [migration_job][crate::model::VerifyMigrationJobRequest::migration_job].
601    pub fn set_migration_job<T>(mut self, v: T) -> Self
602    where
603        T: std::convert::Into<crate::model::MigrationJob>,
604    {
605        self.migration_job = std::option::Option::Some(v.into());
606        self
607    }
608
609    /// Sets or clears the value of [migration_job][crate::model::VerifyMigrationJobRequest::migration_job].
610    pub fn set_or_clear_migration_job<T>(mut self, v: std::option::Option<T>) -> Self
611    where
612        T: std::convert::Into<crate::model::MigrationJob>,
613    {
614        self.migration_job = v.map(|x| x.into());
615        self
616    }
617}
618
619impl wkt::message::Message for VerifyMigrationJobRequest {
620    fn typename() -> &'static str {
621        "type.googleapis.com/google.cloud.clouddms.v1.VerifyMigrationJobRequest"
622    }
623}
624
625/// Request message for 'RestartMigrationJob' request.
626#[derive(Clone, Default, PartialEq)]
627#[non_exhaustive]
628pub struct RestartMigrationJobRequest {
629    /// Name of the migration job resource to restart.
630    pub name: std::string::String,
631
632    /// Optional. Restart the migration job without running prior configuration
633    /// verification. Defaults to `false`.
634    pub skip_validation: bool,
635
636    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
637}
638
639impl RestartMigrationJobRequest {
640    pub fn new() -> Self {
641        std::default::Default::default()
642    }
643
644    /// Sets the value of [name][crate::model::RestartMigrationJobRequest::name].
645    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
646        self.name = v.into();
647        self
648    }
649
650    /// Sets the value of [skip_validation][crate::model::RestartMigrationJobRequest::skip_validation].
651    pub fn set_skip_validation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
652        self.skip_validation = v.into();
653        self
654    }
655}
656
657impl wkt::message::Message for RestartMigrationJobRequest {
658    fn typename() -> &'static str {
659        "type.googleapis.com/google.cloud.clouddms.v1.RestartMigrationJobRequest"
660    }
661}
662
663/// Request message for 'GenerateSshScript' request.
664#[derive(Clone, Default, PartialEq)]
665#[non_exhaustive]
666pub struct GenerateSshScriptRequest {
667    /// Name of the migration job resource to generate the SSH script.
668    pub migration_job: std::string::String,
669
670    /// Required. Bastion VM Instance name to use or to create.
671    pub vm: std::string::String,
672
673    /// The port that will be open on the bastion host.
674    pub vm_port: i32,
675
676    /// The VM configuration
677    pub vm_config: std::option::Option<crate::model::generate_ssh_script_request::VmConfig>,
678
679    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
680}
681
682impl GenerateSshScriptRequest {
683    pub fn new() -> Self {
684        std::default::Default::default()
685    }
686
687    /// Sets the value of [migration_job][crate::model::GenerateSshScriptRequest::migration_job].
688    pub fn set_migration_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
689        self.migration_job = v.into();
690        self
691    }
692
693    /// Sets the value of [vm][crate::model::GenerateSshScriptRequest::vm].
694    pub fn set_vm<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
695        self.vm = v.into();
696        self
697    }
698
699    /// Sets the value of [vm_port][crate::model::GenerateSshScriptRequest::vm_port].
700    pub fn set_vm_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
701        self.vm_port = v.into();
702        self
703    }
704
705    /// Sets the value of [vm_config][crate::model::GenerateSshScriptRequest::vm_config].
706    ///
707    /// Note that all the setters affecting `vm_config` are mutually
708    /// exclusive.
709    pub fn set_vm_config<
710        T: std::convert::Into<
711                std::option::Option<crate::model::generate_ssh_script_request::VmConfig>,
712            >,
713    >(
714        mut self,
715        v: T,
716    ) -> Self {
717        self.vm_config = v.into();
718        self
719    }
720
721    /// The value of [vm_config][crate::model::GenerateSshScriptRequest::vm_config]
722    /// if it holds a `VmCreationConfig`, `None` if the field is not set or
723    /// holds a different branch.
724    pub fn vm_creation_config(
725        &self,
726    ) -> std::option::Option<&std::boxed::Box<crate::model::VmCreationConfig>> {
727        #[allow(unreachable_patterns)]
728        self.vm_config.as_ref().and_then(|v| match v {
729            crate::model::generate_ssh_script_request::VmConfig::VmCreationConfig(v) => {
730                std::option::Option::Some(v)
731            }
732            _ => std::option::Option::None,
733        })
734    }
735
736    /// Sets the value of [vm_config][crate::model::GenerateSshScriptRequest::vm_config]
737    /// to hold a `VmCreationConfig`.
738    ///
739    /// Note that all the setters affecting `vm_config` are
740    /// mutually exclusive.
741    pub fn set_vm_creation_config<
742        T: std::convert::Into<std::boxed::Box<crate::model::VmCreationConfig>>,
743    >(
744        mut self,
745        v: T,
746    ) -> Self {
747        self.vm_config = std::option::Option::Some(
748            crate::model::generate_ssh_script_request::VmConfig::VmCreationConfig(v.into()),
749        );
750        self
751    }
752
753    /// The value of [vm_config][crate::model::GenerateSshScriptRequest::vm_config]
754    /// if it holds a `VmSelectionConfig`, `None` if the field is not set or
755    /// holds a different branch.
756    pub fn vm_selection_config(
757        &self,
758    ) -> std::option::Option<&std::boxed::Box<crate::model::VmSelectionConfig>> {
759        #[allow(unreachable_patterns)]
760        self.vm_config.as_ref().and_then(|v| match v {
761            crate::model::generate_ssh_script_request::VmConfig::VmSelectionConfig(v) => {
762                std::option::Option::Some(v)
763            }
764            _ => std::option::Option::None,
765        })
766    }
767
768    /// Sets the value of [vm_config][crate::model::GenerateSshScriptRequest::vm_config]
769    /// to hold a `VmSelectionConfig`.
770    ///
771    /// Note that all the setters affecting `vm_config` are
772    /// mutually exclusive.
773    pub fn set_vm_selection_config<
774        T: std::convert::Into<std::boxed::Box<crate::model::VmSelectionConfig>>,
775    >(
776        mut self,
777        v: T,
778    ) -> Self {
779        self.vm_config = std::option::Option::Some(
780            crate::model::generate_ssh_script_request::VmConfig::VmSelectionConfig(v.into()),
781        );
782        self
783    }
784}
785
786impl wkt::message::Message for GenerateSshScriptRequest {
787    fn typename() -> &'static str {
788        "type.googleapis.com/google.cloud.clouddms.v1.GenerateSshScriptRequest"
789    }
790}
791
792/// Defines additional types related to [GenerateSshScriptRequest].
793pub mod generate_ssh_script_request {
794    #[allow(unused_imports)]
795    use super::*;
796
797    /// The VM configuration
798    #[derive(Clone, Debug, PartialEq)]
799    #[non_exhaustive]
800    pub enum VmConfig {
801        /// The VM creation configuration
802        VmCreationConfig(std::boxed::Box<crate::model::VmCreationConfig>),
803        /// The VM selection configuration
804        VmSelectionConfig(std::boxed::Box<crate::model::VmSelectionConfig>),
805    }
806}
807
808/// VM creation configuration message
809#[derive(Clone, Default, PartialEq)]
810#[non_exhaustive]
811pub struct VmCreationConfig {
812    /// Required. VM instance machine type to create.
813    pub vm_machine_type: std::string::String,
814
815    /// The Google Cloud Platform zone to create the VM in.
816    pub vm_zone: std::string::String,
817
818    /// The subnet name the vm needs to be created in.
819    pub subnet: std::string::String,
820
821    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
822}
823
824impl VmCreationConfig {
825    pub fn new() -> Self {
826        std::default::Default::default()
827    }
828
829    /// Sets the value of [vm_machine_type][crate::model::VmCreationConfig::vm_machine_type].
830    pub fn set_vm_machine_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
831        self.vm_machine_type = v.into();
832        self
833    }
834
835    /// Sets the value of [vm_zone][crate::model::VmCreationConfig::vm_zone].
836    pub fn set_vm_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
837        self.vm_zone = v.into();
838        self
839    }
840
841    /// Sets the value of [subnet][crate::model::VmCreationConfig::subnet].
842    pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
843        self.subnet = v.into();
844        self
845    }
846}
847
848impl wkt::message::Message for VmCreationConfig {
849    fn typename() -> &'static str {
850        "type.googleapis.com/google.cloud.clouddms.v1.VmCreationConfig"
851    }
852}
853
854/// VM selection configuration message
855#[derive(Clone, Default, PartialEq)]
856#[non_exhaustive]
857pub struct VmSelectionConfig {
858    /// Required. The Google Cloud Platform zone the VM is located.
859    pub vm_zone: std::string::String,
860
861    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
862}
863
864impl VmSelectionConfig {
865    pub fn new() -> Self {
866        std::default::Default::default()
867    }
868
869    /// Sets the value of [vm_zone][crate::model::VmSelectionConfig::vm_zone].
870    pub fn set_vm_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
871        self.vm_zone = v.into();
872        self
873    }
874}
875
876impl wkt::message::Message for VmSelectionConfig {
877    fn typename() -> &'static str {
878        "type.googleapis.com/google.cloud.clouddms.v1.VmSelectionConfig"
879    }
880}
881
882/// Response message for 'GenerateSshScript' request.
883#[derive(Clone, Default, PartialEq)]
884#[non_exhaustive]
885pub struct SshScript {
886    /// The ssh configuration script.
887    pub script: std::string::String,
888
889    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
890}
891
892impl SshScript {
893    pub fn new() -> Self {
894        std::default::Default::default()
895    }
896
897    /// Sets the value of [script][crate::model::SshScript::script].
898    pub fn set_script<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
899        self.script = v.into();
900        self
901    }
902}
903
904impl wkt::message::Message for SshScript {
905    fn typename() -> &'static str {
906        "type.googleapis.com/google.cloud.clouddms.v1.SshScript"
907    }
908}
909
910/// Request message for 'GenerateTcpProxyScript' request.
911#[derive(Clone, Default, PartialEq)]
912#[non_exhaustive]
913pub struct GenerateTcpProxyScriptRequest {
914    /// Name of the migration job resource to generate the TCP Proxy script.
915    pub migration_job: std::string::String,
916
917    /// Required. The name of the Compute instance that will host the proxy.
918    pub vm_name: std::string::String,
919
920    /// Required. The type of the Compute instance that will host the proxy.
921    pub vm_machine_type: std::string::String,
922
923    /// Optional. The Google Cloud Platform zone to create the VM in. The fully
924    /// qualified name of the zone must be specified, including the region name,
925    /// for example "us-central1-b". If not specified, uses the "-b" zone of the
926    /// destination Connection Profile's region.
927    pub vm_zone: std::string::String,
928
929    /// Required. The name of the subnet the Compute instance will use for private
930    /// connectivity. Must be supplied in the form of
931    /// projects/{project}/regions/{region}/subnetworks/{subnetwork}.
932    /// Note: the region for the subnet must match the Compute instance region.
933    pub vm_subnet: std::string::String,
934
935    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
936}
937
938impl GenerateTcpProxyScriptRequest {
939    pub fn new() -> Self {
940        std::default::Default::default()
941    }
942
943    /// Sets the value of [migration_job][crate::model::GenerateTcpProxyScriptRequest::migration_job].
944    pub fn set_migration_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
945        self.migration_job = v.into();
946        self
947    }
948
949    /// Sets the value of [vm_name][crate::model::GenerateTcpProxyScriptRequest::vm_name].
950    pub fn set_vm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
951        self.vm_name = v.into();
952        self
953    }
954
955    /// Sets the value of [vm_machine_type][crate::model::GenerateTcpProxyScriptRequest::vm_machine_type].
956    pub fn set_vm_machine_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
957        self.vm_machine_type = v.into();
958        self
959    }
960
961    /// Sets the value of [vm_zone][crate::model::GenerateTcpProxyScriptRequest::vm_zone].
962    pub fn set_vm_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
963        self.vm_zone = v.into();
964        self
965    }
966
967    /// Sets the value of [vm_subnet][crate::model::GenerateTcpProxyScriptRequest::vm_subnet].
968    pub fn set_vm_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
969        self.vm_subnet = v.into();
970        self
971    }
972}
973
974impl wkt::message::Message for GenerateTcpProxyScriptRequest {
975    fn typename() -> &'static str {
976        "type.googleapis.com/google.cloud.clouddms.v1.GenerateTcpProxyScriptRequest"
977    }
978}
979
980/// Response message for 'GenerateTcpProxyScript' request.
981#[derive(Clone, Default, PartialEq)]
982#[non_exhaustive]
983pub struct TcpProxyScript {
984    /// The TCP Proxy configuration script.
985    pub script: std::string::String,
986
987    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
988}
989
990impl TcpProxyScript {
991    pub fn new() -> Self {
992        std::default::Default::default()
993    }
994
995    /// Sets the value of [script][crate::model::TcpProxyScript::script].
996    pub fn set_script<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
997        self.script = v.into();
998        self
999    }
1000}
1001
1002impl wkt::message::Message for TcpProxyScript {
1003    fn typename() -> &'static str {
1004        "type.googleapis.com/google.cloud.clouddms.v1.TcpProxyScript"
1005    }
1006}
1007
1008/// Request message for 'ListConnectionProfiles' request.
1009#[derive(Clone, Default, PartialEq)]
1010#[non_exhaustive]
1011pub struct ListConnectionProfilesRequest {
1012    /// Required. The parent which owns this collection of connection profiles.
1013    pub parent: std::string::String,
1014
1015    /// The maximum number of connection profiles to return. The service may return
1016    /// fewer than this value. If unspecified, at most 50 connection profiles will
1017    /// be returned. The maximum value is 1000; values above 1000 are coerced
1018    /// to 1000.
1019    pub page_size: i32,
1020
1021    /// A page token, received from a previous `ListConnectionProfiles` call.
1022    /// Provide this to retrieve the subsequent page.
1023    ///
1024    /// When paginating, all other parameters provided to `ListConnectionProfiles`
1025    /// must match the call that provided the page token.
1026    pub page_token: std::string::String,
1027
1028    /// A filter expression that filters connection profiles listed in the
1029    /// response. The expression must specify the field name, a comparison
1030    /// operator, and the value that you want to use for filtering. The value must
1031    /// be a string, a number, or a boolean. The comparison operator must be either
1032    /// =, !=, >, or <. For example, list connection profiles created this year by
1033    /// specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z**. You can
1034    /// also filter nested fields. For example, you could specify **mySql.username
1035    /// = %lt;my_username%gt;** to list all connection profiles configured to
1036    /// connect with a specific username.
1037    pub filter: std::string::String,
1038
1039    /// A comma-separated list of fields to order results according to.
1040    pub order_by: std::string::String,
1041
1042    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1043}
1044
1045impl ListConnectionProfilesRequest {
1046    pub fn new() -> Self {
1047        std::default::Default::default()
1048    }
1049
1050    /// Sets the value of [parent][crate::model::ListConnectionProfilesRequest::parent].
1051    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1052        self.parent = v.into();
1053        self
1054    }
1055
1056    /// Sets the value of [page_size][crate::model::ListConnectionProfilesRequest::page_size].
1057    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1058        self.page_size = v.into();
1059        self
1060    }
1061
1062    /// Sets the value of [page_token][crate::model::ListConnectionProfilesRequest::page_token].
1063    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1064        self.page_token = v.into();
1065        self
1066    }
1067
1068    /// Sets the value of [filter][crate::model::ListConnectionProfilesRequest::filter].
1069    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1070        self.filter = v.into();
1071        self
1072    }
1073
1074    /// Sets the value of [order_by][crate::model::ListConnectionProfilesRequest::order_by].
1075    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1076        self.order_by = v.into();
1077        self
1078    }
1079}
1080
1081impl wkt::message::Message for ListConnectionProfilesRequest {
1082    fn typename() -> &'static str {
1083        "type.googleapis.com/google.cloud.clouddms.v1.ListConnectionProfilesRequest"
1084    }
1085}
1086
1087/// Response message for 'ListConnectionProfiles' request.
1088#[derive(Clone, Default, PartialEq)]
1089#[non_exhaustive]
1090pub struct ListConnectionProfilesResponse {
1091    /// The response list of connection profiles.
1092    pub connection_profiles: std::vec::Vec<crate::model::ConnectionProfile>,
1093
1094    /// A token which can be sent as `page_token` to retrieve the next page.
1095    /// If this field is omitted, there are no subsequent pages.
1096    pub next_page_token: std::string::String,
1097
1098    /// Locations that could not be reached.
1099    pub unreachable: std::vec::Vec<std::string::String>,
1100
1101    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1102}
1103
1104impl ListConnectionProfilesResponse {
1105    pub fn new() -> Self {
1106        std::default::Default::default()
1107    }
1108
1109    /// Sets the value of [connection_profiles][crate::model::ListConnectionProfilesResponse::connection_profiles].
1110    pub fn set_connection_profiles<T, V>(mut self, v: T) -> Self
1111    where
1112        T: std::iter::IntoIterator<Item = V>,
1113        V: std::convert::Into<crate::model::ConnectionProfile>,
1114    {
1115        use std::iter::Iterator;
1116        self.connection_profiles = v.into_iter().map(|i| i.into()).collect();
1117        self
1118    }
1119
1120    /// Sets the value of [next_page_token][crate::model::ListConnectionProfilesResponse::next_page_token].
1121    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1122        self.next_page_token = v.into();
1123        self
1124    }
1125
1126    /// Sets the value of [unreachable][crate::model::ListConnectionProfilesResponse::unreachable].
1127    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1128    where
1129        T: std::iter::IntoIterator<Item = V>,
1130        V: std::convert::Into<std::string::String>,
1131    {
1132        use std::iter::Iterator;
1133        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1134        self
1135    }
1136}
1137
1138impl wkt::message::Message for ListConnectionProfilesResponse {
1139    fn typename() -> &'static str {
1140        "type.googleapis.com/google.cloud.clouddms.v1.ListConnectionProfilesResponse"
1141    }
1142}
1143
1144#[doc(hidden)]
1145impl gax::paginator::internal::PageableResponse for ListConnectionProfilesResponse {
1146    type PageItem = crate::model::ConnectionProfile;
1147
1148    fn items(self) -> std::vec::Vec<Self::PageItem> {
1149        self.connection_profiles
1150    }
1151
1152    fn next_page_token(&self) -> std::string::String {
1153        use std::clone::Clone;
1154        self.next_page_token.clone()
1155    }
1156}
1157
1158/// Request message for 'GetConnectionProfile' request.
1159#[derive(Clone, Default, PartialEq)]
1160#[non_exhaustive]
1161pub struct GetConnectionProfileRequest {
1162    /// Required. Name of the connection profile resource to get.
1163    pub name: std::string::String,
1164
1165    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1166}
1167
1168impl GetConnectionProfileRequest {
1169    pub fn new() -> Self {
1170        std::default::Default::default()
1171    }
1172
1173    /// Sets the value of [name][crate::model::GetConnectionProfileRequest::name].
1174    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1175        self.name = v.into();
1176        self
1177    }
1178}
1179
1180impl wkt::message::Message for GetConnectionProfileRequest {
1181    fn typename() -> &'static str {
1182        "type.googleapis.com/google.cloud.clouddms.v1.GetConnectionProfileRequest"
1183    }
1184}
1185
1186/// Request message for 'CreateConnectionProfile' request.
1187#[derive(Clone, Default, PartialEq)]
1188#[non_exhaustive]
1189pub struct CreateConnectionProfileRequest {
1190    /// Required. The parent which owns this collection of connection profiles.
1191    pub parent: std::string::String,
1192
1193    /// Required. The connection profile identifier.
1194    pub connection_profile_id: std::string::String,
1195
1196    /// Required. The create request body including the connection profile data
1197    pub connection_profile: std::option::Option<crate::model::ConnectionProfile>,
1198
1199    /// Optional. A unique ID used to identify the request. If the server receives
1200    /// two requests with the same ID, then the second request is ignored.
1201    ///
1202    /// It is recommended to always set this value to a UUID.
1203    ///
1204    /// The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
1205    /// (_), and hyphens (-). The maximum length is 40 characters.
1206    pub request_id: std::string::String,
1207
1208    /// Optional. Only validate the connection profile, but don't create any
1209    /// resources. The default is false. Only supported for Oracle connection
1210    /// profiles.
1211    pub validate_only: bool,
1212
1213    /// Optional. Create the connection profile without validating it.
1214    /// The default is false.
1215    /// Only supported for Oracle connection profiles.
1216    pub skip_validation: bool,
1217
1218    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1219}
1220
1221impl CreateConnectionProfileRequest {
1222    pub fn new() -> Self {
1223        std::default::Default::default()
1224    }
1225
1226    /// Sets the value of [parent][crate::model::CreateConnectionProfileRequest::parent].
1227    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1228        self.parent = v.into();
1229        self
1230    }
1231
1232    /// Sets the value of [connection_profile_id][crate::model::CreateConnectionProfileRequest::connection_profile_id].
1233    pub fn set_connection_profile_id<T: std::convert::Into<std::string::String>>(
1234        mut self,
1235        v: T,
1236    ) -> Self {
1237        self.connection_profile_id = v.into();
1238        self
1239    }
1240
1241    /// Sets the value of [connection_profile][crate::model::CreateConnectionProfileRequest::connection_profile].
1242    pub fn set_connection_profile<T>(mut self, v: T) -> Self
1243    where
1244        T: std::convert::Into<crate::model::ConnectionProfile>,
1245    {
1246        self.connection_profile = std::option::Option::Some(v.into());
1247        self
1248    }
1249
1250    /// Sets or clears the value of [connection_profile][crate::model::CreateConnectionProfileRequest::connection_profile].
1251    pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
1252    where
1253        T: std::convert::Into<crate::model::ConnectionProfile>,
1254    {
1255        self.connection_profile = v.map(|x| x.into());
1256        self
1257    }
1258
1259    /// Sets the value of [request_id][crate::model::CreateConnectionProfileRequest::request_id].
1260    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1261        self.request_id = v.into();
1262        self
1263    }
1264
1265    /// Sets the value of [validate_only][crate::model::CreateConnectionProfileRequest::validate_only].
1266    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1267        self.validate_only = v.into();
1268        self
1269    }
1270
1271    /// Sets the value of [skip_validation][crate::model::CreateConnectionProfileRequest::skip_validation].
1272    pub fn set_skip_validation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1273        self.skip_validation = v.into();
1274        self
1275    }
1276}
1277
1278impl wkt::message::Message for CreateConnectionProfileRequest {
1279    fn typename() -> &'static str {
1280        "type.googleapis.com/google.cloud.clouddms.v1.CreateConnectionProfileRequest"
1281    }
1282}
1283
1284/// Request message for 'UpdateConnectionProfile' request.
1285#[derive(Clone, Default, PartialEq)]
1286#[non_exhaustive]
1287pub struct UpdateConnectionProfileRequest {
1288    /// Required. Field mask is used to specify the fields to be overwritten by the
1289    /// update in the conversion workspace resource.
1290    pub update_mask: std::option::Option<wkt::FieldMask>,
1291
1292    /// Required. The connection profile parameters to update.
1293    pub connection_profile: std::option::Option<crate::model::ConnectionProfile>,
1294
1295    /// Optional. A unique ID used to identify the request. If the server receives
1296    /// two requests with the same ID, then the second request is ignored.
1297    ///
1298    /// It is recommended to always set this value to a UUID.
1299    ///
1300    /// The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
1301    /// (_), and hyphens (-). The maximum length is 40 characters.
1302    pub request_id: std::string::String,
1303
1304    /// Optional. Only validate the connection profile, but don't update any
1305    /// resources. The default is false. Only supported for Oracle connection
1306    /// profiles.
1307    pub validate_only: bool,
1308
1309    /// Optional. Update the connection profile without validating it.
1310    /// The default is false.
1311    /// Only supported for Oracle connection profiles.
1312    pub skip_validation: bool,
1313
1314    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1315}
1316
1317impl UpdateConnectionProfileRequest {
1318    pub fn new() -> Self {
1319        std::default::Default::default()
1320    }
1321
1322    /// Sets the value of [update_mask][crate::model::UpdateConnectionProfileRequest::update_mask].
1323    pub fn set_update_mask<T>(mut self, v: T) -> Self
1324    where
1325        T: std::convert::Into<wkt::FieldMask>,
1326    {
1327        self.update_mask = std::option::Option::Some(v.into());
1328        self
1329    }
1330
1331    /// Sets or clears the value of [update_mask][crate::model::UpdateConnectionProfileRequest::update_mask].
1332    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1333    where
1334        T: std::convert::Into<wkt::FieldMask>,
1335    {
1336        self.update_mask = v.map(|x| x.into());
1337        self
1338    }
1339
1340    /// Sets the value of [connection_profile][crate::model::UpdateConnectionProfileRequest::connection_profile].
1341    pub fn set_connection_profile<T>(mut self, v: T) -> Self
1342    where
1343        T: std::convert::Into<crate::model::ConnectionProfile>,
1344    {
1345        self.connection_profile = std::option::Option::Some(v.into());
1346        self
1347    }
1348
1349    /// Sets or clears the value of [connection_profile][crate::model::UpdateConnectionProfileRequest::connection_profile].
1350    pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
1351    where
1352        T: std::convert::Into<crate::model::ConnectionProfile>,
1353    {
1354        self.connection_profile = v.map(|x| x.into());
1355        self
1356    }
1357
1358    /// Sets the value of [request_id][crate::model::UpdateConnectionProfileRequest::request_id].
1359    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1360        self.request_id = v.into();
1361        self
1362    }
1363
1364    /// Sets the value of [validate_only][crate::model::UpdateConnectionProfileRequest::validate_only].
1365    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1366        self.validate_only = v.into();
1367        self
1368    }
1369
1370    /// Sets the value of [skip_validation][crate::model::UpdateConnectionProfileRequest::skip_validation].
1371    pub fn set_skip_validation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1372        self.skip_validation = v.into();
1373        self
1374    }
1375}
1376
1377impl wkt::message::Message for UpdateConnectionProfileRequest {
1378    fn typename() -> &'static str {
1379        "type.googleapis.com/google.cloud.clouddms.v1.UpdateConnectionProfileRequest"
1380    }
1381}
1382
1383/// Request message for 'DeleteConnectionProfile' request.
1384#[derive(Clone, Default, PartialEq)]
1385#[non_exhaustive]
1386pub struct DeleteConnectionProfileRequest {
1387    /// Required. Name of the connection profile resource to delete.
1388    pub name: std::string::String,
1389
1390    /// A unique ID used to identify the request. If the server receives two
1391    /// requests with the same ID, then the second request is ignored.
1392    ///
1393    /// It is recommended to always set this value to a UUID.
1394    ///
1395    /// The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
1396    /// (_), and hyphens (-). The maximum length is 40 characters.
1397    pub request_id: std::string::String,
1398
1399    /// In case of force delete, the CloudSQL replica database is also deleted
1400    /// (only for CloudSQL connection profile).
1401    pub force: bool,
1402
1403    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1404}
1405
1406impl DeleteConnectionProfileRequest {
1407    pub fn new() -> Self {
1408        std::default::Default::default()
1409    }
1410
1411    /// Sets the value of [name][crate::model::DeleteConnectionProfileRequest::name].
1412    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1413        self.name = v.into();
1414        self
1415    }
1416
1417    /// Sets the value of [request_id][crate::model::DeleteConnectionProfileRequest::request_id].
1418    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1419        self.request_id = v.into();
1420        self
1421    }
1422
1423    /// Sets the value of [force][crate::model::DeleteConnectionProfileRequest::force].
1424    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1425        self.force = v.into();
1426        self
1427    }
1428}
1429
1430impl wkt::message::Message for DeleteConnectionProfileRequest {
1431    fn typename() -> &'static str {
1432        "type.googleapis.com/google.cloud.clouddms.v1.DeleteConnectionProfileRequest"
1433    }
1434}
1435
1436/// Request message to create a new private connection in the specified project
1437/// and region.
1438#[derive(Clone, Default, PartialEq)]
1439#[non_exhaustive]
1440pub struct CreatePrivateConnectionRequest {
1441    /// Required. The parent that owns the collection of PrivateConnections.
1442    pub parent: std::string::String,
1443
1444    /// Required. The private connection identifier.
1445    pub private_connection_id: std::string::String,
1446
1447    /// Required. The private connection resource to create.
1448    pub private_connection: std::option::Option<crate::model::PrivateConnection>,
1449
1450    /// Optional. A unique ID used to identify the request. If the server receives
1451    /// two requests with the same ID, then the second request is ignored.
1452    ///
1453    /// It is recommended to always set this value to a UUID.
1454    ///
1455    /// The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
1456    /// (_), and hyphens (-). The maximum length is 40 characters.
1457    pub request_id: std::string::String,
1458
1459    /// Optional. If set to true, will skip validations.
1460    pub skip_validation: bool,
1461
1462    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1463}
1464
1465impl CreatePrivateConnectionRequest {
1466    pub fn new() -> Self {
1467        std::default::Default::default()
1468    }
1469
1470    /// Sets the value of [parent][crate::model::CreatePrivateConnectionRequest::parent].
1471    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1472        self.parent = v.into();
1473        self
1474    }
1475
1476    /// Sets the value of [private_connection_id][crate::model::CreatePrivateConnectionRequest::private_connection_id].
1477    pub fn set_private_connection_id<T: std::convert::Into<std::string::String>>(
1478        mut self,
1479        v: T,
1480    ) -> Self {
1481        self.private_connection_id = v.into();
1482        self
1483    }
1484
1485    /// Sets the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
1486    pub fn set_private_connection<T>(mut self, v: T) -> Self
1487    where
1488        T: std::convert::Into<crate::model::PrivateConnection>,
1489    {
1490        self.private_connection = std::option::Option::Some(v.into());
1491        self
1492    }
1493
1494    /// Sets or clears the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
1495    pub fn set_or_clear_private_connection<T>(mut self, v: std::option::Option<T>) -> Self
1496    where
1497        T: std::convert::Into<crate::model::PrivateConnection>,
1498    {
1499        self.private_connection = v.map(|x| x.into());
1500        self
1501    }
1502
1503    /// Sets the value of [request_id][crate::model::CreatePrivateConnectionRequest::request_id].
1504    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1505        self.request_id = v.into();
1506        self
1507    }
1508
1509    /// Sets the value of [skip_validation][crate::model::CreatePrivateConnectionRequest::skip_validation].
1510    pub fn set_skip_validation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1511        self.skip_validation = v.into();
1512        self
1513    }
1514}
1515
1516impl wkt::message::Message for CreatePrivateConnectionRequest {
1517    fn typename() -> &'static str {
1518        "type.googleapis.com/google.cloud.clouddms.v1.CreatePrivateConnectionRequest"
1519    }
1520}
1521
1522/// Request message to retrieve a list of private connections in a given project
1523/// and location.
1524#[derive(Clone, Default, PartialEq)]
1525#[non_exhaustive]
1526pub struct ListPrivateConnectionsRequest {
1527    /// Required. The parent that owns the collection of private connections.
1528    pub parent: std::string::String,
1529
1530    /// Maximum number of private connections to return.
1531    /// If unspecified, at most 50 private connections that are returned.
1532    /// The maximum value is 1000; values above 1000 are coerced to 1000.
1533    pub page_size: i32,
1534
1535    /// Page token received from a previous `ListPrivateConnections` call.
1536    /// Provide this to retrieve the subsequent page.
1537    ///
1538    /// When paginating, all other parameters provided to
1539    /// `ListPrivateConnections` must match the call that provided the page
1540    /// token.
1541    pub page_token: std::string::String,
1542
1543    /// A filter expression that filters private connections listed in the
1544    /// response. The expression must specify the field name, a comparison
1545    /// operator, and the value that you want to use for filtering. The value must
1546    /// be a string, a number, or a boolean. The comparison operator must be either
1547    /// =, !=, >, or <. For example, list private connections created this year by
1548    /// specifying **createTime %gt; 2021-01-01T00:00:00.000000000Z**.
1549    pub filter: std::string::String,
1550
1551    /// Order by fields for the result.
1552    pub order_by: std::string::String,
1553
1554    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1555}
1556
1557impl ListPrivateConnectionsRequest {
1558    pub fn new() -> Self {
1559        std::default::Default::default()
1560    }
1561
1562    /// Sets the value of [parent][crate::model::ListPrivateConnectionsRequest::parent].
1563    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1564        self.parent = v.into();
1565        self
1566    }
1567
1568    /// Sets the value of [page_size][crate::model::ListPrivateConnectionsRequest::page_size].
1569    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1570        self.page_size = v.into();
1571        self
1572    }
1573
1574    /// Sets the value of [page_token][crate::model::ListPrivateConnectionsRequest::page_token].
1575    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1576        self.page_token = v.into();
1577        self
1578    }
1579
1580    /// Sets the value of [filter][crate::model::ListPrivateConnectionsRequest::filter].
1581    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1582        self.filter = v.into();
1583        self
1584    }
1585
1586    /// Sets the value of [order_by][crate::model::ListPrivateConnectionsRequest::order_by].
1587    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1588        self.order_by = v.into();
1589        self
1590    }
1591}
1592
1593impl wkt::message::Message for ListPrivateConnectionsRequest {
1594    fn typename() -> &'static str {
1595        "type.googleapis.com/google.cloud.clouddms.v1.ListPrivateConnectionsRequest"
1596    }
1597}
1598
1599/// Response message for 'ListPrivateConnections' request.
1600#[derive(Clone, Default, PartialEq)]
1601#[non_exhaustive]
1602pub struct ListPrivateConnectionsResponse {
1603    /// List of private connections.
1604    pub private_connections: std::vec::Vec<crate::model::PrivateConnection>,
1605
1606    /// A token which can be sent as `page_token` to retrieve the next page.
1607    /// If this field is omitted, there are no subsequent pages.
1608    pub next_page_token: std::string::String,
1609
1610    /// Locations that could not be reached.
1611    pub unreachable: std::vec::Vec<std::string::String>,
1612
1613    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1614}
1615
1616impl ListPrivateConnectionsResponse {
1617    pub fn new() -> Self {
1618        std::default::Default::default()
1619    }
1620
1621    /// Sets the value of [private_connections][crate::model::ListPrivateConnectionsResponse::private_connections].
1622    pub fn set_private_connections<T, V>(mut self, v: T) -> Self
1623    where
1624        T: std::iter::IntoIterator<Item = V>,
1625        V: std::convert::Into<crate::model::PrivateConnection>,
1626    {
1627        use std::iter::Iterator;
1628        self.private_connections = v.into_iter().map(|i| i.into()).collect();
1629        self
1630    }
1631
1632    /// Sets the value of [next_page_token][crate::model::ListPrivateConnectionsResponse::next_page_token].
1633    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1634        self.next_page_token = v.into();
1635        self
1636    }
1637
1638    /// Sets the value of [unreachable][crate::model::ListPrivateConnectionsResponse::unreachable].
1639    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1640    where
1641        T: std::iter::IntoIterator<Item = V>,
1642        V: std::convert::Into<std::string::String>,
1643    {
1644        use std::iter::Iterator;
1645        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1646        self
1647    }
1648}
1649
1650impl wkt::message::Message for ListPrivateConnectionsResponse {
1651    fn typename() -> &'static str {
1652        "type.googleapis.com/google.cloud.clouddms.v1.ListPrivateConnectionsResponse"
1653    }
1654}
1655
1656#[doc(hidden)]
1657impl gax::paginator::internal::PageableResponse for ListPrivateConnectionsResponse {
1658    type PageItem = crate::model::PrivateConnection;
1659
1660    fn items(self) -> std::vec::Vec<Self::PageItem> {
1661        self.private_connections
1662    }
1663
1664    fn next_page_token(&self) -> std::string::String {
1665        use std::clone::Clone;
1666        self.next_page_token.clone()
1667    }
1668}
1669
1670/// Request message to delete a private connection.
1671#[derive(Clone, Default, PartialEq)]
1672#[non_exhaustive]
1673pub struct DeletePrivateConnectionRequest {
1674    /// Required. The name of the private connection to delete.
1675    pub name: std::string::String,
1676
1677    /// Optional. A unique ID used to identify the request. If the server receives
1678    /// two requests with the same ID, then the second request is ignored.
1679    ///
1680    /// It is recommended to always set this value to a UUID.
1681    ///
1682    /// The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
1683    /// (_), and hyphens (-). The maximum length is 40 characters.
1684    pub request_id: std::string::String,
1685
1686    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1687}
1688
1689impl DeletePrivateConnectionRequest {
1690    pub fn new() -> Self {
1691        std::default::Default::default()
1692    }
1693
1694    /// Sets the value of [name][crate::model::DeletePrivateConnectionRequest::name].
1695    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1696        self.name = v.into();
1697        self
1698    }
1699
1700    /// Sets the value of [request_id][crate::model::DeletePrivateConnectionRequest::request_id].
1701    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1702        self.request_id = v.into();
1703        self
1704    }
1705}
1706
1707impl wkt::message::Message for DeletePrivateConnectionRequest {
1708    fn typename() -> &'static str {
1709        "type.googleapis.com/google.cloud.clouddms.v1.DeletePrivateConnectionRequest"
1710    }
1711}
1712
1713/// Request message to get a private connection resource.
1714#[derive(Clone, Default, PartialEq)]
1715#[non_exhaustive]
1716pub struct GetPrivateConnectionRequest {
1717    /// Required. The name of the private connection to get.
1718    pub name: std::string::String,
1719
1720    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1721}
1722
1723impl GetPrivateConnectionRequest {
1724    pub fn new() -> Self {
1725        std::default::Default::default()
1726    }
1727
1728    /// Sets the value of [name][crate::model::GetPrivateConnectionRequest::name].
1729    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1730        self.name = v.into();
1731        self
1732    }
1733}
1734
1735impl wkt::message::Message for GetPrivateConnectionRequest {
1736    fn typename() -> &'static str {
1737        "type.googleapis.com/google.cloud.clouddms.v1.GetPrivateConnectionRequest"
1738    }
1739}
1740
1741/// Represents the metadata of the long-running operation.
1742#[derive(Clone, Default, PartialEq)]
1743#[non_exhaustive]
1744pub struct OperationMetadata {
1745    /// Output only. The time the operation was created.
1746    pub create_time: std::option::Option<wkt::Timestamp>,
1747
1748    /// Output only. The time the operation finished running.
1749    pub end_time: std::option::Option<wkt::Timestamp>,
1750
1751    /// Output only. Server-defined resource path for the target of the operation.
1752    pub target: std::string::String,
1753
1754    /// Output only. Name of the verb executed by the operation.
1755    pub verb: std::string::String,
1756
1757    /// Output only. Human-readable status of the operation, if any.
1758    pub status_message: std::string::String,
1759
1760    /// Output only. Identifies whether the user has requested cancellation
1761    /// of the operation. Operations that have successfully been cancelled
1762    /// have
1763    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
1764    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
1765    /// corresponding to `Code.CANCELLED`.
1766    ///
1767    /// [google.longrunning.Operation.error]: longrunning::model::Operation::result
1768    /// [google.rpc.Status.code]: rpc::model::Status::code
1769    pub requested_cancellation: bool,
1770
1771    /// Output only. API version used to start the operation.
1772    pub api_version: std::string::String,
1773
1774    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1775}
1776
1777impl OperationMetadata {
1778    pub fn new() -> Self {
1779        std::default::Default::default()
1780    }
1781
1782    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
1783    pub fn set_create_time<T>(mut self, v: T) -> Self
1784    where
1785        T: std::convert::Into<wkt::Timestamp>,
1786    {
1787        self.create_time = std::option::Option::Some(v.into());
1788        self
1789    }
1790
1791    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
1792    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1793    where
1794        T: std::convert::Into<wkt::Timestamp>,
1795    {
1796        self.create_time = v.map(|x| x.into());
1797        self
1798    }
1799
1800    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
1801    pub fn set_end_time<T>(mut self, v: T) -> Self
1802    where
1803        T: std::convert::Into<wkt::Timestamp>,
1804    {
1805        self.end_time = std::option::Option::Some(v.into());
1806        self
1807    }
1808
1809    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
1810    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
1811    where
1812        T: std::convert::Into<wkt::Timestamp>,
1813    {
1814        self.end_time = v.map(|x| x.into());
1815        self
1816    }
1817
1818    /// Sets the value of [target][crate::model::OperationMetadata::target].
1819    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1820        self.target = v.into();
1821        self
1822    }
1823
1824    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
1825    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1826        self.verb = v.into();
1827        self
1828    }
1829
1830    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
1831    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1832        self.status_message = v.into();
1833        self
1834    }
1835
1836    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
1837    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1838        self.requested_cancellation = v.into();
1839        self
1840    }
1841
1842    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
1843    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1844        self.api_version = v.into();
1845        self
1846    }
1847}
1848
1849impl wkt::message::Message for OperationMetadata {
1850    fn typename() -> &'static str {
1851        "type.googleapis.com/google.cloud.clouddms.v1.OperationMetadata"
1852    }
1853}
1854
1855/// Retrieve a list of all conversion workspaces in a given project and location.
1856#[derive(Clone, Default, PartialEq)]
1857#[non_exhaustive]
1858pub struct ListConversionWorkspacesRequest {
1859    /// Required. The parent which owns this collection of conversion workspaces.
1860    pub parent: std::string::String,
1861
1862    /// The maximum number of conversion workspaces to return. The service may
1863    /// return fewer than this value. If unspecified, at most 50 sets are returned.
1864    pub page_size: i32,
1865
1866    /// The nextPageToken value received in the previous call to
1867    /// conversionWorkspaces.list, used in the subsequent request to retrieve the
1868    /// next page of results. On first call this should be left blank. When
1869    /// paginating, all other parameters provided to conversionWorkspaces.list must
1870    /// match the call that provided the page token.
1871    pub page_token: std::string::String,
1872
1873    /// A filter expression that filters conversion workspaces listed in the
1874    /// response. The expression must specify the field name, a comparison
1875    /// operator, and the value that you want to use for filtering. The value must
1876    /// be a string, a number, or a boolean. The comparison operator must be either
1877    /// =, !=, >, or <. For example, list conversion workspaces created this year
1878    /// by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** You can
1879    /// also filter nested fields. For example, you could specify
1880    /// **source.version = "12.c.1"** to select all conversion workspaces with
1881    /// source database version equal to 12.c.1.
1882    pub filter: std::string::String,
1883
1884    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1885}
1886
1887impl ListConversionWorkspacesRequest {
1888    pub fn new() -> Self {
1889        std::default::Default::default()
1890    }
1891
1892    /// Sets the value of [parent][crate::model::ListConversionWorkspacesRequest::parent].
1893    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1894        self.parent = v.into();
1895        self
1896    }
1897
1898    /// Sets the value of [page_size][crate::model::ListConversionWorkspacesRequest::page_size].
1899    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1900        self.page_size = v.into();
1901        self
1902    }
1903
1904    /// Sets the value of [page_token][crate::model::ListConversionWorkspacesRequest::page_token].
1905    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1906        self.page_token = v.into();
1907        self
1908    }
1909
1910    /// Sets the value of [filter][crate::model::ListConversionWorkspacesRequest::filter].
1911    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1912        self.filter = v.into();
1913        self
1914    }
1915}
1916
1917impl wkt::message::Message for ListConversionWorkspacesRequest {
1918    fn typename() -> &'static str {
1919        "type.googleapis.com/google.cloud.clouddms.v1.ListConversionWorkspacesRequest"
1920    }
1921}
1922
1923/// Response message for 'ListConversionWorkspaces' request.
1924#[derive(Clone, Default, PartialEq)]
1925#[non_exhaustive]
1926pub struct ListConversionWorkspacesResponse {
1927    /// The list of conversion workspace objects.
1928    pub conversion_workspaces: std::vec::Vec<crate::model::ConversionWorkspace>,
1929
1930    /// A token which can be sent as `page_token` to retrieve the next page.
1931    /// If this field is omitted, there are no subsequent pages.
1932    pub next_page_token: std::string::String,
1933
1934    /// Locations that could not be reached.
1935    pub unreachable: std::vec::Vec<std::string::String>,
1936
1937    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1938}
1939
1940impl ListConversionWorkspacesResponse {
1941    pub fn new() -> Self {
1942        std::default::Default::default()
1943    }
1944
1945    /// Sets the value of [conversion_workspaces][crate::model::ListConversionWorkspacesResponse::conversion_workspaces].
1946    pub fn set_conversion_workspaces<T, V>(mut self, v: T) -> Self
1947    where
1948        T: std::iter::IntoIterator<Item = V>,
1949        V: std::convert::Into<crate::model::ConversionWorkspace>,
1950    {
1951        use std::iter::Iterator;
1952        self.conversion_workspaces = v.into_iter().map(|i| i.into()).collect();
1953        self
1954    }
1955
1956    /// Sets the value of [next_page_token][crate::model::ListConversionWorkspacesResponse::next_page_token].
1957    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1958        self.next_page_token = v.into();
1959        self
1960    }
1961
1962    /// Sets the value of [unreachable][crate::model::ListConversionWorkspacesResponse::unreachable].
1963    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1964    where
1965        T: std::iter::IntoIterator<Item = V>,
1966        V: std::convert::Into<std::string::String>,
1967    {
1968        use std::iter::Iterator;
1969        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1970        self
1971    }
1972}
1973
1974impl wkt::message::Message for ListConversionWorkspacesResponse {
1975    fn typename() -> &'static str {
1976        "type.googleapis.com/google.cloud.clouddms.v1.ListConversionWorkspacesResponse"
1977    }
1978}
1979
1980#[doc(hidden)]
1981impl gax::paginator::internal::PageableResponse for ListConversionWorkspacesResponse {
1982    type PageItem = crate::model::ConversionWorkspace;
1983
1984    fn items(self) -> std::vec::Vec<Self::PageItem> {
1985        self.conversion_workspaces
1986    }
1987
1988    fn next_page_token(&self) -> std::string::String {
1989        use std::clone::Clone;
1990        self.next_page_token.clone()
1991    }
1992}
1993
1994/// Request message for 'GetConversionWorkspace' request.
1995#[derive(Clone, Default, PartialEq)]
1996#[non_exhaustive]
1997pub struct GetConversionWorkspaceRequest {
1998    /// Required. Name of the conversion workspace resource to get.
1999    pub name: std::string::String,
2000
2001    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2002}
2003
2004impl GetConversionWorkspaceRequest {
2005    pub fn new() -> Self {
2006        std::default::Default::default()
2007    }
2008
2009    /// Sets the value of [name][crate::model::GetConversionWorkspaceRequest::name].
2010    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2011        self.name = v.into();
2012        self
2013    }
2014}
2015
2016impl wkt::message::Message for GetConversionWorkspaceRequest {
2017    fn typename() -> &'static str {
2018        "type.googleapis.com/google.cloud.clouddms.v1.GetConversionWorkspaceRequest"
2019    }
2020}
2021
2022/// Request message to create a new Conversion Workspace
2023/// in the specified project and region.
2024#[derive(Clone, Default, PartialEq)]
2025#[non_exhaustive]
2026pub struct CreateConversionWorkspaceRequest {
2027    /// Required. The parent which owns this collection of conversion workspaces.
2028    pub parent: std::string::String,
2029
2030    /// Required. The ID of the conversion workspace to create.
2031    pub conversion_workspace_id: std::string::String,
2032
2033    /// Required. Represents a conversion workspace object.
2034    pub conversion_workspace: std::option::Option<crate::model::ConversionWorkspace>,
2035
2036    /// A unique ID used to identify the request. If the server receives two
2037    /// requests with the same ID, then the second request is ignored.
2038    ///
2039    /// It is recommended to always set this value to a UUID.
2040    ///
2041    /// The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
2042    /// (_), and hyphens (-). The maximum length is 40 characters.
2043    pub request_id: std::string::String,
2044
2045    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2046}
2047
2048impl CreateConversionWorkspaceRequest {
2049    pub fn new() -> Self {
2050        std::default::Default::default()
2051    }
2052
2053    /// Sets the value of [parent][crate::model::CreateConversionWorkspaceRequest::parent].
2054    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2055        self.parent = v.into();
2056        self
2057    }
2058
2059    /// Sets the value of [conversion_workspace_id][crate::model::CreateConversionWorkspaceRequest::conversion_workspace_id].
2060    pub fn set_conversion_workspace_id<T: std::convert::Into<std::string::String>>(
2061        mut self,
2062        v: T,
2063    ) -> Self {
2064        self.conversion_workspace_id = v.into();
2065        self
2066    }
2067
2068    /// Sets the value of [conversion_workspace][crate::model::CreateConversionWorkspaceRequest::conversion_workspace].
2069    pub fn set_conversion_workspace<T>(mut self, v: T) -> Self
2070    where
2071        T: std::convert::Into<crate::model::ConversionWorkspace>,
2072    {
2073        self.conversion_workspace = std::option::Option::Some(v.into());
2074        self
2075    }
2076
2077    /// Sets or clears the value of [conversion_workspace][crate::model::CreateConversionWorkspaceRequest::conversion_workspace].
2078    pub fn set_or_clear_conversion_workspace<T>(mut self, v: std::option::Option<T>) -> Self
2079    where
2080        T: std::convert::Into<crate::model::ConversionWorkspace>,
2081    {
2082        self.conversion_workspace = v.map(|x| x.into());
2083        self
2084    }
2085
2086    /// Sets the value of [request_id][crate::model::CreateConversionWorkspaceRequest::request_id].
2087    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2088        self.request_id = v.into();
2089        self
2090    }
2091}
2092
2093impl wkt::message::Message for CreateConversionWorkspaceRequest {
2094    fn typename() -> &'static str {
2095        "type.googleapis.com/google.cloud.clouddms.v1.CreateConversionWorkspaceRequest"
2096    }
2097}
2098
2099/// Request message for 'UpdateConversionWorkspace' request.
2100#[derive(Clone, Default, PartialEq)]
2101#[non_exhaustive]
2102pub struct UpdateConversionWorkspaceRequest {
2103    /// Required. Field mask is used to specify the fields to be overwritten by the
2104    /// update in the conversion workspace resource.
2105    pub update_mask: std::option::Option<wkt::FieldMask>,
2106
2107    /// Required. The conversion workspace parameters to update.
2108    pub conversion_workspace: std::option::Option<crate::model::ConversionWorkspace>,
2109
2110    /// A unique ID used to identify the request. If the server receives two
2111    /// requests with the same ID, then the second request is ignored.
2112    ///
2113    /// It is recommended to always set this value to a UUID.
2114    ///
2115    /// The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
2116    /// (_), and hyphens (-). The maximum length is 40 characters.
2117    pub request_id: std::string::String,
2118
2119    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2120}
2121
2122impl UpdateConversionWorkspaceRequest {
2123    pub fn new() -> Self {
2124        std::default::Default::default()
2125    }
2126
2127    /// Sets the value of [update_mask][crate::model::UpdateConversionWorkspaceRequest::update_mask].
2128    pub fn set_update_mask<T>(mut self, v: T) -> Self
2129    where
2130        T: std::convert::Into<wkt::FieldMask>,
2131    {
2132        self.update_mask = std::option::Option::Some(v.into());
2133        self
2134    }
2135
2136    /// Sets or clears the value of [update_mask][crate::model::UpdateConversionWorkspaceRequest::update_mask].
2137    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2138    where
2139        T: std::convert::Into<wkt::FieldMask>,
2140    {
2141        self.update_mask = v.map(|x| x.into());
2142        self
2143    }
2144
2145    /// Sets the value of [conversion_workspace][crate::model::UpdateConversionWorkspaceRequest::conversion_workspace].
2146    pub fn set_conversion_workspace<T>(mut self, v: T) -> Self
2147    where
2148        T: std::convert::Into<crate::model::ConversionWorkspace>,
2149    {
2150        self.conversion_workspace = std::option::Option::Some(v.into());
2151        self
2152    }
2153
2154    /// Sets or clears the value of [conversion_workspace][crate::model::UpdateConversionWorkspaceRequest::conversion_workspace].
2155    pub fn set_or_clear_conversion_workspace<T>(mut self, v: std::option::Option<T>) -> Self
2156    where
2157        T: std::convert::Into<crate::model::ConversionWorkspace>,
2158    {
2159        self.conversion_workspace = v.map(|x| x.into());
2160        self
2161    }
2162
2163    /// Sets the value of [request_id][crate::model::UpdateConversionWorkspaceRequest::request_id].
2164    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2165        self.request_id = v.into();
2166        self
2167    }
2168}
2169
2170impl wkt::message::Message for UpdateConversionWorkspaceRequest {
2171    fn typename() -> &'static str {
2172        "type.googleapis.com/google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest"
2173    }
2174}
2175
2176/// Request message for 'DeleteConversionWorkspace' request.
2177#[derive(Clone, Default, PartialEq)]
2178#[non_exhaustive]
2179pub struct DeleteConversionWorkspaceRequest {
2180    /// Required. Name of the conversion workspace resource to delete.
2181    pub name: std::string::String,
2182
2183    /// A unique ID used to identify the request. If the server receives two
2184    /// requests with the same ID, then the second request is ignored.
2185    ///
2186    /// It is recommended to always set this value to a UUID.
2187    ///
2188    /// The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
2189    /// (_), and hyphens (-). The maximum length is 40 characters.
2190    pub request_id: std::string::String,
2191
2192    /// Force delete the conversion workspace, even if there's a running migration
2193    /// that is using the workspace.
2194    pub force: bool,
2195
2196    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2197}
2198
2199impl DeleteConversionWorkspaceRequest {
2200    pub fn new() -> Self {
2201        std::default::Default::default()
2202    }
2203
2204    /// Sets the value of [name][crate::model::DeleteConversionWorkspaceRequest::name].
2205    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2206        self.name = v.into();
2207        self
2208    }
2209
2210    /// Sets the value of [request_id][crate::model::DeleteConversionWorkspaceRequest::request_id].
2211    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2212        self.request_id = v.into();
2213        self
2214    }
2215
2216    /// Sets the value of [force][crate::model::DeleteConversionWorkspaceRequest::force].
2217    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2218        self.force = v.into();
2219        self
2220    }
2221}
2222
2223impl wkt::message::Message for DeleteConversionWorkspaceRequest {
2224    fn typename() -> &'static str {
2225        "type.googleapis.com/google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest"
2226    }
2227}
2228
2229/// Request message for 'CommitConversionWorkspace' request.
2230#[derive(Clone, Default, PartialEq)]
2231#[non_exhaustive]
2232pub struct CommitConversionWorkspaceRequest {
2233    /// Required. Name of the conversion workspace resource to commit.
2234    pub name: std::string::String,
2235
2236    /// Optional. Optional name of the commit.
2237    pub commit_name: std::string::String,
2238
2239    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2240}
2241
2242impl CommitConversionWorkspaceRequest {
2243    pub fn new() -> Self {
2244        std::default::Default::default()
2245    }
2246
2247    /// Sets the value of [name][crate::model::CommitConversionWorkspaceRequest::name].
2248    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2249        self.name = v.into();
2250        self
2251    }
2252
2253    /// Sets the value of [commit_name][crate::model::CommitConversionWorkspaceRequest::commit_name].
2254    pub fn set_commit_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2255        self.commit_name = v.into();
2256        self
2257    }
2258}
2259
2260impl wkt::message::Message for CommitConversionWorkspaceRequest {
2261    fn typename() -> &'static str {
2262        "type.googleapis.com/google.cloud.clouddms.v1.CommitConversionWorkspaceRequest"
2263    }
2264}
2265
2266/// Request message for 'RollbackConversionWorkspace' request.
2267#[derive(Clone, Default, PartialEq)]
2268#[non_exhaustive]
2269pub struct RollbackConversionWorkspaceRequest {
2270    /// Required. Name of the conversion workspace resource to roll back to.
2271    pub name: std::string::String,
2272
2273    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2274}
2275
2276impl RollbackConversionWorkspaceRequest {
2277    pub fn new() -> Self {
2278        std::default::Default::default()
2279    }
2280
2281    /// Sets the value of [name][crate::model::RollbackConversionWorkspaceRequest::name].
2282    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2283        self.name = v.into();
2284        self
2285    }
2286}
2287
2288impl wkt::message::Message for RollbackConversionWorkspaceRequest {
2289    fn typename() -> &'static str {
2290        "type.googleapis.com/google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest"
2291    }
2292}
2293
2294/// Request message for 'ApplyConversionWorkspace' request.
2295#[derive(Clone, Default, PartialEq)]
2296#[non_exhaustive]
2297pub struct ApplyConversionWorkspaceRequest {
2298    /// Required. The name of the conversion workspace resource for which to apply
2299    /// the draft tree. Must be in the form of:
2300    /// projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.
2301    pub name: std::string::String,
2302
2303    /// Filter which entities to apply. Leaving this field empty will apply all of
2304    /// the entities. Supports Google AIP 160 based filtering.
2305    pub filter: std::string::String,
2306
2307    /// Optional. Only validates the apply process, but doesn't change the
2308    /// destination database. Only works for PostgreSQL destination connection
2309    /// profile.
2310    pub dry_run: bool,
2311
2312    /// Optional. Specifies whether the conversion workspace is to be committed
2313    /// automatically after the apply.
2314    pub auto_commit: bool,
2315
2316    /// Which destination to use when applying the conversion workspace.
2317    pub destination:
2318        std::option::Option<crate::model::apply_conversion_workspace_request::Destination>,
2319
2320    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2321}
2322
2323impl ApplyConversionWorkspaceRequest {
2324    pub fn new() -> Self {
2325        std::default::Default::default()
2326    }
2327
2328    /// Sets the value of [name][crate::model::ApplyConversionWorkspaceRequest::name].
2329    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2330        self.name = v.into();
2331        self
2332    }
2333
2334    /// Sets the value of [filter][crate::model::ApplyConversionWorkspaceRequest::filter].
2335    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2336        self.filter = v.into();
2337        self
2338    }
2339
2340    /// Sets the value of [dry_run][crate::model::ApplyConversionWorkspaceRequest::dry_run].
2341    pub fn set_dry_run<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2342        self.dry_run = v.into();
2343        self
2344    }
2345
2346    /// Sets the value of [auto_commit][crate::model::ApplyConversionWorkspaceRequest::auto_commit].
2347    pub fn set_auto_commit<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2348        self.auto_commit = v.into();
2349        self
2350    }
2351
2352    /// Sets the value of [destination][crate::model::ApplyConversionWorkspaceRequest::destination].
2353    ///
2354    /// Note that all the setters affecting `destination` are mutually
2355    /// exclusive.
2356    pub fn set_destination<
2357        T: std::convert::Into<
2358                std::option::Option<crate::model::apply_conversion_workspace_request::Destination>,
2359            >,
2360    >(
2361        mut self,
2362        v: T,
2363    ) -> Self {
2364        self.destination = v.into();
2365        self
2366    }
2367
2368    /// The value of [destination][crate::model::ApplyConversionWorkspaceRequest::destination]
2369    /// if it holds a `ConnectionProfile`, `None` if the field is not set or
2370    /// holds a different branch.
2371    pub fn connection_profile(&self) -> std::option::Option<&std::string::String> {
2372        #[allow(unreachable_patterns)]
2373        self.destination.as_ref().and_then(|v| match v {
2374            crate::model::apply_conversion_workspace_request::Destination::ConnectionProfile(v) => {
2375                std::option::Option::Some(v)
2376            }
2377            _ => std::option::Option::None,
2378        })
2379    }
2380
2381    /// Sets the value of [destination][crate::model::ApplyConversionWorkspaceRequest::destination]
2382    /// to hold a `ConnectionProfile`.
2383    ///
2384    /// Note that all the setters affecting `destination` are
2385    /// mutually exclusive.
2386    pub fn set_connection_profile<T: std::convert::Into<std::string::String>>(
2387        mut self,
2388        v: T,
2389    ) -> Self {
2390        self.destination = std::option::Option::Some(
2391            crate::model::apply_conversion_workspace_request::Destination::ConnectionProfile(
2392                v.into(),
2393            ),
2394        );
2395        self
2396    }
2397}
2398
2399impl wkt::message::Message for ApplyConversionWorkspaceRequest {
2400    fn typename() -> &'static str {
2401        "type.googleapis.com/google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest"
2402    }
2403}
2404
2405/// Defines additional types related to [ApplyConversionWorkspaceRequest].
2406pub mod apply_conversion_workspace_request {
2407    #[allow(unused_imports)]
2408    use super::*;
2409
2410    /// Which destination to use when applying the conversion workspace.
2411    #[derive(Clone, Debug, PartialEq)]
2412    #[non_exhaustive]
2413    pub enum Destination {
2414        /// Optional. Fully qualified (Uri) name of the destination connection
2415        /// profile.
2416        ConnectionProfile(std::string::String),
2417    }
2418}
2419
2420/// Retrieve a list of all mapping rules in a given conversion workspace.
2421#[derive(Clone, Default, PartialEq)]
2422#[non_exhaustive]
2423pub struct ListMappingRulesRequest {
2424    /// Required. Name of the conversion workspace resource whose mapping rules are
2425    /// listed in the form of:
2426    /// projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.
2427    pub parent: std::string::String,
2428
2429    /// The maximum number of rules to return. The service may return
2430    /// fewer than this value.
2431    pub page_size: i32,
2432
2433    /// The nextPageToken value received in the previous call to
2434    /// mappingRules.list, used in the subsequent request to retrieve the next
2435    /// page of results. On first call this should be left blank. When paginating,
2436    /// all other parameters provided to mappingRules.list must match the call
2437    /// that provided the page token.
2438    pub page_token: std::string::String,
2439
2440    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2441}
2442
2443impl ListMappingRulesRequest {
2444    pub fn new() -> Self {
2445        std::default::Default::default()
2446    }
2447
2448    /// Sets the value of [parent][crate::model::ListMappingRulesRequest::parent].
2449    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2450        self.parent = v.into();
2451        self
2452    }
2453
2454    /// Sets the value of [page_size][crate::model::ListMappingRulesRequest::page_size].
2455    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2456        self.page_size = v.into();
2457        self
2458    }
2459
2460    /// Sets the value of [page_token][crate::model::ListMappingRulesRequest::page_token].
2461    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2462        self.page_token = v.into();
2463        self
2464    }
2465}
2466
2467impl wkt::message::Message for ListMappingRulesRequest {
2468    fn typename() -> &'static str {
2469        "type.googleapis.com/google.cloud.clouddms.v1.ListMappingRulesRequest"
2470    }
2471}
2472
2473/// Response message for 'ListMappingRulesRequest' request.
2474#[derive(Clone, Default, PartialEq)]
2475#[non_exhaustive]
2476pub struct ListMappingRulesResponse {
2477    /// The list of conversion workspace mapping rules.
2478    pub mapping_rules: std::vec::Vec<crate::model::MappingRule>,
2479
2480    /// A token which can be sent as `page_token` to retrieve the next page.
2481    /// If this field is omitted, there are no subsequent pages.
2482    pub next_page_token: std::string::String,
2483
2484    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2485}
2486
2487impl ListMappingRulesResponse {
2488    pub fn new() -> Self {
2489        std::default::Default::default()
2490    }
2491
2492    /// Sets the value of [mapping_rules][crate::model::ListMappingRulesResponse::mapping_rules].
2493    pub fn set_mapping_rules<T, V>(mut self, v: T) -> Self
2494    where
2495        T: std::iter::IntoIterator<Item = V>,
2496        V: std::convert::Into<crate::model::MappingRule>,
2497    {
2498        use std::iter::Iterator;
2499        self.mapping_rules = v.into_iter().map(|i| i.into()).collect();
2500        self
2501    }
2502
2503    /// Sets the value of [next_page_token][crate::model::ListMappingRulesResponse::next_page_token].
2504    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2505        self.next_page_token = v.into();
2506        self
2507    }
2508}
2509
2510impl wkt::message::Message for ListMappingRulesResponse {
2511    fn typename() -> &'static str {
2512        "type.googleapis.com/google.cloud.clouddms.v1.ListMappingRulesResponse"
2513    }
2514}
2515
2516#[doc(hidden)]
2517impl gax::paginator::internal::PageableResponse for ListMappingRulesResponse {
2518    type PageItem = crate::model::MappingRule;
2519
2520    fn items(self) -> std::vec::Vec<Self::PageItem> {
2521        self.mapping_rules
2522    }
2523
2524    fn next_page_token(&self) -> std::string::String {
2525        use std::clone::Clone;
2526        self.next_page_token.clone()
2527    }
2528}
2529
2530/// Request message for 'GetMappingRule' request.
2531#[derive(Clone, Default, PartialEq)]
2532#[non_exhaustive]
2533pub struct GetMappingRuleRequest {
2534    /// Required. Name of the mapping rule resource to get.
2535    /// Example: conversionWorkspaces/123/mappingRules/rule123
2536    ///
2537    /// In order to retrieve a previous revision of the mapping rule, also provide
2538    /// the revision ID.
2539    /// Example:
2540    /// conversionWorkspace/123/mappingRules/rule123@c7cfa2a8c7cfa2a8c7cfa2a8c7cfa2a8
2541    pub name: std::string::String,
2542
2543    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2544}
2545
2546impl GetMappingRuleRequest {
2547    pub fn new() -> Self {
2548        std::default::Default::default()
2549    }
2550
2551    /// Sets the value of [name][crate::model::GetMappingRuleRequest::name].
2552    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2553        self.name = v.into();
2554        self
2555    }
2556}
2557
2558impl wkt::message::Message for GetMappingRuleRequest {
2559    fn typename() -> &'static str {
2560        "type.googleapis.com/google.cloud.clouddms.v1.GetMappingRuleRequest"
2561    }
2562}
2563
2564/// Request message for 'SeedConversionWorkspace' request.
2565#[derive(Clone, Default, PartialEq)]
2566#[non_exhaustive]
2567pub struct SeedConversionWorkspaceRequest {
2568    /// Name of the conversion workspace resource to seed with new database
2569    /// structure, in the form of:
2570    /// projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.
2571    pub name: std::string::String,
2572
2573    /// Should the conversion workspace be committed automatically after the
2574    /// seed operation.
2575    pub auto_commit: bool,
2576
2577    /// The input to be used for seeding the conversion workspace. The input can
2578    /// either be from the source or destination databases and it can be provided
2579    /// through a connection profile or a DDL file.
2580    pub seed_from: std::option::Option<crate::model::seed_conversion_workspace_request::SeedFrom>,
2581
2582    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2583}
2584
2585impl SeedConversionWorkspaceRequest {
2586    pub fn new() -> Self {
2587        std::default::Default::default()
2588    }
2589
2590    /// Sets the value of [name][crate::model::SeedConversionWorkspaceRequest::name].
2591    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2592        self.name = v.into();
2593        self
2594    }
2595
2596    /// Sets the value of [auto_commit][crate::model::SeedConversionWorkspaceRequest::auto_commit].
2597    pub fn set_auto_commit<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2598        self.auto_commit = v.into();
2599        self
2600    }
2601
2602    /// Sets the value of [seed_from][crate::model::SeedConversionWorkspaceRequest::seed_from].
2603    ///
2604    /// Note that all the setters affecting `seed_from` are mutually
2605    /// exclusive.
2606    pub fn set_seed_from<
2607        T: std::convert::Into<
2608                std::option::Option<crate::model::seed_conversion_workspace_request::SeedFrom>,
2609            >,
2610    >(
2611        mut self,
2612        v: T,
2613    ) -> Self {
2614        self.seed_from = v.into();
2615        self
2616    }
2617
2618    /// The value of [seed_from][crate::model::SeedConversionWorkspaceRequest::seed_from]
2619    /// if it holds a `SourceConnectionProfile`, `None` if the field is not set or
2620    /// holds a different branch.
2621    pub fn source_connection_profile(&self) -> std::option::Option<&std::string::String> {
2622        #[allow(unreachable_patterns)]
2623        self.seed_from.as_ref().and_then(|v| match v {
2624            crate::model::seed_conversion_workspace_request::SeedFrom::SourceConnectionProfile(
2625                v,
2626            ) => std::option::Option::Some(v),
2627            _ => std::option::Option::None,
2628        })
2629    }
2630
2631    /// Sets the value of [seed_from][crate::model::SeedConversionWorkspaceRequest::seed_from]
2632    /// to hold a `SourceConnectionProfile`.
2633    ///
2634    /// Note that all the setters affecting `seed_from` are
2635    /// mutually exclusive.
2636    pub fn set_source_connection_profile<T: std::convert::Into<std::string::String>>(
2637        mut self,
2638        v: T,
2639    ) -> Self {
2640        self.seed_from = std::option::Option::Some(
2641            crate::model::seed_conversion_workspace_request::SeedFrom::SourceConnectionProfile(
2642                v.into(),
2643            ),
2644        );
2645        self
2646    }
2647
2648    /// The value of [seed_from][crate::model::SeedConversionWorkspaceRequest::seed_from]
2649    /// if it holds a `DestinationConnectionProfile`, `None` if the field is not set or
2650    /// holds a different branch.
2651    pub fn destination_connection_profile(&self) -> std::option::Option<&std::string::String> {
2652        #[allow(unreachable_patterns)]
2653        self.seed_from.as_ref().and_then(|v| match v {
2654            crate::model::seed_conversion_workspace_request::SeedFrom::DestinationConnectionProfile(v) => std::option::Option::Some(v),
2655            _ => std::option::Option::None,
2656        })
2657    }
2658
2659    /// Sets the value of [seed_from][crate::model::SeedConversionWorkspaceRequest::seed_from]
2660    /// to hold a `DestinationConnectionProfile`.
2661    ///
2662    /// Note that all the setters affecting `seed_from` are
2663    /// mutually exclusive.
2664    pub fn set_destination_connection_profile<T: std::convert::Into<std::string::String>>(
2665        mut self,
2666        v: T,
2667    ) -> Self {
2668        self.seed_from = std::option::Option::Some(
2669            crate::model::seed_conversion_workspace_request::SeedFrom::DestinationConnectionProfile(
2670                v.into(),
2671            ),
2672        );
2673        self
2674    }
2675}
2676
2677impl wkt::message::Message for SeedConversionWorkspaceRequest {
2678    fn typename() -> &'static str {
2679        "type.googleapis.com/google.cloud.clouddms.v1.SeedConversionWorkspaceRequest"
2680    }
2681}
2682
2683/// Defines additional types related to [SeedConversionWorkspaceRequest].
2684pub mod seed_conversion_workspace_request {
2685    #[allow(unused_imports)]
2686    use super::*;
2687
2688    /// The input to be used for seeding the conversion workspace. The input can
2689    /// either be from the source or destination databases and it can be provided
2690    /// through a connection profile or a DDL file.
2691    #[derive(Clone, Debug, PartialEq)]
2692    #[non_exhaustive]
2693    pub enum SeedFrom {
2694        /// Optional. Fully qualified (Uri) name of the source connection profile.
2695        SourceConnectionProfile(std::string::String),
2696        /// Optional. Fully qualified (Uri) name of the destination connection
2697        /// profile.
2698        DestinationConnectionProfile(std::string::String),
2699    }
2700}
2701
2702/// Request message for 'ConvertConversionWorkspace' request.
2703#[derive(Clone, Default, PartialEq)]
2704#[non_exhaustive]
2705pub struct ConvertConversionWorkspaceRequest {
2706    /// Name of the conversion workspace resource to convert in the form of:
2707    /// projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.
2708    pub name: std::string::String,
2709
2710    /// Optional. Specifies whether the conversion workspace is to be committed
2711    /// automatically after the conversion.
2712    pub auto_commit: bool,
2713
2714    /// Optional. Filter the entities to convert. Leaving this field empty will
2715    /// convert all of the entities. Supports Google AIP-160 style filtering.
2716    pub filter: std::string::String,
2717
2718    /// Optional. Automatically convert the full entity path for each entity
2719    /// specified by the filter. For example, if the filter specifies a table, that
2720    /// table schema (and database if there is one) will also be converted.
2721    pub convert_full_path: bool,
2722
2723    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2724}
2725
2726impl ConvertConversionWorkspaceRequest {
2727    pub fn new() -> Self {
2728        std::default::Default::default()
2729    }
2730
2731    /// Sets the value of [name][crate::model::ConvertConversionWorkspaceRequest::name].
2732    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2733        self.name = v.into();
2734        self
2735    }
2736
2737    /// Sets the value of [auto_commit][crate::model::ConvertConversionWorkspaceRequest::auto_commit].
2738    pub fn set_auto_commit<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2739        self.auto_commit = v.into();
2740        self
2741    }
2742
2743    /// Sets the value of [filter][crate::model::ConvertConversionWorkspaceRequest::filter].
2744    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2745        self.filter = v.into();
2746        self
2747    }
2748
2749    /// Sets the value of [convert_full_path][crate::model::ConvertConversionWorkspaceRequest::convert_full_path].
2750    pub fn set_convert_full_path<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2751        self.convert_full_path = v.into();
2752        self
2753    }
2754}
2755
2756impl wkt::message::Message for ConvertConversionWorkspaceRequest {
2757    fn typename() -> &'static str {
2758        "type.googleapis.com/google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest"
2759    }
2760}
2761
2762/// Request message for 'ImportMappingRules' request.
2763#[derive(Clone, Default, PartialEq)]
2764#[non_exhaustive]
2765pub struct ImportMappingRulesRequest {
2766    /// Required. Name of the conversion workspace resource to import the rules to
2767    /// in the form of:
2768    /// projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.
2769    pub parent: std::string::String,
2770
2771    /// Required. The format of the rules content file.
2772    pub rules_format: crate::model::ImportRulesFileFormat,
2773
2774    /// Required. One or more rules files.
2775    pub rules_files: std::vec::Vec<crate::model::import_mapping_rules_request::RulesFile>,
2776
2777    /// Required. Should the conversion workspace be committed automatically after
2778    /// the import operation.
2779    pub auto_commit: bool,
2780
2781    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2782}
2783
2784impl ImportMappingRulesRequest {
2785    pub fn new() -> Self {
2786        std::default::Default::default()
2787    }
2788
2789    /// Sets the value of [parent][crate::model::ImportMappingRulesRequest::parent].
2790    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2791        self.parent = v.into();
2792        self
2793    }
2794
2795    /// Sets the value of [rules_format][crate::model::ImportMappingRulesRequest::rules_format].
2796    pub fn set_rules_format<T: std::convert::Into<crate::model::ImportRulesFileFormat>>(
2797        mut self,
2798        v: T,
2799    ) -> Self {
2800        self.rules_format = v.into();
2801        self
2802    }
2803
2804    /// Sets the value of [rules_files][crate::model::ImportMappingRulesRequest::rules_files].
2805    pub fn set_rules_files<T, V>(mut self, v: T) -> Self
2806    where
2807        T: std::iter::IntoIterator<Item = V>,
2808        V: std::convert::Into<crate::model::import_mapping_rules_request::RulesFile>,
2809    {
2810        use std::iter::Iterator;
2811        self.rules_files = v.into_iter().map(|i| i.into()).collect();
2812        self
2813    }
2814
2815    /// Sets the value of [auto_commit][crate::model::ImportMappingRulesRequest::auto_commit].
2816    pub fn set_auto_commit<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2817        self.auto_commit = v.into();
2818        self
2819    }
2820}
2821
2822impl wkt::message::Message for ImportMappingRulesRequest {
2823    fn typename() -> &'static str {
2824        "type.googleapis.com/google.cloud.clouddms.v1.ImportMappingRulesRequest"
2825    }
2826}
2827
2828/// Defines additional types related to [ImportMappingRulesRequest].
2829pub mod import_mapping_rules_request {
2830    #[allow(unused_imports)]
2831    use super::*;
2832
2833    /// Details of a single rules file.
2834    #[derive(Clone, Default, PartialEq)]
2835    #[non_exhaustive]
2836    pub struct RulesFile {
2837        /// Required. The filename of the rules that needs to be converted. The
2838        /// filename is used mainly so that future logs of the import rules job
2839        /// contain it, and can therefore be searched by it.
2840        pub rules_source_filename: std::string::String,
2841
2842        /// Required. The text content of the rules that needs to be converted.
2843        pub rules_content: std::string::String,
2844
2845        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2846    }
2847
2848    impl RulesFile {
2849        pub fn new() -> Self {
2850            std::default::Default::default()
2851        }
2852
2853        /// Sets the value of [rules_source_filename][crate::model::import_mapping_rules_request::RulesFile::rules_source_filename].
2854        pub fn set_rules_source_filename<T: std::convert::Into<std::string::String>>(
2855            mut self,
2856            v: T,
2857        ) -> Self {
2858            self.rules_source_filename = v.into();
2859            self
2860        }
2861
2862        /// Sets the value of [rules_content][crate::model::import_mapping_rules_request::RulesFile::rules_content].
2863        pub fn set_rules_content<T: std::convert::Into<std::string::String>>(
2864            mut self,
2865            v: T,
2866        ) -> Self {
2867            self.rules_content = v.into();
2868            self
2869        }
2870    }
2871
2872    impl wkt::message::Message for RulesFile {
2873        fn typename() -> &'static str {
2874            "type.googleapis.com/google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile"
2875        }
2876    }
2877}
2878
2879/// Request message for 'DescribeDatabaseEntities' request.
2880#[derive(Clone, Default, PartialEq)]
2881#[non_exhaustive]
2882pub struct DescribeDatabaseEntitiesRequest {
2883    /// Required. Name of the conversion workspace resource whose database entities
2884    /// are described. Must be in the form of:
2885    /// projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.
2886    pub conversion_workspace: std::string::String,
2887
2888    /// Optional. The maximum number of entities to return. The service may return
2889    /// fewer entities than the value specifies.
2890    pub page_size: i32,
2891
2892    /// Optional. The nextPageToken value received in the previous call to
2893    /// conversionWorkspace.describeDatabaseEntities, used in the subsequent
2894    /// request to retrieve the next page of results. On first call this should be
2895    /// left blank. When paginating, all other parameters provided to
2896    /// conversionWorkspace.describeDatabaseEntities must match the call that
2897    /// provided the page token.
2898    pub page_token: std::string::String,
2899
2900    /// Required. The tree to fetch.
2901    pub tree: crate::model::describe_database_entities_request::DBTreeType,
2902
2903    /// Optional. Whether to retrieve the latest committed version of the entities
2904    /// or the latest version. This field is ignored if a specific commit_id is
2905    /// specified.
2906    pub uncommitted: bool,
2907
2908    /// Optional. Request a specific commit ID. If not specified, the entities from
2909    /// the latest commit are returned.
2910    pub commit_id: std::string::String,
2911
2912    /// Optional. Filter the returned entities based on AIP-160 standard.
2913    pub filter: std::string::String,
2914
2915    /// Optional. Results view based on AIP-157
2916    pub view: crate::model::DatabaseEntityView,
2917
2918    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2919}
2920
2921impl DescribeDatabaseEntitiesRequest {
2922    pub fn new() -> Self {
2923        std::default::Default::default()
2924    }
2925
2926    /// Sets the value of [conversion_workspace][crate::model::DescribeDatabaseEntitiesRequest::conversion_workspace].
2927    pub fn set_conversion_workspace<T: std::convert::Into<std::string::String>>(
2928        mut self,
2929        v: T,
2930    ) -> Self {
2931        self.conversion_workspace = v.into();
2932        self
2933    }
2934
2935    /// Sets the value of [page_size][crate::model::DescribeDatabaseEntitiesRequest::page_size].
2936    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2937        self.page_size = v.into();
2938        self
2939    }
2940
2941    /// Sets the value of [page_token][crate::model::DescribeDatabaseEntitiesRequest::page_token].
2942    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2943        self.page_token = v.into();
2944        self
2945    }
2946
2947    /// Sets the value of [tree][crate::model::DescribeDatabaseEntitiesRequest::tree].
2948    pub fn set_tree<
2949        T: std::convert::Into<crate::model::describe_database_entities_request::DBTreeType>,
2950    >(
2951        mut self,
2952        v: T,
2953    ) -> Self {
2954        self.tree = v.into();
2955        self
2956    }
2957
2958    /// Sets the value of [uncommitted][crate::model::DescribeDatabaseEntitiesRequest::uncommitted].
2959    pub fn set_uncommitted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2960        self.uncommitted = v.into();
2961        self
2962    }
2963
2964    /// Sets the value of [commit_id][crate::model::DescribeDatabaseEntitiesRequest::commit_id].
2965    pub fn set_commit_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2966        self.commit_id = v.into();
2967        self
2968    }
2969
2970    /// Sets the value of [filter][crate::model::DescribeDatabaseEntitiesRequest::filter].
2971    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2972        self.filter = v.into();
2973        self
2974    }
2975
2976    /// Sets the value of [view][crate::model::DescribeDatabaseEntitiesRequest::view].
2977    pub fn set_view<T: std::convert::Into<crate::model::DatabaseEntityView>>(
2978        mut self,
2979        v: T,
2980    ) -> Self {
2981        self.view = v.into();
2982        self
2983    }
2984}
2985
2986impl wkt::message::Message for DescribeDatabaseEntitiesRequest {
2987    fn typename() -> &'static str {
2988        "type.googleapis.com/google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest"
2989    }
2990}
2991
2992/// Defines additional types related to [DescribeDatabaseEntitiesRequest].
2993pub mod describe_database_entities_request {
2994    #[allow(unused_imports)]
2995    use super::*;
2996
2997    /// The type of a tree to return
2998    ///
2999    /// # Working with unknown values
3000    ///
3001    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3002    /// additional enum variants at any time. Adding new variants is not considered
3003    /// a breaking change. Applications should write their code in anticipation of:
3004    ///
3005    /// - New values appearing in future releases of the client library, **and**
3006    /// - New values received dynamically, without application changes.
3007    ///
3008    /// Please consult the [Working with enums] section in the user guide for some
3009    /// guidelines.
3010    ///
3011    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3012    #[derive(Clone, Debug, PartialEq)]
3013    #[non_exhaustive]
3014    pub enum DBTreeType {
3015        /// Unspecified tree type.
3016        Unspecified,
3017        /// The source database tree.
3018        SourceTree,
3019        /// The draft database tree.
3020        DraftTree,
3021        /// The destination database tree.
3022        DestinationTree,
3023        /// If set, the enum was initialized with an unknown value.
3024        ///
3025        /// Applications can examine the value using [DBTreeType::value] or
3026        /// [DBTreeType::name].
3027        UnknownValue(db_tree_type::UnknownValue),
3028    }
3029
3030    #[doc(hidden)]
3031    pub mod db_tree_type {
3032        #[allow(unused_imports)]
3033        use super::*;
3034        #[derive(Clone, Debug, PartialEq)]
3035        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3036    }
3037
3038    impl DBTreeType {
3039        /// Gets the enum value.
3040        ///
3041        /// Returns `None` if the enum contains an unknown value deserialized from
3042        /// the string representation of enums.
3043        pub fn value(&self) -> std::option::Option<i32> {
3044            match self {
3045                Self::Unspecified => std::option::Option::Some(0),
3046                Self::SourceTree => std::option::Option::Some(1),
3047                Self::DraftTree => std::option::Option::Some(2),
3048                Self::DestinationTree => std::option::Option::Some(3),
3049                Self::UnknownValue(u) => u.0.value(),
3050            }
3051        }
3052
3053        /// Gets the enum value as a string.
3054        ///
3055        /// Returns `None` if the enum contains an unknown value deserialized from
3056        /// the integer representation of enums.
3057        pub fn name(&self) -> std::option::Option<&str> {
3058            match self {
3059                Self::Unspecified => std::option::Option::Some("DB_TREE_TYPE_UNSPECIFIED"),
3060                Self::SourceTree => std::option::Option::Some("SOURCE_TREE"),
3061                Self::DraftTree => std::option::Option::Some("DRAFT_TREE"),
3062                Self::DestinationTree => std::option::Option::Some("DESTINATION_TREE"),
3063                Self::UnknownValue(u) => u.0.name(),
3064            }
3065        }
3066    }
3067
3068    impl std::default::Default for DBTreeType {
3069        fn default() -> Self {
3070            use std::convert::From;
3071            Self::from(0)
3072        }
3073    }
3074
3075    impl std::fmt::Display for DBTreeType {
3076        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3077            wkt::internal::display_enum(f, self.name(), self.value())
3078        }
3079    }
3080
3081    impl std::convert::From<i32> for DBTreeType {
3082        fn from(value: i32) -> Self {
3083            match value {
3084                0 => Self::Unspecified,
3085                1 => Self::SourceTree,
3086                2 => Self::DraftTree,
3087                3 => Self::DestinationTree,
3088                _ => Self::UnknownValue(db_tree_type::UnknownValue(
3089                    wkt::internal::UnknownEnumValue::Integer(value),
3090                )),
3091            }
3092        }
3093    }
3094
3095    impl std::convert::From<&str> for DBTreeType {
3096        fn from(value: &str) -> Self {
3097            use std::string::ToString;
3098            match value {
3099                "DB_TREE_TYPE_UNSPECIFIED" => Self::Unspecified,
3100                "SOURCE_TREE" => Self::SourceTree,
3101                "DRAFT_TREE" => Self::DraftTree,
3102                "DESTINATION_TREE" => Self::DestinationTree,
3103                _ => Self::UnknownValue(db_tree_type::UnknownValue(
3104                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3105                )),
3106            }
3107        }
3108    }
3109
3110    impl serde::ser::Serialize for DBTreeType {
3111        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3112        where
3113            S: serde::Serializer,
3114        {
3115            match self {
3116                Self::Unspecified => serializer.serialize_i32(0),
3117                Self::SourceTree => serializer.serialize_i32(1),
3118                Self::DraftTree => serializer.serialize_i32(2),
3119                Self::DestinationTree => serializer.serialize_i32(3),
3120                Self::UnknownValue(u) => u.0.serialize(serializer),
3121            }
3122        }
3123    }
3124
3125    impl<'de> serde::de::Deserialize<'de> for DBTreeType {
3126        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3127        where
3128            D: serde::Deserializer<'de>,
3129        {
3130            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DBTreeType>::new(
3131                ".google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest.DBTreeType",
3132            ))
3133        }
3134    }
3135}
3136
3137/// Response message for 'DescribeDatabaseEntities' request.
3138#[derive(Clone, Default, PartialEq)]
3139#[non_exhaustive]
3140pub struct DescribeDatabaseEntitiesResponse {
3141    /// The list of database entities for the conversion workspace.
3142    pub database_entities: std::vec::Vec<crate::model::DatabaseEntity>,
3143
3144    /// A token which can be sent as `page_token` to retrieve the next page.
3145    /// If this field is omitted, there are no subsequent pages.
3146    pub next_page_token: std::string::String,
3147
3148    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3149}
3150
3151impl DescribeDatabaseEntitiesResponse {
3152    pub fn new() -> Self {
3153        std::default::Default::default()
3154    }
3155
3156    /// Sets the value of [database_entities][crate::model::DescribeDatabaseEntitiesResponse::database_entities].
3157    pub fn set_database_entities<T, V>(mut self, v: T) -> Self
3158    where
3159        T: std::iter::IntoIterator<Item = V>,
3160        V: std::convert::Into<crate::model::DatabaseEntity>,
3161    {
3162        use std::iter::Iterator;
3163        self.database_entities = v.into_iter().map(|i| i.into()).collect();
3164        self
3165    }
3166
3167    /// Sets the value of [next_page_token][crate::model::DescribeDatabaseEntitiesResponse::next_page_token].
3168    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3169        self.next_page_token = v.into();
3170        self
3171    }
3172}
3173
3174impl wkt::message::Message for DescribeDatabaseEntitiesResponse {
3175    fn typename() -> &'static str {
3176        "type.googleapis.com/google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse"
3177    }
3178}
3179
3180#[doc(hidden)]
3181impl gax::paginator::internal::PageableResponse for DescribeDatabaseEntitiesResponse {
3182    type PageItem = crate::model::DatabaseEntity;
3183
3184    fn items(self) -> std::vec::Vec<Self::PageItem> {
3185        self.database_entities
3186    }
3187
3188    fn next_page_token(&self) -> std::string::String {
3189        use std::clone::Clone;
3190        self.next_page_token.clone()
3191    }
3192}
3193
3194/// Request message for 'SearchBackgroundJobs' request.
3195#[derive(Clone, Default, PartialEq)]
3196#[non_exhaustive]
3197pub struct SearchBackgroundJobsRequest {
3198    /// Required. Name of the conversion workspace resource whose jobs are listed,
3199    /// in the form of:
3200    /// projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.
3201    pub conversion_workspace: std::string::String,
3202
3203    /// Optional. Whether or not to return just the most recent job per job type,
3204    pub return_most_recent_per_job_type: bool,
3205
3206    /// Optional. The maximum number of jobs to return. The service may return
3207    /// fewer than this value. If unspecified, at most 100 jobs are
3208    /// returned. The maximum value is 100; values above 100 are coerced to
3209    /// 100.
3210    pub max_size: i32,
3211
3212    /// Optional. If provided, only returns jobs that completed until (not
3213    /// including) the given timestamp.
3214    pub completed_until_time: std::option::Option<wkt::Timestamp>,
3215
3216    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3217}
3218
3219impl SearchBackgroundJobsRequest {
3220    pub fn new() -> Self {
3221        std::default::Default::default()
3222    }
3223
3224    /// Sets the value of [conversion_workspace][crate::model::SearchBackgroundJobsRequest::conversion_workspace].
3225    pub fn set_conversion_workspace<T: std::convert::Into<std::string::String>>(
3226        mut self,
3227        v: T,
3228    ) -> Self {
3229        self.conversion_workspace = v.into();
3230        self
3231    }
3232
3233    /// Sets the value of [return_most_recent_per_job_type][crate::model::SearchBackgroundJobsRequest::return_most_recent_per_job_type].
3234    pub fn set_return_most_recent_per_job_type<T: std::convert::Into<bool>>(
3235        mut self,
3236        v: T,
3237    ) -> Self {
3238        self.return_most_recent_per_job_type = v.into();
3239        self
3240    }
3241
3242    /// Sets the value of [max_size][crate::model::SearchBackgroundJobsRequest::max_size].
3243    pub fn set_max_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3244        self.max_size = v.into();
3245        self
3246    }
3247
3248    /// Sets the value of [completed_until_time][crate::model::SearchBackgroundJobsRequest::completed_until_time].
3249    pub fn set_completed_until_time<T>(mut self, v: T) -> Self
3250    where
3251        T: std::convert::Into<wkt::Timestamp>,
3252    {
3253        self.completed_until_time = std::option::Option::Some(v.into());
3254        self
3255    }
3256
3257    /// Sets or clears the value of [completed_until_time][crate::model::SearchBackgroundJobsRequest::completed_until_time].
3258    pub fn set_or_clear_completed_until_time<T>(mut self, v: std::option::Option<T>) -> Self
3259    where
3260        T: std::convert::Into<wkt::Timestamp>,
3261    {
3262        self.completed_until_time = v.map(|x| x.into());
3263        self
3264    }
3265}
3266
3267impl wkt::message::Message for SearchBackgroundJobsRequest {
3268    fn typename() -> &'static str {
3269        "type.googleapis.com/google.cloud.clouddms.v1.SearchBackgroundJobsRequest"
3270    }
3271}
3272
3273/// Response message for 'SearchBackgroundJobs' request.
3274#[derive(Clone, Default, PartialEq)]
3275#[non_exhaustive]
3276pub struct SearchBackgroundJobsResponse {
3277    /// The list of conversion workspace mapping rules.
3278    pub jobs: std::vec::Vec<crate::model::BackgroundJobLogEntry>,
3279
3280    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3281}
3282
3283impl SearchBackgroundJobsResponse {
3284    pub fn new() -> Self {
3285        std::default::Default::default()
3286    }
3287
3288    /// Sets the value of [jobs][crate::model::SearchBackgroundJobsResponse::jobs].
3289    pub fn set_jobs<T, V>(mut self, v: T) -> Self
3290    where
3291        T: std::iter::IntoIterator<Item = V>,
3292        V: std::convert::Into<crate::model::BackgroundJobLogEntry>,
3293    {
3294        use std::iter::Iterator;
3295        self.jobs = v.into_iter().map(|i| i.into()).collect();
3296        self
3297    }
3298}
3299
3300impl wkt::message::Message for SearchBackgroundJobsResponse {
3301    fn typename() -> &'static str {
3302        "type.googleapis.com/google.cloud.clouddms.v1.SearchBackgroundJobsResponse"
3303    }
3304}
3305
3306/// Request message for 'DescribeConversionWorkspaceRevisions' request.
3307#[derive(Clone, Default, PartialEq)]
3308#[non_exhaustive]
3309pub struct DescribeConversionWorkspaceRevisionsRequest {
3310    /// Required. Name of the conversion workspace resource whose revisions are
3311    /// listed. Must be in the form of:
3312    /// projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.
3313    pub conversion_workspace: std::string::String,
3314
3315    /// Optional. Optional filter to request a specific commit ID.
3316    pub commit_id: std::string::String,
3317
3318    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3319}
3320
3321impl DescribeConversionWorkspaceRevisionsRequest {
3322    pub fn new() -> Self {
3323        std::default::Default::default()
3324    }
3325
3326    /// Sets the value of [conversion_workspace][crate::model::DescribeConversionWorkspaceRevisionsRequest::conversion_workspace].
3327    pub fn set_conversion_workspace<T: std::convert::Into<std::string::String>>(
3328        mut self,
3329        v: T,
3330    ) -> Self {
3331        self.conversion_workspace = v.into();
3332        self
3333    }
3334
3335    /// Sets the value of [commit_id][crate::model::DescribeConversionWorkspaceRevisionsRequest::commit_id].
3336    pub fn set_commit_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3337        self.commit_id = v.into();
3338        self
3339    }
3340}
3341
3342impl wkt::message::Message for DescribeConversionWorkspaceRevisionsRequest {
3343    fn typename() -> &'static str {
3344        "type.googleapis.com/google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest"
3345    }
3346}
3347
3348/// Response message for 'DescribeConversionWorkspaceRevisions' request.
3349#[derive(Clone, Default, PartialEq)]
3350#[non_exhaustive]
3351pub struct DescribeConversionWorkspaceRevisionsResponse {
3352    /// The list of conversion workspace revisions.
3353    pub revisions: std::vec::Vec<crate::model::ConversionWorkspace>,
3354
3355    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3356}
3357
3358impl DescribeConversionWorkspaceRevisionsResponse {
3359    pub fn new() -> Self {
3360        std::default::Default::default()
3361    }
3362
3363    /// Sets the value of [revisions][crate::model::DescribeConversionWorkspaceRevisionsResponse::revisions].
3364    pub fn set_revisions<T, V>(mut self, v: T) -> Self
3365    where
3366        T: std::iter::IntoIterator<Item = V>,
3367        V: std::convert::Into<crate::model::ConversionWorkspace>,
3368    {
3369        use std::iter::Iterator;
3370        self.revisions = v.into_iter().map(|i| i.into()).collect();
3371        self
3372    }
3373}
3374
3375impl wkt::message::Message for DescribeConversionWorkspaceRevisionsResponse {
3376    fn typename() -> &'static str {
3377        "type.googleapis.com/google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse"
3378    }
3379}
3380
3381/// Request message for 'CreateMappingRule' command.
3382#[derive(Clone, Default, PartialEq)]
3383#[non_exhaustive]
3384pub struct CreateMappingRuleRequest {
3385    /// Required. The parent which owns this collection of mapping rules.
3386    pub parent: std::string::String,
3387
3388    /// Required. The ID of the rule to create.
3389    pub mapping_rule_id: std::string::String,
3390
3391    /// Required. Represents a [mapping rule]
3392    /// (<https://cloud.google.com/database-migration/reference/rest/v1/projects.locations.mappingRules>)
3393    /// object.
3394    pub mapping_rule: std::option::Option<crate::model::MappingRule>,
3395
3396    /// A unique ID used to identify the request. If the server receives two
3397    /// requests with the same ID, then the second request is ignored.
3398    ///
3399    /// It is recommended to always set this value to a UUID.
3400    ///
3401    /// The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
3402    /// (_), and hyphens (-). The maximum length is 40 characters.
3403    pub request_id: std::string::String,
3404
3405    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3406}
3407
3408impl CreateMappingRuleRequest {
3409    pub fn new() -> Self {
3410        std::default::Default::default()
3411    }
3412
3413    /// Sets the value of [parent][crate::model::CreateMappingRuleRequest::parent].
3414    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3415        self.parent = v.into();
3416        self
3417    }
3418
3419    /// Sets the value of [mapping_rule_id][crate::model::CreateMappingRuleRequest::mapping_rule_id].
3420    pub fn set_mapping_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3421        self.mapping_rule_id = v.into();
3422        self
3423    }
3424
3425    /// Sets the value of [mapping_rule][crate::model::CreateMappingRuleRequest::mapping_rule].
3426    pub fn set_mapping_rule<T>(mut self, v: T) -> Self
3427    where
3428        T: std::convert::Into<crate::model::MappingRule>,
3429    {
3430        self.mapping_rule = std::option::Option::Some(v.into());
3431        self
3432    }
3433
3434    /// Sets or clears the value of [mapping_rule][crate::model::CreateMappingRuleRequest::mapping_rule].
3435    pub fn set_or_clear_mapping_rule<T>(mut self, v: std::option::Option<T>) -> Self
3436    where
3437        T: std::convert::Into<crate::model::MappingRule>,
3438    {
3439        self.mapping_rule = v.map(|x| x.into());
3440        self
3441    }
3442
3443    /// Sets the value of [request_id][crate::model::CreateMappingRuleRequest::request_id].
3444    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3445        self.request_id = v.into();
3446        self
3447    }
3448}
3449
3450impl wkt::message::Message for CreateMappingRuleRequest {
3451    fn typename() -> &'static str {
3452        "type.googleapis.com/google.cloud.clouddms.v1.CreateMappingRuleRequest"
3453    }
3454}
3455
3456/// Request message for 'DeleteMappingRule' request.
3457#[derive(Clone, Default, PartialEq)]
3458#[non_exhaustive]
3459pub struct DeleteMappingRuleRequest {
3460    /// Required. Name of the mapping rule resource to delete.
3461    pub name: std::string::String,
3462
3463    /// Optional. A unique ID used to identify the request. If the server receives
3464    /// two requests with the same ID, then the second request is ignored.
3465    ///
3466    /// It is recommended to always set this value to a UUID.
3467    ///
3468    /// The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
3469    /// (_), and hyphens (-). The maximum length is 40 characters.
3470    pub request_id: std::string::String,
3471
3472    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3473}
3474
3475impl DeleteMappingRuleRequest {
3476    pub fn new() -> Self {
3477        std::default::Default::default()
3478    }
3479
3480    /// Sets the value of [name][crate::model::DeleteMappingRuleRequest::name].
3481    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3482        self.name = v.into();
3483        self
3484    }
3485
3486    /// Sets the value of [request_id][crate::model::DeleteMappingRuleRequest::request_id].
3487    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3488        self.request_id = v.into();
3489        self
3490    }
3491}
3492
3493impl wkt::message::Message for DeleteMappingRuleRequest {
3494    fn typename() -> &'static str {
3495        "type.googleapis.com/google.cloud.clouddms.v1.DeleteMappingRuleRequest"
3496    }
3497}
3498
3499/// Request message for 'FetchStaticIps' request.
3500#[derive(Clone, Default, PartialEq)]
3501#[non_exhaustive]
3502pub struct FetchStaticIpsRequest {
3503    /// Required. The resource name for the location for which static IPs should be
3504    /// returned. Must be in the format `projects/*/locations/*`.
3505    pub name: std::string::String,
3506
3507    /// Maximum number of IPs to return.
3508    pub page_size: i32,
3509
3510    /// A page token, received from a previous `FetchStaticIps` call.
3511    pub page_token: std::string::String,
3512
3513    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3514}
3515
3516impl FetchStaticIpsRequest {
3517    pub fn new() -> Self {
3518        std::default::Default::default()
3519    }
3520
3521    /// Sets the value of [name][crate::model::FetchStaticIpsRequest::name].
3522    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3523        self.name = v.into();
3524        self
3525    }
3526
3527    /// Sets the value of [page_size][crate::model::FetchStaticIpsRequest::page_size].
3528    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3529        self.page_size = v.into();
3530        self
3531    }
3532
3533    /// Sets the value of [page_token][crate::model::FetchStaticIpsRequest::page_token].
3534    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3535        self.page_token = v.into();
3536        self
3537    }
3538}
3539
3540impl wkt::message::Message for FetchStaticIpsRequest {
3541    fn typename() -> &'static str {
3542        "type.googleapis.com/google.cloud.clouddms.v1.FetchStaticIpsRequest"
3543    }
3544}
3545
3546/// Response message for a 'FetchStaticIps' request.
3547#[derive(Clone, Default, PartialEq)]
3548#[non_exhaustive]
3549pub struct FetchStaticIpsResponse {
3550    /// List of static IPs.
3551    pub static_ips: std::vec::Vec<std::string::String>,
3552
3553    /// A token that can be sent as `page_token` to retrieve the next page.
3554    /// If this field is omitted, there are no subsequent pages.
3555    pub next_page_token: std::string::String,
3556
3557    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3558}
3559
3560impl FetchStaticIpsResponse {
3561    pub fn new() -> Self {
3562        std::default::Default::default()
3563    }
3564
3565    /// Sets the value of [static_ips][crate::model::FetchStaticIpsResponse::static_ips].
3566    pub fn set_static_ips<T, V>(mut self, v: T) -> Self
3567    where
3568        T: std::iter::IntoIterator<Item = V>,
3569        V: std::convert::Into<std::string::String>,
3570    {
3571        use std::iter::Iterator;
3572        self.static_ips = v.into_iter().map(|i| i.into()).collect();
3573        self
3574    }
3575
3576    /// Sets the value of [next_page_token][crate::model::FetchStaticIpsResponse::next_page_token].
3577    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3578        self.next_page_token = v.into();
3579        self
3580    }
3581}
3582
3583impl wkt::message::Message for FetchStaticIpsResponse {
3584    fn typename() -> &'static str {
3585        "type.googleapis.com/google.cloud.clouddms.v1.FetchStaticIpsResponse"
3586    }
3587}
3588
3589/// SSL configuration information.
3590#[derive(Clone, Default, PartialEq)]
3591#[non_exhaustive]
3592pub struct SslConfig {
3593    /// Output only. The ssl config type according to 'client_key',
3594    /// 'client_certificate' and 'ca_certificate'.
3595    pub r#type: crate::model::ssl_config::SslType,
3596
3597    /// Input only. The unencrypted PKCS#1 or PKCS#8 PEM-encoded private key
3598    /// associated with the Client Certificate. If this field is used then the
3599    /// 'client_certificate' field is mandatory.
3600    pub client_key: std::string::String,
3601
3602    /// Input only. The x509 PEM-encoded certificate that will be used by the
3603    /// replica to authenticate against the source database server.If this field is
3604    /// used then the 'client_key' field is mandatory.
3605    pub client_certificate: std::string::String,
3606
3607    /// Required. Input only. The x509 PEM-encoded certificate of the CA that
3608    /// signed the source database server's certificate. The replica will use this
3609    /// certificate to verify it's connecting to the right host.
3610    pub ca_certificate: std::string::String,
3611
3612    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3613}
3614
3615impl SslConfig {
3616    pub fn new() -> Self {
3617        std::default::Default::default()
3618    }
3619
3620    /// Sets the value of [r#type][crate::model::SslConfig::type].
3621    pub fn set_type<T: std::convert::Into<crate::model::ssl_config::SslType>>(
3622        mut self,
3623        v: T,
3624    ) -> Self {
3625        self.r#type = v.into();
3626        self
3627    }
3628
3629    /// Sets the value of [client_key][crate::model::SslConfig::client_key].
3630    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3631        self.client_key = v.into();
3632        self
3633    }
3634
3635    /// Sets the value of [client_certificate][crate::model::SslConfig::client_certificate].
3636    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
3637        mut self,
3638        v: T,
3639    ) -> Self {
3640        self.client_certificate = v.into();
3641        self
3642    }
3643
3644    /// Sets the value of [ca_certificate][crate::model::SslConfig::ca_certificate].
3645    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3646        self.ca_certificate = v.into();
3647        self
3648    }
3649}
3650
3651impl wkt::message::Message for SslConfig {
3652    fn typename() -> &'static str {
3653        "type.googleapis.com/google.cloud.clouddms.v1.SslConfig"
3654    }
3655}
3656
3657/// Defines additional types related to [SslConfig].
3658pub mod ssl_config {
3659    #[allow(unused_imports)]
3660    use super::*;
3661
3662    /// Specifies The kind of ssl configuration used.
3663    ///
3664    /// # Working with unknown values
3665    ///
3666    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3667    /// additional enum variants at any time. Adding new variants is not considered
3668    /// a breaking change. Applications should write their code in anticipation of:
3669    ///
3670    /// - New values appearing in future releases of the client library, **and**
3671    /// - New values received dynamically, without application changes.
3672    ///
3673    /// Please consult the [Working with enums] section in the user guide for some
3674    /// guidelines.
3675    ///
3676    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3677    #[derive(Clone, Debug, PartialEq)]
3678    #[non_exhaustive]
3679    pub enum SslType {
3680        /// Unspecified.
3681        Unspecified,
3682        /// Only 'ca_certificate' specified.
3683        ServerOnly,
3684        /// Both server ('ca_certificate'), and client ('client_key',
3685        /// 'client_certificate') specified.
3686        ServerClient,
3687        /// If set, the enum was initialized with an unknown value.
3688        ///
3689        /// Applications can examine the value using [SslType::value] or
3690        /// [SslType::name].
3691        UnknownValue(ssl_type::UnknownValue),
3692    }
3693
3694    #[doc(hidden)]
3695    pub mod ssl_type {
3696        #[allow(unused_imports)]
3697        use super::*;
3698        #[derive(Clone, Debug, PartialEq)]
3699        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3700    }
3701
3702    impl SslType {
3703        /// Gets the enum value.
3704        ///
3705        /// Returns `None` if the enum contains an unknown value deserialized from
3706        /// the string representation of enums.
3707        pub fn value(&self) -> std::option::Option<i32> {
3708            match self {
3709                Self::Unspecified => std::option::Option::Some(0),
3710                Self::ServerOnly => std::option::Option::Some(1),
3711                Self::ServerClient => std::option::Option::Some(2),
3712                Self::UnknownValue(u) => u.0.value(),
3713            }
3714        }
3715
3716        /// Gets the enum value as a string.
3717        ///
3718        /// Returns `None` if the enum contains an unknown value deserialized from
3719        /// the integer representation of enums.
3720        pub fn name(&self) -> std::option::Option<&str> {
3721            match self {
3722                Self::Unspecified => std::option::Option::Some("SSL_TYPE_UNSPECIFIED"),
3723                Self::ServerOnly => std::option::Option::Some("SERVER_ONLY"),
3724                Self::ServerClient => std::option::Option::Some("SERVER_CLIENT"),
3725                Self::UnknownValue(u) => u.0.name(),
3726            }
3727        }
3728    }
3729
3730    impl std::default::Default for SslType {
3731        fn default() -> Self {
3732            use std::convert::From;
3733            Self::from(0)
3734        }
3735    }
3736
3737    impl std::fmt::Display for SslType {
3738        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3739            wkt::internal::display_enum(f, self.name(), self.value())
3740        }
3741    }
3742
3743    impl std::convert::From<i32> for SslType {
3744        fn from(value: i32) -> Self {
3745            match value {
3746                0 => Self::Unspecified,
3747                1 => Self::ServerOnly,
3748                2 => Self::ServerClient,
3749                _ => Self::UnknownValue(ssl_type::UnknownValue(
3750                    wkt::internal::UnknownEnumValue::Integer(value),
3751                )),
3752            }
3753        }
3754    }
3755
3756    impl std::convert::From<&str> for SslType {
3757        fn from(value: &str) -> Self {
3758            use std::string::ToString;
3759            match value {
3760                "SSL_TYPE_UNSPECIFIED" => Self::Unspecified,
3761                "SERVER_ONLY" => Self::ServerOnly,
3762                "SERVER_CLIENT" => Self::ServerClient,
3763                _ => Self::UnknownValue(ssl_type::UnknownValue(
3764                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3765                )),
3766            }
3767        }
3768    }
3769
3770    impl serde::ser::Serialize for SslType {
3771        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3772        where
3773            S: serde::Serializer,
3774        {
3775            match self {
3776                Self::Unspecified => serializer.serialize_i32(0),
3777                Self::ServerOnly => serializer.serialize_i32(1),
3778                Self::ServerClient => serializer.serialize_i32(2),
3779                Self::UnknownValue(u) => u.0.serialize(serializer),
3780            }
3781        }
3782    }
3783
3784    impl<'de> serde::de::Deserialize<'de> for SslType {
3785        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3786        where
3787            D: serde::Deserializer<'de>,
3788        {
3789            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslType>::new(
3790                ".google.cloud.clouddms.v1.SslConfig.SslType",
3791            ))
3792        }
3793    }
3794}
3795
3796/// Specifies connection parameters required specifically for MySQL databases.
3797#[derive(Clone, Default, PartialEq)]
3798#[non_exhaustive]
3799pub struct MySqlConnectionProfile {
3800    /// Required. The IP or hostname of the source MySQL database.
3801    pub host: std::string::String,
3802
3803    /// Required. The network port of the source MySQL database.
3804    pub port: i32,
3805
3806    /// Required. The username that Database Migration Service will use to connect
3807    /// to the database. The value is encrypted when stored in Database Migration
3808    /// Service.
3809    pub username: std::string::String,
3810
3811    /// Required. Input only. The password for the user that Database Migration
3812    /// Service will be using to connect to the database. This field is not
3813    /// returned on request, and the value is encrypted when stored in Database
3814    /// Migration Service.
3815    pub password: std::string::String,
3816
3817    /// Output only. Indicates If this connection profile password is stored.
3818    pub password_set: bool,
3819
3820    /// SSL configuration for the destination to connect to the source database.
3821    pub ssl: std::option::Option<crate::model::SslConfig>,
3822
3823    /// If the source is a Cloud SQL database, use this field to
3824    /// provide the Cloud SQL instance ID of the source.
3825    pub cloud_sql_id: std::string::String,
3826
3827    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3828}
3829
3830impl MySqlConnectionProfile {
3831    pub fn new() -> Self {
3832        std::default::Default::default()
3833    }
3834
3835    /// Sets the value of [host][crate::model::MySqlConnectionProfile::host].
3836    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3837        self.host = v.into();
3838        self
3839    }
3840
3841    /// Sets the value of [port][crate::model::MySqlConnectionProfile::port].
3842    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3843        self.port = v.into();
3844        self
3845    }
3846
3847    /// Sets the value of [username][crate::model::MySqlConnectionProfile::username].
3848    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3849        self.username = v.into();
3850        self
3851    }
3852
3853    /// Sets the value of [password][crate::model::MySqlConnectionProfile::password].
3854    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3855        self.password = v.into();
3856        self
3857    }
3858
3859    /// Sets the value of [password_set][crate::model::MySqlConnectionProfile::password_set].
3860    pub fn set_password_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3861        self.password_set = v.into();
3862        self
3863    }
3864
3865    /// Sets the value of [ssl][crate::model::MySqlConnectionProfile::ssl].
3866    pub fn set_ssl<T>(mut self, v: T) -> Self
3867    where
3868        T: std::convert::Into<crate::model::SslConfig>,
3869    {
3870        self.ssl = std::option::Option::Some(v.into());
3871        self
3872    }
3873
3874    /// Sets or clears the value of [ssl][crate::model::MySqlConnectionProfile::ssl].
3875    pub fn set_or_clear_ssl<T>(mut self, v: std::option::Option<T>) -> Self
3876    where
3877        T: std::convert::Into<crate::model::SslConfig>,
3878    {
3879        self.ssl = v.map(|x| x.into());
3880        self
3881    }
3882
3883    /// Sets the value of [cloud_sql_id][crate::model::MySqlConnectionProfile::cloud_sql_id].
3884    pub fn set_cloud_sql_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3885        self.cloud_sql_id = v.into();
3886        self
3887    }
3888}
3889
3890impl wkt::message::Message for MySqlConnectionProfile {
3891    fn typename() -> &'static str {
3892        "type.googleapis.com/google.cloud.clouddms.v1.MySqlConnectionProfile"
3893    }
3894}
3895
3896/// Specifies connection parameters required specifically for PostgreSQL
3897/// databases.
3898#[derive(Clone, Default, PartialEq)]
3899#[non_exhaustive]
3900pub struct PostgreSqlConnectionProfile {
3901    /// Required. The IP or hostname of the source PostgreSQL database.
3902    pub host: std::string::String,
3903
3904    /// Required. The network port of the source PostgreSQL database.
3905    pub port: i32,
3906
3907    /// Required. The username that Database Migration Service will use to connect
3908    /// to the database. The value is encrypted when stored in Database Migration
3909    /// Service.
3910    pub username: std::string::String,
3911
3912    /// Required. Input only. The password for the user that Database Migration
3913    /// Service will be using to connect to the database. This field is not
3914    /// returned on request, and the value is encrypted when stored in Database
3915    /// Migration Service.
3916    pub password: std::string::String,
3917
3918    /// Output only. Indicates If this connection profile password is stored.
3919    pub password_set: bool,
3920
3921    /// SSL configuration for the destination to connect to the source database.
3922    pub ssl: std::option::Option<crate::model::SslConfig>,
3923
3924    /// If the source is a Cloud SQL database, use this field to
3925    /// provide the Cloud SQL instance ID of the source.
3926    pub cloud_sql_id: std::string::String,
3927
3928    /// Output only. If the source is a Cloud SQL database, this field indicates
3929    /// the network architecture it's associated with.
3930    pub network_architecture: crate::model::NetworkArchitecture,
3931
3932    /// Connectivity options used to establish a connection to the database server.
3933    pub connectivity:
3934        std::option::Option<crate::model::postgre_sql_connection_profile::Connectivity>,
3935
3936    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3937}
3938
3939impl PostgreSqlConnectionProfile {
3940    pub fn new() -> Self {
3941        std::default::Default::default()
3942    }
3943
3944    /// Sets the value of [host][crate::model::PostgreSqlConnectionProfile::host].
3945    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3946        self.host = v.into();
3947        self
3948    }
3949
3950    /// Sets the value of [port][crate::model::PostgreSqlConnectionProfile::port].
3951    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3952        self.port = v.into();
3953        self
3954    }
3955
3956    /// Sets the value of [username][crate::model::PostgreSqlConnectionProfile::username].
3957    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3958        self.username = v.into();
3959        self
3960    }
3961
3962    /// Sets the value of [password][crate::model::PostgreSqlConnectionProfile::password].
3963    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3964        self.password = v.into();
3965        self
3966    }
3967
3968    /// Sets the value of [password_set][crate::model::PostgreSqlConnectionProfile::password_set].
3969    pub fn set_password_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3970        self.password_set = v.into();
3971        self
3972    }
3973
3974    /// Sets the value of [ssl][crate::model::PostgreSqlConnectionProfile::ssl].
3975    pub fn set_ssl<T>(mut self, v: T) -> Self
3976    where
3977        T: std::convert::Into<crate::model::SslConfig>,
3978    {
3979        self.ssl = std::option::Option::Some(v.into());
3980        self
3981    }
3982
3983    /// Sets or clears the value of [ssl][crate::model::PostgreSqlConnectionProfile::ssl].
3984    pub fn set_or_clear_ssl<T>(mut self, v: std::option::Option<T>) -> Self
3985    where
3986        T: std::convert::Into<crate::model::SslConfig>,
3987    {
3988        self.ssl = v.map(|x| x.into());
3989        self
3990    }
3991
3992    /// Sets the value of [cloud_sql_id][crate::model::PostgreSqlConnectionProfile::cloud_sql_id].
3993    pub fn set_cloud_sql_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3994        self.cloud_sql_id = v.into();
3995        self
3996    }
3997
3998    /// Sets the value of [network_architecture][crate::model::PostgreSqlConnectionProfile::network_architecture].
3999    pub fn set_network_architecture<T: std::convert::Into<crate::model::NetworkArchitecture>>(
4000        mut self,
4001        v: T,
4002    ) -> Self {
4003        self.network_architecture = v.into();
4004        self
4005    }
4006
4007    /// Sets the value of [connectivity][crate::model::PostgreSqlConnectionProfile::connectivity].
4008    ///
4009    /// Note that all the setters affecting `connectivity` are mutually
4010    /// exclusive.
4011    pub fn set_connectivity<
4012        T: std::convert::Into<
4013                std::option::Option<crate::model::postgre_sql_connection_profile::Connectivity>,
4014            >,
4015    >(
4016        mut self,
4017        v: T,
4018    ) -> Self {
4019        self.connectivity = v.into();
4020        self
4021    }
4022
4023    /// The value of [connectivity][crate::model::PostgreSqlConnectionProfile::connectivity]
4024    /// if it holds a `StaticIpConnectivity`, `None` if the field is not set or
4025    /// holds a different branch.
4026    pub fn static_ip_connectivity(
4027        &self,
4028    ) -> std::option::Option<&std::boxed::Box<crate::model::StaticIpConnectivity>> {
4029        #[allow(unreachable_patterns)]
4030        self.connectivity.as_ref().and_then(|v| match v {
4031            crate::model::postgre_sql_connection_profile::Connectivity::StaticIpConnectivity(v) => {
4032                std::option::Option::Some(v)
4033            }
4034            _ => std::option::Option::None,
4035        })
4036    }
4037
4038    /// Sets the value of [connectivity][crate::model::PostgreSqlConnectionProfile::connectivity]
4039    /// to hold a `StaticIpConnectivity`.
4040    ///
4041    /// Note that all the setters affecting `connectivity` are
4042    /// mutually exclusive.
4043    pub fn set_static_ip_connectivity<
4044        T: std::convert::Into<std::boxed::Box<crate::model::StaticIpConnectivity>>,
4045    >(
4046        mut self,
4047        v: T,
4048    ) -> Self {
4049        self.connectivity = std::option::Option::Some(
4050            crate::model::postgre_sql_connection_profile::Connectivity::StaticIpConnectivity(
4051                v.into(),
4052            ),
4053        );
4054        self
4055    }
4056
4057    /// The value of [connectivity][crate::model::PostgreSqlConnectionProfile::connectivity]
4058    /// if it holds a `PrivateServiceConnectConnectivity`, `None` if the field is not set or
4059    /// holds a different branch.
4060    pub fn private_service_connect_connectivity(
4061        &self,
4062    ) -> std::option::Option<&std::boxed::Box<crate::model::PrivateServiceConnectConnectivity>>
4063    {
4064        #[allow(unreachable_patterns)]
4065        self.connectivity.as_ref().and_then(|v| match v {
4066            crate::model::postgre_sql_connection_profile::Connectivity::PrivateServiceConnectConnectivity(v) => std::option::Option::Some(v),
4067            _ => std::option::Option::None,
4068        })
4069    }
4070
4071    /// Sets the value of [connectivity][crate::model::PostgreSqlConnectionProfile::connectivity]
4072    /// to hold a `PrivateServiceConnectConnectivity`.
4073    ///
4074    /// Note that all the setters affecting `connectivity` are
4075    /// mutually exclusive.
4076    pub fn set_private_service_connect_connectivity<
4077        T: std::convert::Into<std::boxed::Box<crate::model::PrivateServiceConnectConnectivity>>,
4078    >(
4079        mut self,
4080        v: T,
4081    ) -> Self {
4082        self.connectivity = std::option::Option::Some(
4083            crate::model::postgre_sql_connection_profile::Connectivity::PrivateServiceConnectConnectivity(
4084                v.into()
4085            )
4086        );
4087        self
4088    }
4089}
4090
4091impl wkt::message::Message for PostgreSqlConnectionProfile {
4092    fn typename() -> &'static str {
4093        "type.googleapis.com/google.cloud.clouddms.v1.PostgreSqlConnectionProfile"
4094    }
4095}
4096
4097/// Defines additional types related to [PostgreSqlConnectionProfile].
4098pub mod postgre_sql_connection_profile {
4099    #[allow(unused_imports)]
4100    use super::*;
4101
4102    /// Connectivity options used to establish a connection to the database server.
4103    #[derive(Clone, Debug, PartialEq)]
4104    #[non_exhaustive]
4105    pub enum Connectivity {
4106        /// Static ip connectivity data (default, no additional details needed).
4107        StaticIpConnectivity(std::boxed::Box<crate::model::StaticIpConnectivity>),
4108        /// Private service connect connectivity.
4109        PrivateServiceConnectConnectivity(
4110            std::boxed::Box<crate::model::PrivateServiceConnectConnectivity>,
4111        ),
4112    }
4113}
4114
4115/// Specifies connection parameters required specifically for Oracle
4116/// databases.
4117#[derive(Clone, Default, PartialEq)]
4118#[non_exhaustive]
4119pub struct OracleConnectionProfile {
4120    /// Required. The IP or hostname of the source Oracle database.
4121    pub host: std::string::String,
4122
4123    /// Required. The network port of the source Oracle database.
4124    pub port: i32,
4125
4126    /// Required. The username that Database Migration Service will use to connect
4127    /// to the database. The value is encrypted when stored in Database Migration
4128    /// Service.
4129    pub username: std::string::String,
4130
4131    /// Required. Input only. The password for the user that Database Migration
4132    /// Service will be using to connect to the database. This field is not
4133    /// returned on request, and the value is encrypted when stored in Database
4134    /// Migration Service.
4135    pub password: std::string::String,
4136
4137    /// Output only. Indicates whether a new password is included in the request.
4138    pub password_set: bool,
4139
4140    /// Required. Database service for the Oracle connection.
4141    pub database_service: std::string::String,
4142
4143    /// SSL configuration for the connection to the source Oracle database.
4144    ///
4145    /// * Only `SERVER_ONLY` configuration is supported for Oracle SSL.
4146    /// * SSL is supported for Oracle versions 12 and above.
4147    pub ssl: std::option::Option<crate::model::SslConfig>,
4148
4149    /// Connectivity options used to establish a connection to the database server.
4150    pub connectivity: std::option::Option<crate::model::oracle_connection_profile::Connectivity>,
4151
4152    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4153}
4154
4155impl OracleConnectionProfile {
4156    pub fn new() -> Self {
4157        std::default::Default::default()
4158    }
4159
4160    /// Sets the value of [host][crate::model::OracleConnectionProfile::host].
4161    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4162        self.host = v.into();
4163        self
4164    }
4165
4166    /// Sets the value of [port][crate::model::OracleConnectionProfile::port].
4167    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4168        self.port = v.into();
4169        self
4170    }
4171
4172    /// Sets the value of [username][crate::model::OracleConnectionProfile::username].
4173    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4174        self.username = v.into();
4175        self
4176    }
4177
4178    /// Sets the value of [password][crate::model::OracleConnectionProfile::password].
4179    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4180        self.password = v.into();
4181        self
4182    }
4183
4184    /// Sets the value of [password_set][crate::model::OracleConnectionProfile::password_set].
4185    pub fn set_password_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4186        self.password_set = v.into();
4187        self
4188    }
4189
4190    /// Sets the value of [database_service][crate::model::OracleConnectionProfile::database_service].
4191    pub fn set_database_service<T: std::convert::Into<std::string::String>>(
4192        mut self,
4193        v: T,
4194    ) -> Self {
4195        self.database_service = v.into();
4196        self
4197    }
4198
4199    /// Sets the value of [ssl][crate::model::OracleConnectionProfile::ssl].
4200    pub fn set_ssl<T>(mut self, v: T) -> Self
4201    where
4202        T: std::convert::Into<crate::model::SslConfig>,
4203    {
4204        self.ssl = std::option::Option::Some(v.into());
4205        self
4206    }
4207
4208    /// Sets or clears the value of [ssl][crate::model::OracleConnectionProfile::ssl].
4209    pub fn set_or_clear_ssl<T>(mut self, v: std::option::Option<T>) -> Self
4210    where
4211        T: std::convert::Into<crate::model::SslConfig>,
4212    {
4213        self.ssl = v.map(|x| x.into());
4214        self
4215    }
4216
4217    /// Sets the value of [connectivity][crate::model::OracleConnectionProfile::connectivity].
4218    ///
4219    /// Note that all the setters affecting `connectivity` are mutually
4220    /// exclusive.
4221    pub fn set_connectivity<
4222        T: std::convert::Into<
4223                std::option::Option<crate::model::oracle_connection_profile::Connectivity>,
4224            >,
4225    >(
4226        mut self,
4227        v: T,
4228    ) -> Self {
4229        self.connectivity = v.into();
4230        self
4231    }
4232
4233    /// The value of [connectivity][crate::model::OracleConnectionProfile::connectivity]
4234    /// if it holds a `StaticServiceIpConnectivity`, `None` if the field is not set or
4235    /// holds a different branch.
4236    pub fn static_service_ip_connectivity(
4237        &self,
4238    ) -> std::option::Option<&std::boxed::Box<crate::model::StaticServiceIpConnectivity>> {
4239        #[allow(unreachable_patterns)]
4240        self.connectivity.as_ref().and_then(|v| match v {
4241            crate::model::oracle_connection_profile::Connectivity::StaticServiceIpConnectivity(
4242                v,
4243            ) => std::option::Option::Some(v),
4244            _ => std::option::Option::None,
4245        })
4246    }
4247
4248    /// Sets the value of [connectivity][crate::model::OracleConnectionProfile::connectivity]
4249    /// to hold a `StaticServiceIpConnectivity`.
4250    ///
4251    /// Note that all the setters affecting `connectivity` are
4252    /// mutually exclusive.
4253    pub fn set_static_service_ip_connectivity<
4254        T: std::convert::Into<std::boxed::Box<crate::model::StaticServiceIpConnectivity>>,
4255    >(
4256        mut self,
4257        v: T,
4258    ) -> Self {
4259        self.connectivity = std::option::Option::Some(
4260            crate::model::oracle_connection_profile::Connectivity::StaticServiceIpConnectivity(
4261                v.into(),
4262            ),
4263        );
4264        self
4265    }
4266
4267    /// The value of [connectivity][crate::model::OracleConnectionProfile::connectivity]
4268    /// if it holds a `ForwardSshConnectivity`, `None` if the field is not set or
4269    /// holds a different branch.
4270    pub fn forward_ssh_connectivity(
4271        &self,
4272    ) -> std::option::Option<&std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>> {
4273        #[allow(unreachable_patterns)]
4274        self.connectivity.as_ref().and_then(|v| match v {
4275            crate::model::oracle_connection_profile::Connectivity::ForwardSshConnectivity(v) => {
4276                std::option::Option::Some(v)
4277            }
4278            _ => std::option::Option::None,
4279        })
4280    }
4281
4282    /// Sets the value of [connectivity][crate::model::OracleConnectionProfile::connectivity]
4283    /// to hold a `ForwardSshConnectivity`.
4284    ///
4285    /// Note that all the setters affecting `connectivity` are
4286    /// mutually exclusive.
4287    pub fn set_forward_ssh_connectivity<
4288        T: std::convert::Into<std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>>,
4289    >(
4290        mut self,
4291        v: T,
4292    ) -> Self {
4293        self.connectivity = std::option::Option::Some(
4294            crate::model::oracle_connection_profile::Connectivity::ForwardSshConnectivity(v.into()),
4295        );
4296        self
4297    }
4298
4299    /// The value of [connectivity][crate::model::OracleConnectionProfile::connectivity]
4300    /// if it holds a `PrivateConnectivity`, `None` if the field is not set or
4301    /// holds a different branch.
4302    pub fn private_connectivity(
4303        &self,
4304    ) -> std::option::Option<&std::boxed::Box<crate::model::PrivateConnectivity>> {
4305        #[allow(unreachable_patterns)]
4306        self.connectivity.as_ref().and_then(|v| match v {
4307            crate::model::oracle_connection_profile::Connectivity::PrivateConnectivity(v) => {
4308                std::option::Option::Some(v)
4309            }
4310            _ => std::option::Option::None,
4311        })
4312    }
4313
4314    /// Sets the value of [connectivity][crate::model::OracleConnectionProfile::connectivity]
4315    /// to hold a `PrivateConnectivity`.
4316    ///
4317    /// Note that all the setters affecting `connectivity` are
4318    /// mutually exclusive.
4319    pub fn set_private_connectivity<
4320        T: std::convert::Into<std::boxed::Box<crate::model::PrivateConnectivity>>,
4321    >(
4322        mut self,
4323        v: T,
4324    ) -> Self {
4325        self.connectivity = std::option::Option::Some(
4326            crate::model::oracle_connection_profile::Connectivity::PrivateConnectivity(v.into()),
4327        );
4328        self
4329    }
4330}
4331
4332impl wkt::message::Message for OracleConnectionProfile {
4333    fn typename() -> &'static str {
4334        "type.googleapis.com/google.cloud.clouddms.v1.OracleConnectionProfile"
4335    }
4336}
4337
4338/// Defines additional types related to [OracleConnectionProfile].
4339pub mod oracle_connection_profile {
4340    #[allow(unused_imports)]
4341    use super::*;
4342
4343    /// Connectivity options used to establish a connection to the database server.
4344    #[derive(Clone, Debug, PartialEq)]
4345    #[non_exhaustive]
4346    pub enum Connectivity {
4347        /// Static Service IP connectivity.
4348        StaticServiceIpConnectivity(std::boxed::Box<crate::model::StaticServiceIpConnectivity>),
4349        /// Forward SSH tunnel connectivity.
4350        ForwardSshConnectivity(std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>),
4351        /// Private connectivity.
4352        PrivateConnectivity(std::boxed::Box<crate::model::PrivateConnectivity>),
4353    }
4354}
4355
4356/// Specifies required connection parameters, and, optionally, the parameters
4357/// required to create a Cloud SQL destination database instance.
4358#[derive(Clone, Default, PartialEq)]
4359#[non_exhaustive]
4360pub struct CloudSqlConnectionProfile {
4361    /// Output only. The Cloud SQL instance ID that this connection profile is
4362    /// associated with.
4363    pub cloud_sql_id: std::string::String,
4364
4365    /// Immutable. Metadata used to create the destination Cloud SQL database.
4366    pub settings: std::option::Option<crate::model::CloudSqlSettings>,
4367
4368    /// Output only. The Cloud SQL database instance's private IP.
4369    pub private_ip: std::string::String,
4370
4371    /// Output only. The Cloud SQL database instance's public IP.
4372    pub public_ip: std::string::String,
4373
4374    /// Output only. The Cloud SQL database instance's additional (outgoing) public
4375    /// IP. Used when the Cloud SQL database availability type is REGIONAL (i.e.
4376    /// multiple zones / highly available).
4377    pub additional_public_ip: std::string::String,
4378
4379    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4380}
4381
4382impl CloudSqlConnectionProfile {
4383    pub fn new() -> Self {
4384        std::default::Default::default()
4385    }
4386
4387    /// Sets the value of [cloud_sql_id][crate::model::CloudSqlConnectionProfile::cloud_sql_id].
4388    pub fn set_cloud_sql_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4389        self.cloud_sql_id = v.into();
4390        self
4391    }
4392
4393    /// Sets the value of [settings][crate::model::CloudSqlConnectionProfile::settings].
4394    pub fn set_settings<T>(mut self, v: T) -> Self
4395    where
4396        T: std::convert::Into<crate::model::CloudSqlSettings>,
4397    {
4398        self.settings = std::option::Option::Some(v.into());
4399        self
4400    }
4401
4402    /// Sets or clears the value of [settings][crate::model::CloudSqlConnectionProfile::settings].
4403    pub fn set_or_clear_settings<T>(mut self, v: std::option::Option<T>) -> Self
4404    where
4405        T: std::convert::Into<crate::model::CloudSqlSettings>,
4406    {
4407        self.settings = v.map(|x| x.into());
4408        self
4409    }
4410
4411    /// Sets the value of [private_ip][crate::model::CloudSqlConnectionProfile::private_ip].
4412    pub fn set_private_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4413        self.private_ip = v.into();
4414        self
4415    }
4416
4417    /// Sets the value of [public_ip][crate::model::CloudSqlConnectionProfile::public_ip].
4418    pub fn set_public_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4419        self.public_ip = v.into();
4420        self
4421    }
4422
4423    /// Sets the value of [additional_public_ip][crate::model::CloudSqlConnectionProfile::additional_public_ip].
4424    pub fn set_additional_public_ip<T: std::convert::Into<std::string::String>>(
4425        mut self,
4426        v: T,
4427    ) -> Self {
4428        self.additional_public_ip = v.into();
4429        self
4430    }
4431}
4432
4433impl wkt::message::Message for CloudSqlConnectionProfile {
4434    fn typename() -> &'static str {
4435        "type.googleapis.com/google.cloud.clouddms.v1.CloudSqlConnectionProfile"
4436    }
4437}
4438
4439/// Specifies required connection parameters, and the parameters
4440/// required to create an AlloyDB destination cluster.
4441#[derive(Clone, Default, PartialEq)]
4442#[non_exhaustive]
4443pub struct AlloyDbConnectionProfile {
4444    /// Required. The AlloyDB cluster ID that this connection profile is associated
4445    /// with.
4446    pub cluster_id: std::string::String,
4447
4448    /// Immutable. Metadata used to create the destination AlloyDB cluster.
4449    pub settings: std::option::Option<crate::model::AlloyDbSettings>,
4450
4451    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4452}
4453
4454impl AlloyDbConnectionProfile {
4455    pub fn new() -> Self {
4456        std::default::Default::default()
4457    }
4458
4459    /// Sets the value of [cluster_id][crate::model::AlloyDbConnectionProfile::cluster_id].
4460    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4461        self.cluster_id = v.into();
4462        self
4463    }
4464
4465    /// Sets the value of [settings][crate::model::AlloyDbConnectionProfile::settings].
4466    pub fn set_settings<T>(mut self, v: T) -> Self
4467    where
4468        T: std::convert::Into<crate::model::AlloyDbSettings>,
4469    {
4470        self.settings = std::option::Option::Some(v.into());
4471        self
4472    }
4473
4474    /// Sets or clears the value of [settings][crate::model::AlloyDbConnectionProfile::settings].
4475    pub fn set_or_clear_settings<T>(mut self, v: std::option::Option<T>) -> Self
4476    where
4477        T: std::convert::Into<crate::model::AlloyDbSettings>,
4478    {
4479        self.settings = v.map(|x| x.into());
4480        self
4481    }
4482}
4483
4484impl wkt::message::Message for AlloyDbConnectionProfile {
4485    fn typename() -> &'static str {
4486        "type.googleapis.com/google.cloud.clouddms.v1.AlloyDbConnectionProfile"
4487    }
4488}
4489
4490/// An entry for an Access Control list.
4491#[derive(Clone, Default, PartialEq)]
4492#[non_exhaustive]
4493pub struct SqlAclEntry {
4494    /// The allowlisted value for the access control list.
4495    pub value: std::string::String,
4496
4497    /// A label to identify this entry.
4498    pub label: std::string::String,
4499
4500    /// The access control entry entry expiration.
4501    pub expiration: std::option::Option<crate::model::sql_acl_entry::Expiration>,
4502
4503    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4504}
4505
4506impl SqlAclEntry {
4507    pub fn new() -> Self {
4508        std::default::Default::default()
4509    }
4510
4511    /// Sets the value of [value][crate::model::SqlAclEntry::value].
4512    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4513        self.value = v.into();
4514        self
4515    }
4516
4517    /// Sets the value of [label][crate::model::SqlAclEntry::label].
4518    pub fn set_label<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4519        self.label = v.into();
4520        self
4521    }
4522
4523    /// Sets the value of [expiration][crate::model::SqlAclEntry::expiration].
4524    ///
4525    /// Note that all the setters affecting `expiration` are mutually
4526    /// exclusive.
4527    pub fn set_expiration<
4528        T: std::convert::Into<std::option::Option<crate::model::sql_acl_entry::Expiration>>,
4529    >(
4530        mut self,
4531        v: T,
4532    ) -> Self {
4533        self.expiration = v.into();
4534        self
4535    }
4536
4537    /// The value of [expiration][crate::model::SqlAclEntry::expiration]
4538    /// if it holds a `ExpireTime`, `None` if the field is not set or
4539    /// holds a different branch.
4540    pub fn expire_time(&self) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
4541        #[allow(unreachable_patterns)]
4542        self.expiration.as_ref().and_then(|v| match v {
4543            crate::model::sql_acl_entry::Expiration::ExpireTime(v) => std::option::Option::Some(v),
4544            _ => std::option::Option::None,
4545        })
4546    }
4547
4548    /// Sets the value of [expiration][crate::model::SqlAclEntry::expiration]
4549    /// to hold a `ExpireTime`.
4550    ///
4551    /// Note that all the setters affecting `expiration` are
4552    /// mutually exclusive.
4553    pub fn set_expire_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
4554        mut self,
4555        v: T,
4556    ) -> Self {
4557        self.expiration = std::option::Option::Some(
4558            crate::model::sql_acl_entry::Expiration::ExpireTime(v.into()),
4559        );
4560        self
4561    }
4562
4563    /// The value of [expiration][crate::model::SqlAclEntry::expiration]
4564    /// if it holds a `Ttl`, `None` if the field is not set or
4565    /// holds a different branch.
4566    pub fn ttl(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
4567        #[allow(unreachable_patterns)]
4568        self.expiration.as_ref().and_then(|v| match v {
4569            crate::model::sql_acl_entry::Expiration::Ttl(v) => std::option::Option::Some(v),
4570            _ => std::option::Option::None,
4571        })
4572    }
4573
4574    /// Sets the value of [expiration][crate::model::SqlAclEntry::expiration]
4575    /// to hold a `Ttl`.
4576    ///
4577    /// Note that all the setters affecting `expiration` are
4578    /// mutually exclusive.
4579    pub fn set_ttl<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(mut self, v: T) -> Self {
4580        self.expiration =
4581            std::option::Option::Some(crate::model::sql_acl_entry::Expiration::Ttl(v.into()));
4582        self
4583    }
4584}
4585
4586impl wkt::message::Message for SqlAclEntry {
4587    fn typename() -> &'static str {
4588        "type.googleapis.com/google.cloud.clouddms.v1.SqlAclEntry"
4589    }
4590}
4591
4592/// Defines additional types related to [SqlAclEntry].
4593pub mod sql_acl_entry {
4594    #[allow(unused_imports)]
4595    use super::*;
4596
4597    /// The access control entry entry expiration.
4598    #[derive(Clone, Debug, PartialEq)]
4599    #[non_exhaustive]
4600    pub enum Expiration {
4601        /// The time when this access control entry expires in
4602        /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example:
4603        /// `2012-11-15T16:19:00.094Z`.
4604        ExpireTime(std::boxed::Box<wkt::Timestamp>),
4605        /// Input only. The time-to-leave of this access control entry.
4606        Ttl(std::boxed::Box<wkt::Duration>),
4607    }
4608}
4609
4610/// IP Management configuration.
4611#[derive(Clone, Default, PartialEq)]
4612#[non_exhaustive]
4613pub struct SqlIpConfig {
4614    /// Whether the instance should be assigned an IPv4 address or not.
4615    pub enable_ipv4: std::option::Option<wkt::BoolValue>,
4616
4617    /// The resource link for the VPC network from which the Cloud SQL instance is
4618    /// accessible for private IP. For example,
4619    /// `projects/myProject/global/networks/default`. This setting can
4620    /// be updated, but it cannot be removed after it is set.
4621    pub private_network: std::string::String,
4622
4623    /// Optional. The name of the allocated IP address range for the private IP
4624    /// Cloud SQL instance. This name refers to an already allocated IP range
4625    /// address. If set, the instance IP address will be created in the allocated
4626    /// range. Note that this IP address range can't be modified after the instance
4627    /// is created. If you change the VPC when configuring connectivity settings
4628    /// for the migration job, this field is not relevant.
4629    pub allocated_ip_range: std::string::String,
4630
4631    /// Whether SSL connections over IP should be enforced or not.
4632    pub require_ssl: std::option::Option<wkt::BoolValue>,
4633
4634    /// The list of external networks that are allowed to connect to the instance
4635    /// using the IP. See
4636    /// <https://en.wikipedia.org/wiki/CIDR_notation#CIDR_notation>, also known as
4637    /// 'slash' notation (e.g. `192.168.100.0/24`).
4638    pub authorized_networks: std::vec::Vec<crate::model::SqlAclEntry>,
4639
4640    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4641}
4642
4643impl SqlIpConfig {
4644    pub fn new() -> Self {
4645        std::default::Default::default()
4646    }
4647
4648    /// Sets the value of [enable_ipv4][crate::model::SqlIpConfig::enable_ipv4].
4649    pub fn set_enable_ipv4<T>(mut self, v: T) -> Self
4650    where
4651        T: std::convert::Into<wkt::BoolValue>,
4652    {
4653        self.enable_ipv4 = std::option::Option::Some(v.into());
4654        self
4655    }
4656
4657    /// Sets or clears the value of [enable_ipv4][crate::model::SqlIpConfig::enable_ipv4].
4658    pub fn set_or_clear_enable_ipv4<T>(mut self, v: std::option::Option<T>) -> Self
4659    where
4660        T: std::convert::Into<wkt::BoolValue>,
4661    {
4662        self.enable_ipv4 = v.map(|x| x.into());
4663        self
4664    }
4665
4666    /// Sets the value of [private_network][crate::model::SqlIpConfig::private_network].
4667    pub fn set_private_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4668        self.private_network = v.into();
4669        self
4670    }
4671
4672    /// Sets the value of [allocated_ip_range][crate::model::SqlIpConfig::allocated_ip_range].
4673    pub fn set_allocated_ip_range<T: std::convert::Into<std::string::String>>(
4674        mut self,
4675        v: T,
4676    ) -> Self {
4677        self.allocated_ip_range = v.into();
4678        self
4679    }
4680
4681    /// Sets the value of [require_ssl][crate::model::SqlIpConfig::require_ssl].
4682    pub fn set_require_ssl<T>(mut self, v: T) -> Self
4683    where
4684        T: std::convert::Into<wkt::BoolValue>,
4685    {
4686        self.require_ssl = std::option::Option::Some(v.into());
4687        self
4688    }
4689
4690    /// Sets or clears the value of [require_ssl][crate::model::SqlIpConfig::require_ssl].
4691    pub fn set_or_clear_require_ssl<T>(mut self, v: std::option::Option<T>) -> Self
4692    where
4693        T: std::convert::Into<wkt::BoolValue>,
4694    {
4695        self.require_ssl = v.map(|x| x.into());
4696        self
4697    }
4698
4699    /// Sets the value of [authorized_networks][crate::model::SqlIpConfig::authorized_networks].
4700    pub fn set_authorized_networks<T, V>(mut self, v: T) -> Self
4701    where
4702        T: std::iter::IntoIterator<Item = V>,
4703        V: std::convert::Into<crate::model::SqlAclEntry>,
4704    {
4705        use std::iter::Iterator;
4706        self.authorized_networks = v.into_iter().map(|i| i.into()).collect();
4707        self
4708    }
4709}
4710
4711impl wkt::message::Message for SqlIpConfig {
4712    fn typename() -> &'static str {
4713        "type.googleapis.com/google.cloud.clouddms.v1.SqlIpConfig"
4714    }
4715}
4716
4717/// Settings for creating a Cloud SQL database instance.
4718#[derive(Clone, Default, PartialEq)]
4719#[non_exhaustive]
4720pub struct CloudSqlSettings {
4721    /// The database engine type and version.
4722    pub database_version: crate::model::cloud_sql_settings::SqlDatabaseVersion,
4723
4724    /// The resource labels for a Cloud SQL instance to use to annotate any related
4725    /// underlying resources such as Compute Engine VMs.
4726    /// An object containing a list of "key": "value" pairs.
4727    ///
4728    /// Example: `{ "name": "wrench", "mass": "18kg", "count": "3" }`.
4729    pub user_labels: std::collections::HashMap<std::string::String, std::string::String>,
4730
4731    /// The tier (or machine type) for this instance, for example:
4732    /// `db-n1-standard-1` (MySQL instances) or
4733    /// `db-custom-1-3840` (PostgreSQL instances).
4734    /// For more information, see
4735    /// [Cloud SQL Instance
4736    /// Settings](https://cloud.google.com/sql/docs/mysql/instance-settings).
4737    pub tier: std::string::String,
4738
4739    /// The maximum size to which storage capacity can be automatically increased.
4740    /// The default value is 0, which specifies that there is no limit.
4741    pub storage_auto_resize_limit: std::option::Option<wkt::Int64Value>,
4742
4743    /// The activation policy specifies when the instance is activated; it is
4744    /// applicable only when the instance state is 'RUNNABLE'. Valid values:
4745    ///
4746    /// 'ALWAYS': The instance is on, and remains so even in
4747    /// the absence of connection requests.
4748    ///
4749    /// `NEVER`: The instance is off; it is not activated, even if a
4750    /// connection request arrives.
4751    pub activation_policy: crate::model::cloud_sql_settings::SqlActivationPolicy,
4752
4753    /// The settings for IP Management. This allows to enable or disable the
4754    /// instance IP and manage which external networks can connect to the instance.
4755    /// The IPv4 address cannot be disabled.
4756    pub ip_config: std::option::Option<crate::model::SqlIpConfig>,
4757
4758    /// [default: ON] If you enable this setting, Cloud SQL checks your available
4759    /// storage every 30 seconds. If the available storage falls below a threshold
4760    /// size, Cloud SQL automatically adds additional storage capacity. If the
4761    /// available storage repeatedly falls below the threshold size, Cloud SQL
4762    /// continues to add storage until it reaches the maximum of 30 TB.
4763    pub auto_storage_increase: std::option::Option<wkt::BoolValue>,
4764
4765    /// The database flags passed to the Cloud SQL instance at startup.
4766    /// An object containing a list of "key": value pairs.
4767    /// Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
4768    pub database_flags: std::collections::HashMap<std::string::String, std::string::String>,
4769
4770    /// The type of storage: `PD_SSD` (default) or `PD_HDD`.
4771    pub data_disk_type: crate::model::cloud_sql_settings::SqlDataDiskType,
4772
4773    /// The storage capacity available to the database, in GB.
4774    /// The minimum (and default) size is 10GB.
4775    pub data_disk_size_gb: std::option::Option<wkt::Int64Value>,
4776
4777    /// The Google Cloud Platform zone where your Cloud SQL database instance is
4778    /// located.
4779    pub zone: std::string::String,
4780
4781    /// Optional. The Google Cloud Platform zone where the failover Cloud SQL
4782    /// database instance is located. Used when the Cloud SQL database availability
4783    /// type is REGIONAL (i.e. multiple zones / highly available).
4784    pub secondary_zone: std::string::String,
4785
4786    /// The Database Migration Service source connection profile ID,
4787    /// in the format:
4788    /// `projects/my_project_name/locations/us-central1/connectionProfiles/connection_profile_ID`
4789    pub source_id: std::string::String,
4790
4791    /// Input only. Initial root password.
4792    pub root_password: std::string::String,
4793
4794    /// Output only. Indicates If this connection profile root password is stored.
4795    pub root_password_set: bool,
4796
4797    /// The Cloud SQL default instance level collation.
4798    pub collation: std::string::String,
4799
4800    /// The KMS key name used for the csql instance.
4801    pub cmek_key_name: std::string::String,
4802
4803    /// Optional. Availability type. Potential values:
4804    ///
4805    /// * `ZONAL`: The instance serves data from only one zone. Outages in that
4806    ///   zone affect data availability.
4807    /// * `REGIONAL`: The instance can serve data from more than one zone in a
4808    ///   region (it is highly available).
4809    pub availability_type: crate::model::cloud_sql_settings::SqlAvailabilityType,
4810
4811    /// Optional. The edition of the given Cloud SQL instance.
4812    pub edition: crate::model::cloud_sql_settings::Edition,
4813
4814    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4815}
4816
4817impl CloudSqlSettings {
4818    pub fn new() -> Self {
4819        std::default::Default::default()
4820    }
4821
4822    /// Sets the value of [database_version][crate::model::CloudSqlSettings::database_version].
4823    pub fn set_database_version<
4824        T: std::convert::Into<crate::model::cloud_sql_settings::SqlDatabaseVersion>,
4825    >(
4826        mut self,
4827        v: T,
4828    ) -> Self {
4829        self.database_version = v.into();
4830        self
4831    }
4832
4833    /// Sets the value of [user_labels][crate::model::CloudSqlSettings::user_labels].
4834    pub fn set_user_labels<T, K, V>(mut self, v: T) -> Self
4835    where
4836        T: std::iter::IntoIterator<Item = (K, V)>,
4837        K: std::convert::Into<std::string::String>,
4838        V: std::convert::Into<std::string::String>,
4839    {
4840        use std::iter::Iterator;
4841        self.user_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4842        self
4843    }
4844
4845    /// Sets the value of [tier][crate::model::CloudSqlSettings::tier].
4846    pub fn set_tier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4847        self.tier = v.into();
4848        self
4849    }
4850
4851    /// Sets the value of [storage_auto_resize_limit][crate::model::CloudSqlSettings::storage_auto_resize_limit].
4852    pub fn set_storage_auto_resize_limit<T>(mut self, v: T) -> Self
4853    where
4854        T: std::convert::Into<wkt::Int64Value>,
4855    {
4856        self.storage_auto_resize_limit = std::option::Option::Some(v.into());
4857        self
4858    }
4859
4860    /// Sets or clears the value of [storage_auto_resize_limit][crate::model::CloudSqlSettings::storage_auto_resize_limit].
4861    pub fn set_or_clear_storage_auto_resize_limit<T>(mut self, v: std::option::Option<T>) -> Self
4862    where
4863        T: std::convert::Into<wkt::Int64Value>,
4864    {
4865        self.storage_auto_resize_limit = v.map(|x| x.into());
4866        self
4867    }
4868
4869    /// Sets the value of [activation_policy][crate::model::CloudSqlSettings::activation_policy].
4870    pub fn set_activation_policy<
4871        T: std::convert::Into<crate::model::cloud_sql_settings::SqlActivationPolicy>,
4872    >(
4873        mut self,
4874        v: T,
4875    ) -> Self {
4876        self.activation_policy = v.into();
4877        self
4878    }
4879
4880    /// Sets the value of [ip_config][crate::model::CloudSqlSettings::ip_config].
4881    pub fn set_ip_config<T>(mut self, v: T) -> Self
4882    where
4883        T: std::convert::Into<crate::model::SqlIpConfig>,
4884    {
4885        self.ip_config = std::option::Option::Some(v.into());
4886        self
4887    }
4888
4889    /// Sets or clears the value of [ip_config][crate::model::CloudSqlSettings::ip_config].
4890    pub fn set_or_clear_ip_config<T>(mut self, v: std::option::Option<T>) -> Self
4891    where
4892        T: std::convert::Into<crate::model::SqlIpConfig>,
4893    {
4894        self.ip_config = v.map(|x| x.into());
4895        self
4896    }
4897
4898    /// Sets the value of [auto_storage_increase][crate::model::CloudSqlSettings::auto_storage_increase].
4899    pub fn set_auto_storage_increase<T>(mut self, v: T) -> Self
4900    where
4901        T: std::convert::Into<wkt::BoolValue>,
4902    {
4903        self.auto_storage_increase = std::option::Option::Some(v.into());
4904        self
4905    }
4906
4907    /// Sets or clears the value of [auto_storage_increase][crate::model::CloudSqlSettings::auto_storage_increase].
4908    pub fn set_or_clear_auto_storage_increase<T>(mut self, v: std::option::Option<T>) -> Self
4909    where
4910        T: std::convert::Into<wkt::BoolValue>,
4911    {
4912        self.auto_storage_increase = v.map(|x| x.into());
4913        self
4914    }
4915
4916    /// Sets the value of [database_flags][crate::model::CloudSqlSettings::database_flags].
4917    pub fn set_database_flags<T, K, V>(mut self, v: T) -> Self
4918    where
4919        T: std::iter::IntoIterator<Item = (K, V)>,
4920        K: std::convert::Into<std::string::String>,
4921        V: std::convert::Into<std::string::String>,
4922    {
4923        use std::iter::Iterator;
4924        self.database_flags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4925        self
4926    }
4927
4928    /// Sets the value of [data_disk_type][crate::model::CloudSqlSettings::data_disk_type].
4929    pub fn set_data_disk_type<
4930        T: std::convert::Into<crate::model::cloud_sql_settings::SqlDataDiskType>,
4931    >(
4932        mut self,
4933        v: T,
4934    ) -> Self {
4935        self.data_disk_type = v.into();
4936        self
4937    }
4938
4939    /// Sets the value of [data_disk_size_gb][crate::model::CloudSqlSettings::data_disk_size_gb].
4940    pub fn set_data_disk_size_gb<T>(mut self, v: T) -> Self
4941    where
4942        T: std::convert::Into<wkt::Int64Value>,
4943    {
4944        self.data_disk_size_gb = std::option::Option::Some(v.into());
4945        self
4946    }
4947
4948    /// Sets or clears the value of [data_disk_size_gb][crate::model::CloudSqlSettings::data_disk_size_gb].
4949    pub fn set_or_clear_data_disk_size_gb<T>(mut self, v: std::option::Option<T>) -> Self
4950    where
4951        T: std::convert::Into<wkt::Int64Value>,
4952    {
4953        self.data_disk_size_gb = v.map(|x| x.into());
4954        self
4955    }
4956
4957    /// Sets the value of [zone][crate::model::CloudSqlSettings::zone].
4958    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4959        self.zone = v.into();
4960        self
4961    }
4962
4963    /// Sets the value of [secondary_zone][crate::model::CloudSqlSettings::secondary_zone].
4964    pub fn set_secondary_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4965        self.secondary_zone = v.into();
4966        self
4967    }
4968
4969    /// Sets the value of [source_id][crate::model::CloudSqlSettings::source_id].
4970    pub fn set_source_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4971        self.source_id = v.into();
4972        self
4973    }
4974
4975    /// Sets the value of [root_password][crate::model::CloudSqlSettings::root_password].
4976    pub fn set_root_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4977        self.root_password = v.into();
4978        self
4979    }
4980
4981    /// Sets the value of [root_password_set][crate::model::CloudSqlSettings::root_password_set].
4982    pub fn set_root_password_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4983        self.root_password_set = v.into();
4984        self
4985    }
4986
4987    /// Sets the value of [collation][crate::model::CloudSqlSettings::collation].
4988    pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4989        self.collation = v.into();
4990        self
4991    }
4992
4993    /// Sets the value of [cmek_key_name][crate::model::CloudSqlSettings::cmek_key_name].
4994    pub fn set_cmek_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4995        self.cmek_key_name = v.into();
4996        self
4997    }
4998
4999    /// Sets the value of [availability_type][crate::model::CloudSqlSettings::availability_type].
5000    pub fn set_availability_type<
5001        T: std::convert::Into<crate::model::cloud_sql_settings::SqlAvailabilityType>,
5002    >(
5003        mut self,
5004        v: T,
5005    ) -> Self {
5006        self.availability_type = v.into();
5007        self
5008    }
5009
5010    /// Sets the value of [edition][crate::model::CloudSqlSettings::edition].
5011    pub fn set_edition<T: std::convert::Into<crate::model::cloud_sql_settings::Edition>>(
5012        mut self,
5013        v: T,
5014    ) -> Self {
5015        self.edition = v.into();
5016        self
5017    }
5018}
5019
5020impl wkt::message::Message for CloudSqlSettings {
5021    fn typename() -> &'static str {
5022        "type.googleapis.com/google.cloud.clouddms.v1.CloudSqlSettings"
5023    }
5024}
5025
5026/// Defines additional types related to [CloudSqlSettings].
5027pub mod cloud_sql_settings {
5028    #[allow(unused_imports)]
5029    use super::*;
5030
5031    /// Specifies when the instance should be activated.
5032    ///
5033    /// # Working with unknown values
5034    ///
5035    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5036    /// additional enum variants at any time. Adding new variants is not considered
5037    /// a breaking change. Applications should write their code in anticipation of:
5038    ///
5039    /// - New values appearing in future releases of the client library, **and**
5040    /// - New values received dynamically, without application changes.
5041    ///
5042    /// Please consult the [Working with enums] section in the user guide for some
5043    /// guidelines.
5044    ///
5045    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5046    #[derive(Clone, Debug, PartialEq)]
5047    #[non_exhaustive]
5048    pub enum SqlActivationPolicy {
5049        /// unspecified policy.
5050        Unspecified,
5051        /// The instance is always up and running.
5052        Always,
5053        /// The instance should never spin up.
5054        Never,
5055        /// If set, the enum was initialized with an unknown value.
5056        ///
5057        /// Applications can examine the value using [SqlActivationPolicy::value] or
5058        /// [SqlActivationPolicy::name].
5059        UnknownValue(sql_activation_policy::UnknownValue),
5060    }
5061
5062    #[doc(hidden)]
5063    pub mod sql_activation_policy {
5064        #[allow(unused_imports)]
5065        use super::*;
5066        #[derive(Clone, Debug, PartialEq)]
5067        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5068    }
5069
5070    impl SqlActivationPolicy {
5071        /// Gets the enum value.
5072        ///
5073        /// Returns `None` if the enum contains an unknown value deserialized from
5074        /// the string representation of enums.
5075        pub fn value(&self) -> std::option::Option<i32> {
5076            match self {
5077                Self::Unspecified => std::option::Option::Some(0),
5078                Self::Always => std::option::Option::Some(1),
5079                Self::Never => std::option::Option::Some(2),
5080                Self::UnknownValue(u) => u.0.value(),
5081            }
5082        }
5083
5084        /// Gets the enum value as a string.
5085        ///
5086        /// Returns `None` if the enum contains an unknown value deserialized from
5087        /// the integer representation of enums.
5088        pub fn name(&self) -> std::option::Option<&str> {
5089            match self {
5090                Self::Unspecified => std::option::Option::Some("SQL_ACTIVATION_POLICY_UNSPECIFIED"),
5091                Self::Always => std::option::Option::Some("ALWAYS"),
5092                Self::Never => std::option::Option::Some("NEVER"),
5093                Self::UnknownValue(u) => u.0.name(),
5094            }
5095        }
5096    }
5097
5098    impl std::default::Default for SqlActivationPolicy {
5099        fn default() -> Self {
5100            use std::convert::From;
5101            Self::from(0)
5102        }
5103    }
5104
5105    impl std::fmt::Display for SqlActivationPolicy {
5106        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5107            wkt::internal::display_enum(f, self.name(), self.value())
5108        }
5109    }
5110
5111    impl std::convert::From<i32> for SqlActivationPolicy {
5112        fn from(value: i32) -> Self {
5113            match value {
5114                0 => Self::Unspecified,
5115                1 => Self::Always,
5116                2 => Self::Never,
5117                _ => Self::UnknownValue(sql_activation_policy::UnknownValue(
5118                    wkt::internal::UnknownEnumValue::Integer(value),
5119                )),
5120            }
5121        }
5122    }
5123
5124    impl std::convert::From<&str> for SqlActivationPolicy {
5125        fn from(value: &str) -> Self {
5126            use std::string::ToString;
5127            match value {
5128                "SQL_ACTIVATION_POLICY_UNSPECIFIED" => Self::Unspecified,
5129                "ALWAYS" => Self::Always,
5130                "NEVER" => Self::Never,
5131                _ => Self::UnknownValue(sql_activation_policy::UnknownValue(
5132                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5133                )),
5134            }
5135        }
5136    }
5137
5138    impl serde::ser::Serialize for SqlActivationPolicy {
5139        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5140        where
5141            S: serde::Serializer,
5142        {
5143            match self {
5144                Self::Unspecified => serializer.serialize_i32(0),
5145                Self::Always => serializer.serialize_i32(1),
5146                Self::Never => serializer.serialize_i32(2),
5147                Self::UnknownValue(u) => u.0.serialize(serializer),
5148            }
5149        }
5150    }
5151
5152    impl<'de> serde::de::Deserialize<'de> for SqlActivationPolicy {
5153        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5154        where
5155            D: serde::Deserializer<'de>,
5156        {
5157            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlActivationPolicy>::new(
5158                ".google.cloud.clouddms.v1.CloudSqlSettings.SqlActivationPolicy",
5159            ))
5160        }
5161    }
5162
5163    /// The storage options for Cloud SQL databases.
5164    ///
5165    /// # Working with unknown values
5166    ///
5167    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5168    /// additional enum variants at any time. Adding new variants is not considered
5169    /// a breaking change. Applications should write their code in anticipation of:
5170    ///
5171    /// - New values appearing in future releases of the client library, **and**
5172    /// - New values received dynamically, without application changes.
5173    ///
5174    /// Please consult the [Working with enums] section in the user guide for some
5175    /// guidelines.
5176    ///
5177    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5178    #[derive(Clone, Debug, PartialEq)]
5179    #[non_exhaustive]
5180    pub enum SqlDataDiskType {
5181        /// Unspecified.
5182        Unspecified,
5183        /// SSD disk.
5184        PdSsd,
5185        /// HDD disk.
5186        PdHdd,
5187        /// If set, the enum was initialized with an unknown value.
5188        ///
5189        /// Applications can examine the value using [SqlDataDiskType::value] or
5190        /// [SqlDataDiskType::name].
5191        UnknownValue(sql_data_disk_type::UnknownValue),
5192    }
5193
5194    #[doc(hidden)]
5195    pub mod sql_data_disk_type {
5196        #[allow(unused_imports)]
5197        use super::*;
5198        #[derive(Clone, Debug, PartialEq)]
5199        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5200    }
5201
5202    impl SqlDataDiskType {
5203        /// Gets the enum value.
5204        ///
5205        /// Returns `None` if the enum contains an unknown value deserialized from
5206        /// the string representation of enums.
5207        pub fn value(&self) -> std::option::Option<i32> {
5208            match self {
5209                Self::Unspecified => std::option::Option::Some(0),
5210                Self::PdSsd => std::option::Option::Some(1),
5211                Self::PdHdd => std::option::Option::Some(2),
5212                Self::UnknownValue(u) => u.0.value(),
5213            }
5214        }
5215
5216        /// Gets the enum value as a string.
5217        ///
5218        /// Returns `None` if the enum contains an unknown value deserialized from
5219        /// the integer representation of enums.
5220        pub fn name(&self) -> std::option::Option<&str> {
5221            match self {
5222                Self::Unspecified => std::option::Option::Some("SQL_DATA_DISK_TYPE_UNSPECIFIED"),
5223                Self::PdSsd => std::option::Option::Some("PD_SSD"),
5224                Self::PdHdd => std::option::Option::Some("PD_HDD"),
5225                Self::UnknownValue(u) => u.0.name(),
5226            }
5227        }
5228    }
5229
5230    impl std::default::Default for SqlDataDiskType {
5231        fn default() -> Self {
5232            use std::convert::From;
5233            Self::from(0)
5234        }
5235    }
5236
5237    impl std::fmt::Display for SqlDataDiskType {
5238        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5239            wkt::internal::display_enum(f, self.name(), self.value())
5240        }
5241    }
5242
5243    impl std::convert::From<i32> for SqlDataDiskType {
5244        fn from(value: i32) -> Self {
5245            match value {
5246                0 => Self::Unspecified,
5247                1 => Self::PdSsd,
5248                2 => Self::PdHdd,
5249                _ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
5250                    wkt::internal::UnknownEnumValue::Integer(value),
5251                )),
5252            }
5253        }
5254    }
5255
5256    impl std::convert::From<&str> for SqlDataDiskType {
5257        fn from(value: &str) -> Self {
5258            use std::string::ToString;
5259            match value {
5260                "SQL_DATA_DISK_TYPE_UNSPECIFIED" => Self::Unspecified,
5261                "PD_SSD" => Self::PdSsd,
5262                "PD_HDD" => Self::PdHdd,
5263                _ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
5264                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5265                )),
5266            }
5267        }
5268    }
5269
5270    impl serde::ser::Serialize for SqlDataDiskType {
5271        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5272        where
5273            S: serde::Serializer,
5274        {
5275            match self {
5276                Self::Unspecified => serializer.serialize_i32(0),
5277                Self::PdSsd => serializer.serialize_i32(1),
5278                Self::PdHdd => serializer.serialize_i32(2),
5279                Self::UnknownValue(u) => u.0.serialize(serializer),
5280            }
5281        }
5282    }
5283
5284    impl<'de> serde::de::Deserialize<'de> for SqlDataDiskType {
5285        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5286        where
5287            D: serde::Deserializer<'de>,
5288        {
5289            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDataDiskType>::new(
5290                ".google.cloud.clouddms.v1.CloudSqlSettings.SqlDataDiskType",
5291            ))
5292        }
5293    }
5294
5295    /// The database engine type and version.
5296    ///
5297    /// # Working with unknown values
5298    ///
5299    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5300    /// additional enum variants at any time. Adding new variants is not considered
5301    /// a breaking change. Applications should write their code in anticipation of:
5302    ///
5303    /// - New values appearing in future releases of the client library, **and**
5304    /// - New values received dynamically, without application changes.
5305    ///
5306    /// Please consult the [Working with enums] section in the user guide for some
5307    /// guidelines.
5308    ///
5309    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5310    #[derive(Clone, Debug, PartialEq)]
5311    #[non_exhaustive]
5312    pub enum SqlDatabaseVersion {
5313        /// Unspecified version.
5314        Unspecified,
5315        /// MySQL 5.6.
5316        Mysql56,
5317        /// MySQL 5.7.
5318        Mysql57,
5319        /// PostgreSQL 9.6.
5320        Postgres96,
5321        /// PostgreSQL 11.
5322        Postgres11,
5323        /// PostgreSQL 10.
5324        Postgres10,
5325        /// MySQL 8.0.
5326        Mysql80,
5327        /// PostgreSQL 12.
5328        Postgres12,
5329        /// PostgreSQL 13.
5330        Postgres13,
5331        /// PostgreSQL 14.
5332        Postgres14,
5333        /// PostgreSQL 15.
5334        Postgres15,
5335        /// If set, the enum was initialized with an unknown value.
5336        ///
5337        /// Applications can examine the value using [SqlDatabaseVersion::value] or
5338        /// [SqlDatabaseVersion::name].
5339        UnknownValue(sql_database_version::UnknownValue),
5340    }
5341
5342    #[doc(hidden)]
5343    pub mod sql_database_version {
5344        #[allow(unused_imports)]
5345        use super::*;
5346        #[derive(Clone, Debug, PartialEq)]
5347        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5348    }
5349
5350    impl SqlDatabaseVersion {
5351        /// Gets the enum value.
5352        ///
5353        /// Returns `None` if the enum contains an unknown value deserialized from
5354        /// the string representation of enums.
5355        pub fn value(&self) -> std::option::Option<i32> {
5356            match self {
5357                Self::Unspecified => std::option::Option::Some(0),
5358                Self::Mysql56 => std::option::Option::Some(1),
5359                Self::Mysql57 => std::option::Option::Some(2),
5360                Self::Postgres96 => std::option::Option::Some(3),
5361                Self::Postgres11 => std::option::Option::Some(4),
5362                Self::Postgres10 => std::option::Option::Some(5),
5363                Self::Mysql80 => std::option::Option::Some(6),
5364                Self::Postgres12 => std::option::Option::Some(7),
5365                Self::Postgres13 => std::option::Option::Some(8),
5366                Self::Postgres14 => std::option::Option::Some(17),
5367                Self::Postgres15 => std::option::Option::Some(18),
5368                Self::UnknownValue(u) => u.0.value(),
5369            }
5370        }
5371
5372        /// Gets the enum value as a string.
5373        ///
5374        /// Returns `None` if the enum contains an unknown value deserialized from
5375        /// the integer representation of enums.
5376        pub fn name(&self) -> std::option::Option<&str> {
5377            match self {
5378                Self::Unspecified => std::option::Option::Some("SQL_DATABASE_VERSION_UNSPECIFIED"),
5379                Self::Mysql56 => std::option::Option::Some("MYSQL_5_6"),
5380                Self::Mysql57 => std::option::Option::Some("MYSQL_5_7"),
5381                Self::Postgres96 => std::option::Option::Some("POSTGRES_9_6"),
5382                Self::Postgres11 => std::option::Option::Some("POSTGRES_11"),
5383                Self::Postgres10 => std::option::Option::Some("POSTGRES_10"),
5384                Self::Mysql80 => std::option::Option::Some("MYSQL_8_0"),
5385                Self::Postgres12 => std::option::Option::Some("POSTGRES_12"),
5386                Self::Postgres13 => std::option::Option::Some("POSTGRES_13"),
5387                Self::Postgres14 => std::option::Option::Some("POSTGRES_14"),
5388                Self::Postgres15 => std::option::Option::Some("POSTGRES_15"),
5389                Self::UnknownValue(u) => u.0.name(),
5390            }
5391        }
5392    }
5393
5394    impl std::default::Default for SqlDatabaseVersion {
5395        fn default() -> Self {
5396            use std::convert::From;
5397            Self::from(0)
5398        }
5399    }
5400
5401    impl std::fmt::Display for SqlDatabaseVersion {
5402        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5403            wkt::internal::display_enum(f, self.name(), self.value())
5404        }
5405    }
5406
5407    impl std::convert::From<i32> for SqlDatabaseVersion {
5408        fn from(value: i32) -> Self {
5409            match value {
5410                0 => Self::Unspecified,
5411                1 => Self::Mysql56,
5412                2 => Self::Mysql57,
5413                3 => Self::Postgres96,
5414                4 => Self::Postgres11,
5415                5 => Self::Postgres10,
5416                6 => Self::Mysql80,
5417                7 => Self::Postgres12,
5418                8 => Self::Postgres13,
5419                17 => Self::Postgres14,
5420                18 => Self::Postgres15,
5421                _ => Self::UnknownValue(sql_database_version::UnknownValue(
5422                    wkt::internal::UnknownEnumValue::Integer(value),
5423                )),
5424            }
5425        }
5426    }
5427
5428    impl std::convert::From<&str> for SqlDatabaseVersion {
5429        fn from(value: &str) -> Self {
5430            use std::string::ToString;
5431            match value {
5432                "SQL_DATABASE_VERSION_UNSPECIFIED" => Self::Unspecified,
5433                "MYSQL_5_6" => Self::Mysql56,
5434                "MYSQL_5_7" => Self::Mysql57,
5435                "POSTGRES_9_6" => Self::Postgres96,
5436                "POSTGRES_11" => Self::Postgres11,
5437                "POSTGRES_10" => Self::Postgres10,
5438                "MYSQL_8_0" => Self::Mysql80,
5439                "POSTGRES_12" => Self::Postgres12,
5440                "POSTGRES_13" => Self::Postgres13,
5441                "POSTGRES_14" => Self::Postgres14,
5442                "POSTGRES_15" => Self::Postgres15,
5443                _ => Self::UnknownValue(sql_database_version::UnknownValue(
5444                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5445                )),
5446            }
5447        }
5448    }
5449
5450    impl serde::ser::Serialize for SqlDatabaseVersion {
5451        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5452        where
5453            S: serde::Serializer,
5454        {
5455            match self {
5456                Self::Unspecified => serializer.serialize_i32(0),
5457                Self::Mysql56 => serializer.serialize_i32(1),
5458                Self::Mysql57 => serializer.serialize_i32(2),
5459                Self::Postgres96 => serializer.serialize_i32(3),
5460                Self::Postgres11 => serializer.serialize_i32(4),
5461                Self::Postgres10 => serializer.serialize_i32(5),
5462                Self::Mysql80 => serializer.serialize_i32(6),
5463                Self::Postgres12 => serializer.serialize_i32(7),
5464                Self::Postgres13 => serializer.serialize_i32(8),
5465                Self::Postgres14 => serializer.serialize_i32(17),
5466                Self::Postgres15 => serializer.serialize_i32(18),
5467                Self::UnknownValue(u) => u.0.serialize(serializer),
5468            }
5469        }
5470    }
5471
5472    impl<'de> serde::de::Deserialize<'de> for SqlDatabaseVersion {
5473        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5474        where
5475            D: serde::Deserializer<'de>,
5476        {
5477            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDatabaseVersion>::new(
5478                ".google.cloud.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion",
5479            ))
5480        }
5481    }
5482
5483    /// The availability type of the given Cloud SQL instance.
5484    ///
5485    /// # Working with unknown values
5486    ///
5487    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5488    /// additional enum variants at any time. Adding new variants is not considered
5489    /// a breaking change. Applications should write their code in anticipation of:
5490    ///
5491    /// - New values appearing in future releases of the client library, **and**
5492    /// - New values received dynamically, without application changes.
5493    ///
5494    /// Please consult the [Working with enums] section in the user guide for some
5495    /// guidelines.
5496    ///
5497    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5498    #[derive(Clone, Debug, PartialEq)]
5499    #[non_exhaustive]
5500    pub enum SqlAvailabilityType {
5501        /// This is an unknown Availability type.
5502        Unspecified,
5503        /// Zonal availablility instance.
5504        Zonal,
5505        /// Regional availability instance.
5506        Regional,
5507        /// If set, the enum was initialized with an unknown value.
5508        ///
5509        /// Applications can examine the value using [SqlAvailabilityType::value] or
5510        /// [SqlAvailabilityType::name].
5511        UnknownValue(sql_availability_type::UnknownValue),
5512    }
5513
5514    #[doc(hidden)]
5515    pub mod sql_availability_type {
5516        #[allow(unused_imports)]
5517        use super::*;
5518        #[derive(Clone, Debug, PartialEq)]
5519        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5520    }
5521
5522    impl SqlAvailabilityType {
5523        /// Gets the enum value.
5524        ///
5525        /// Returns `None` if the enum contains an unknown value deserialized from
5526        /// the string representation of enums.
5527        pub fn value(&self) -> std::option::Option<i32> {
5528            match self {
5529                Self::Unspecified => std::option::Option::Some(0),
5530                Self::Zonal => std::option::Option::Some(1),
5531                Self::Regional => std::option::Option::Some(2),
5532                Self::UnknownValue(u) => u.0.value(),
5533            }
5534        }
5535
5536        /// Gets the enum value as a string.
5537        ///
5538        /// Returns `None` if the enum contains an unknown value deserialized from
5539        /// the integer representation of enums.
5540        pub fn name(&self) -> std::option::Option<&str> {
5541            match self {
5542                Self::Unspecified => std::option::Option::Some("SQL_AVAILABILITY_TYPE_UNSPECIFIED"),
5543                Self::Zonal => std::option::Option::Some("ZONAL"),
5544                Self::Regional => std::option::Option::Some("REGIONAL"),
5545                Self::UnknownValue(u) => u.0.name(),
5546            }
5547        }
5548    }
5549
5550    impl std::default::Default for SqlAvailabilityType {
5551        fn default() -> Self {
5552            use std::convert::From;
5553            Self::from(0)
5554        }
5555    }
5556
5557    impl std::fmt::Display for SqlAvailabilityType {
5558        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5559            wkt::internal::display_enum(f, self.name(), self.value())
5560        }
5561    }
5562
5563    impl std::convert::From<i32> for SqlAvailabilityType {
5564        fn from(value: i32) -> Self {
5565            match value {
5566                0 => Self::Unspecified,
5567                1 => Self::Zonal,
5568                2 => Self::Regional,
5569                _ => Self::UnknownValue(sql_availability_type::UnknownValue(
5570                    wkt::internal::UnknownEnumValue::Integer(value),
5571                )),
5572            }
5573        }
5574    }
5575
5576    impl std::convert::From<&str> for SqlAvailabilityType {
5577        fn from(value: &str) -> Self {
5578            use std::string::ToString;
5579            match value {
5580                "SQL_AVAILABILITY_TYPE_UNSPECIFIED" => Self::Unspecified,
5581                "ZONAL" => Self::Zonal,
5582                "REGIONAL" => Self::Regional,
5583                _ => Self::UnknownValue(sql_availability_type::UnknownValue(
5584                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5585                )),
5586            }
5587        }
5588    }
5589
5590    impl serde::ser::Serialize for SqlAvailabilityType {
5591        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5592        where
5593            S: serde::Serializer,
5594        {
5595            match self {
5596                Self::Unspecified => serializer.serialize_i32(0),
5597                Self::Zonal => serializer.serialize_i32(1),
5598                Self::Regional => serializer.serialize_i32(2),
5599                Self::UnknownValue(u) => u.0.serialize(serializer),
5600            }
5601        }
5602    }
5603
5604    impl<'de> serde::de::Deserialize<'de> for SqlAvailabilityType {
5605        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5606        where
5607            D: serde::Deserializer<'de>,
5608        {
5609            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlAvailabilityType>::new(
5610                ".google.cloud.clouddms.v1.CloudSqlSettings.SqlAvailabilityType",
5611            ))
5612        }
5613    }
5614
5615    /// The edition of the given Cloud SQL instance.
5616    /// Can be ENTERPRISE or ENTERPRISE_PLUS.
5617    ///
5618    /// # Working with unknown values
5619    ///
5620    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5621    /// additional enum variants at any time. Adding new variants is not considered
5622    /// a breaking change. Applications should write their code in anticipation of:
5623    ///
5624    /// - New values appearing in future releases of the client library, **and**
5625    /// - New values received dynamically, without application changes.
5626    ///
5627    /// Please consult the [Working with enums] section in the user guide for some
5628    /// guidelines.
5629    ///
5630    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5631    #[derive(Clone, Debug, PartialEq)]
5632    #[non_exhaustive]
5633    pub enum Edition {
5634        /// The instance did not specify the edition.
5635        Unspecified,
5636        /// The instance is an enterprise edition.
5637        Enterprise,
5638        /// The instance is an enterprise plus edition.
5639        EnterprisePlus,
5640        /// If set, the enum was initialized with an unknown value.
5641        ///
5642        /// Applications can examine the value using [Edition::value] or
5643        /// [Edition::name].
5644        UnknownValue(edition::UnknownValue),
5645    }
5646
5647    #[doc(hidden)]
5648    pub mod edition {
5649        #[allow(unused_imports)]
5650        use super::*;
5651        #[derive(Clone, Debug, PartialEq)]
5652        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5653    }
5654
5655    impl Edition {
5656        /// Gets the enum value.
5657        ///
5658        /// Returns `None` if the enum contains an unknown value deserialized from
5659        /// the string representation of enums.
5660        pub fn value(&self) -> std::option::Option<i32> {
5661            match self {
5662                Self::Unspecified => std::option::Option::Some(0),
5663                Self::Enterprise => std::option::Option::Some(2),
5664                Self::EnterprisePlus => std::option::Option::Some(3),
5665                Self::UnknownValue(u) => u.0.value(),
5666            }
5667        }
5668
5669        /// Gets the enum value as a string.
5670        ///
5671        /// Returns `None` if the enum contains an unknown value deserialized from
5672        /// the integer representation of enums.
5673        pub fn name(&self) -> std::option::Option<&str> {
5674            match self {
5675                Self::Unspecified => std::option::Option::Some("EDITION_UNSPECIFIED"),
5676                Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
5677                Self::EnterprisePlus => std::option::Option::Some("ENTERPRISE_PLUS"),
5678                Self::UnknownValue(u) => u.0.name(),
5679            }
5680        }
5681    }
5682
5683    impl std::default::Default for Edition {
5684        fn default() -> Self {
5685            use std::convert::From;
5686            Self::from(0)
5687        }
5688    }
5689
5690    impl std::fmt::Display for Edition {
5691        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5692            wkt::internal::display_enum(f, self.name(), self.value())
5693        }
5694    }
5695
5696    impl std::convert::From<i32> for Edition {
5697        fn from(value: i32) -> Self {
5698            match value {
5699                0 => Self::Unspecified,
5700                2 => Self::Enterprise,
5701                3 => Self::EnterprisePlus,
5702                _ => Self::UnknownValue(edition::UnknownValue(
5703                    wkt::internal::UnknownEnumValue::Integer(value),
5704                )),
5705            }
5706        }
5707    }
5708
5709    impl std::convert::From<&str> for Edition {
5710        fn from(value: &str) -> Self {
5711            use std::string::ToString;
5712            match value {
5713                "EDITION_UNSPECIFIED" => Self::Unspecified,
5714                "ENTERPRISE" => Self::Enterprise,
5715                "ENTERPRISE_PLUS" => Self::EnterprisePlus,
5716                _ => Self::UnknownValue(edition::UnknownValue(
5717                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5718                )),
5719            }
5720        }
5721    }
5722
5723    impl serde::ser::Serialize for Edition {
5724        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5725        where
5726            S: serde::Serializer,
5727        {
5728            match self {
5729                Self::Unspecified => serializer.serialize_i32(0),
5730                Self::Enterprise => serializer.serialize_i32(2),
5731                Self::EnterprisePlus => serializer.serialize_i32(3),
5732                Self::UnknownValue(u) => u.0.serialize(serializer),
5733            }
5734        }
5735    }
5736
5737    impl<'de> serde::de::Deserialize<'de> for Edition {
5738        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5739        where
5740            D: serde::Deserializer<'de>,
5741        {
5742            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Edition>::new(
5743                ".google.cloud.clouddms.v1.CloudSqlSettings.Edition",
5744            ))
5745        }
5746    }
5747}
5748
5749/// Settings for creating an AlloyDB cluster.
5750#[derive(Clone, Default, PartialEq)]
5751#[non_exhaustive]
5752pub struct AlloyDbSettings {
5753    /// Required. Input only. Initial user to setup during cluster creation.
5754    /// Required.
5755    pub initial_user: std::option::Option<crate::model::alloy_db_settings::UserPassword>,
5756
5757    /// Required. The resource link for the VPC network in which cluster resources
5758    /// are created and from which they are accessible via Private IP. The network
5759    /// must belong to the same project as the cluster. It is specified in the
5760    /// form: "projects/{project_number}/global/networks/{network_id}". This is
5761    /// required to create a cluster.
5762    pub vpc_network: std::string::String,
5763
5764    /// Labels for the AlloyDB cluster created by DMS. An object containing a list
5765    /// of 'key', 'value' pairs.
5766    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5767
5768    pub primary_instance_settings:
5769        std::option::Option<crate::model::alloy_db_settings::PrimaryInstanceSettings>,
5770
5771    /// Optional. The encryption config can be specified to encrypt the data disks
5772    /// and other persistent data resources of a cluster with a
5773    /// customer-managed encryption key (CMEK). When this field is not
5774    /// specified, the cluster will then use default encryption scheme to
5775    /// protect the user data.
5776    pub encryption_config: std::option::Option<crate::model::alloy_db_settings::EncryptionConfig>,
5777
5778    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5779}
5780
5781impl AlloyDbSettings {
5782    pub fn new() -> Self {
5783        std::default::Default::default()
5784    }
5785
5786    /// Sets the value of [initial_user][crate::model::AlloyDbSettings::initial_user].
5787    pub fn set_initial_user<T>(mut self, v: T) -> Self
5788    where
5789        T: std::convert::Into<crate::model::alloy_db_settings::UserPassword>,
5790    {
5791        self.initial_user = std::option::Option::Some(v.into());
5792        self
5793    }
5794
5795    /// Sets or clears the value of [initial_user][crate::model::AlloyDbSettings::initial_user].
5796    pub fn set_or_clear_initial_user<T>(mut self, v: std::option::Option<T>) -> Self
5797    where
5798        T: std::convert::Into<crate::model::alloy_db_settings::UserPassword>,
5799    {
5800        self.initial_user = v.map(|x| x.into());
5801        self
5802    }
5803
5804    /// Sets the value of [vpc_network][crate::model::AlloyDbSettings::vpc_network].
5805    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5806        self.vpc_network = v.into();
5807        self
5808    }
5809
5810    /// Sets the value of [labels][crate::model::AlloyDbSettings::labels].
5811    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5812    where
5813        T: std::iter::IntoIterator<Item = (K, V)>,
5814        K: std::convert::Into<std::string::String>,
5815        V: std::convert::Into<std::string::String>,
5816    {
5817        use std::iter::Iterator;
5818        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5819        self
5820    }
5821
5822    /// Sets the value of [primary_instance_settings][crate::model::AlloyDbSettings::primary_instance_settings].
5823    pub fn set_primary_instance_settings<T>(mut self, v: T) -> Self
5824    where
5825        T: std::convert::Into<crate::model::alloy_db_settings::PrimaryInstanceSettings>,
5826    {
5827        self.primary_instance_settings = std::option::Option::Some(v.into());
5828        self
5829    }
5830
5831    /// Sets or clears the value of [primary_instance_settings][crate::model::AlloyDbSettings::primary_instance_settings].
5832    pub fn set_or_clear_primary_instance_settings<T>(mut self, v: std::option::Option<T>) -> Self
5833    where
5834        T: std::convert::Into<crate::model::alloy_db_settings::PrimaryInstanceSettings>,
5835    {
5836        self.primary_instance_settings = v.map(|x| x.into());
5837        self
5838    }
5839
5840    /// Sets the value of [encryption_config][crate::model::AlloyDbSettings::encryption_config].
5841    pub fn set_encryption_config<T>(mut self, v: T) -> Self
5842    where
5843        T: std::convert::Into<crate::model::alloy_db_settings::EncryptionConfig>,
5844    {
5845        self.encryption_config = std::option::Option::Some(v.into());
5846        self
5847    }
5848
5849    /// Sets or clears the value of [encryption_config][crate::model::AlloyDbSettings::encryption_config].
5850    pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
5851    where
5852        T: std::convert::Into<crate::model::alloy_db_settings::EncryptionConfig>,
5853    {
5854        self.encryption_config = v.map(|x| x.into());
5855        self
5856    }
5857}
5858
5859impl wkt::message::Message for AlloyDbSettings {
5860    fn typename() -> &'static str {
5861        "type.googleapis.com/google.cloud.clouddms.v1.AlloyDbSettings"
5862    }
5863}
5864
5865/// Defines additional types related to [AlloyDbSettings].
5866pub mod alloy_db_settings {
5867    #[allow(unused_imports)]
5868    use super::*;
5869
5870    /// The username/password for a database user. Used for specifying initial
5871    /// users at cluster creation time.
5872    #[derive(Clone, Default, PartialEq)]
5873    #[non_exhaustive]
5874    pub struct UserPassword {
5875        /// The database username.
5876        pub user: std::string::String,
5877
5878        /// The initial password for the user.
5879        pub password: std::string::String,
5880
5881        /// Output only. Indicates if the initial_user.password field has been set.
5882        pub password_set: bool,
5883
5884        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5885    }
5886
5887    impl UserPassword {
5888        pub fn new() -> Self {
5889            std::default::Default::default()
5890        }
5891
5892        /// Sets the value of [user][crate::model::alloy_db_settings::UserPassword::user].
5893        pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5894            self.user = v.into();
5895            self
5896        }
5897
5898        /// Sets the value of [password][crate::model::alloy_db_settings::UserPassword::password].
5899        pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5900            self.password = v.into();
5901            self
5902        }
5903
5904        /// Sets the value of [password_set][crate::model::alloy_db_settings::UserPassword::password_set].
5905        pub fn set_password_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5906            self.password_set = v.into();
5907            self
5908        }
5909    }
5910
5911    impl wkt::message::Message for UserPassword {
5912        fn typename() -> &'static str {
5913            "type.googleapis.com/google.cloud.clouddms.v1.AlloyDbSettings.UserPassword"
5914        }
5915    }
5916
5917    /// Settings for the cluster's primary instance
5918    #[derive(Clone, Default, PartialEq)]
5919    #[non_exhaustive]
5920    pub struct PrimaryInstanceSettings {
5921        /// Required. The ID of the AlloyDB primary instance. The ID must satisfy the
5922        /// regex expression "[a-z0-9-]+".
5923        pub id: std::string::String,
5924
5925        /// Configuration for the machines that host the underlying
5926        /// database engine.
5927        pub machine_config: std::option::Option<
5928            crate::model::alloy_db_settings::primary_instance_settings::MachineConfig,
5929        >,
5930
5931        /// Database flags to pass to AlloyDB when DMS is creating the AlloyDB
5932        /// cluster and instances. See the AlloyDB documentation for how these can be
5933        /// used.
5934        pub database_flags: std::collections::HashMap<std::string::String, std::string::String>,
5935
5936        /// Labels for the AlloyDB primary instance created by DMS. An object
5937        /// containing a list of 'key', 'value' pairs.
5938        pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5939
5940        /// Output only. The private IP address for the Instance.
5941        /// This is the connection endpoint for an end-user application.
5942        pub private_ip: std::string::String,
5943
5944        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5945    }
5946
5947    impl PrimaryInstanceSettings {
5948        pub fn new() -> Self {
5949            std::default::Default::default()
5950        }
5951
5952        /// Sets the value of [id][crate::model::alloy_db_settings::PrimaryInstanceSettings::id].
5953        pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5954            self.id = v.into();
5955            self
5956        }
5957
5958        /// Sets the value of [machine_config][crate::model::alloy_db_settings::PrimaryInstanceSettings::machine_config].
5959        pub fn set_machine_config<T>(mut self, v: T) -> Self
5960        where
5961            T: std::convert::Into<
5962                    crate::model::alloy_db_settings::primary_instance_settings::MachineConfig,
5963                >,
5964        {
5965            self.machine_config = std::option::Option::Some(v.into());
5966            self
5967        }
5968
5969        /// Sets or clears the value of [machine_config][crate::model::alloy_db_settings::PrimaryInstanceSettings::machine_config].
5970        pub fn set_or_clear_machine_config<T>(mut self, v: std::option::Option<T>) -> Self
5971        where
5972            T: std::convert::Into<
5973                    crate::model::alloy_db_settings::primary_instance_settings::MachineConfig,
5974                >,
5975        {
5976            self.machine_config = v.map(|x| x.into());
5977            self
5978        }
5979
5980        /// Sets the value of [database_flags][crate::model::alloy_db_settings::PrimaryInstanceSettings::database_flags].
5981        pub fn set_database_flags<T, K, V>(mut self, v: T) -> Self
5982        where
5983            T: std::iter::IntoIterator<Item = (K, V)>,
5984            K: std::convert::Into<std::string::String>,
5985            V: std::convert::Into<std::string::String>,
5986        {
5987            use std::iter::Iterator;
5988            self.database_flags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5989            self
5990        }
5991
5992        /// Sets the value of [labels][crate::model::alloy_db_settings::PrimaryInstanceSettings::labels].
5993        pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5994        where
5995            T: std::iter::IntoIterator<Item = (K, V)>,
5996            K: std::convert::Into<std::string::String>,
5997            V: std::convert::Into<std::string::String>,
5998        {
5999            use std::iter::Iterator;
6000            self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6001            self
6002        }
6003
6004        /// Sets the value of [private_ip][crate::model::alloy_db_settings::PrimaryInstanceSettings::private_ip].
6005        pub fn set_private_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6006            self.private_ip = v.into();
6007            self
6008        }
6009    }
6010
6011    impl wkt::message::Message for PrimaryInstanceSettings {
6012        fn typename() -> &'static str {
6013            "type.googleapis.com/google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings"
6014        }
6015    }
6016
6017    /// Defines additional types related to [PrimaryInstanceSettings].
6018    pub mod primary_instance_settings {
6019        #[allow(unused_imports)]
6020        use super::*;
6021
6022        /// MachineConfig describes the configuration of a machine.
6023        #[derive(Clone, Default, PartialEq)]
6024        #[non_exhaustive]
6025        pub struct MachineConfig {
6026            /// The number of CPU's in the VM instance.
6027            pub cpu_count: i32,
6028
6029            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6030        }
6031
6032        impl MachineConfig {
6033            pub fn new() -> Self {
6034                std::default::Default::default()
6035            }
6036
6037            /// Sets the value of [cpu_count][crate::model::alloy_db_settings::primary_instance_settings::MachineConfig::cpu_count].
6038            pub fn set_cpu_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6039                self.cpu_count = v.into();
6040                self
6041            }
6042        }
6043
6044        impl wkt::message::Message for MachineConfig {
6045            fn typename() -> &'static str {
6046                "type.googleapis.com/google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig"
6047            }
6048        }
6049    }
6050
6051    /// EncryptionConfig describes the encryption config of a cluster that is
6052    /// encrypted with a CMEK (customer-managed encryption key).
6053    #[derive(Clone, Default, PartialEq)]
6054    #[non_exhaustive]
6055    pub struct EncryptionConfig {
6056        /// The fully-qualified resource name of the KMS key.
6057        /// Each Cloud KMS key is regionalized and has the following format:
6058        /// projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
6059        pub kms_key_name: std::string::String,
6060
6061        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6062    }
6063
6064    impl EncryptionConfig {
6065        pub fn new() -> Self {
6066            std::default::Default::default()
6067        }
6068
6069        /// Sets the value of [kms_key_name][crate::model::alloy_db_settings::EncryptionConfig::kms_key_name].
6070        pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(
6071            mut self,
6072            v: T,
6073        ) -> Self {
6074            self.kms_key_name = v.into();
6075            self
6076        }
6077    }
6078
6079    impl wkt::message::Message for EncryptionConfig {
6080        fn typename() -> &'static str {
6081            "type.googleapis.com/google.cloud.clouddms.v1.AlloyDbSettings.EncryptionConfig"
6082        }
6083    }
6084}
6085
6086/// The source database will allow incoming connections from the public IP of the
6087/// destination database. You can retrieve the public IP of the Cloud SQL
6088/// instance from the Cloud SQL console or using Cloud SQL APIs. No additional
6089/// configuration is required.
6090#[derive(Clone, Default, PartialEq)]
6091#[non_exhaustive]
6092pub struct StaticIpConnectivity {
6093    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6094}
6095
6096impl StaticIpConnectivity {
6097    pub fn new() -> Self {
6098        std::default::Default::default()
6099    }
6100}
6101
6102impl wkt::message::Message for StaticIpConnectivity {
6103    fn typename() -> &'static str {
6104        "type.googleapis.com/google.cloud.clouddms.v1.StaticIpConnectivity"
6105    }
6106}
6107
6108/// [Private Service Connect
6109/// connectivity](https://cloud.google.com/vpc/docs/private-service-connect#service-attachments)
6110#[derive(Clone, Default, PartialEq)]
6111#[non_exhaustive]
6112pub struct PrivateServiceConnectConnectivity {
6113    /// Required. A service attachment that exposes a database, and has the
6114    /// following format:
6115    /// projects/{project}/regions/{region}/serviceAttachments/{service_attachment_name}
6116    pub service_attachment: std::string::String,
6117
6118    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6119}
6120
6121impl PrivateServiceConnectConnectivity {
6122    pub fn new() -> Self {
6123        std::default::Default::default()
6124    }
6125
6126    /// Sets the value of [service_attachment][crate::model::PrivateServiceConnectConnectivity::service_attachment].
6127    pub fn set_service_attachment<T: std::convert::Into<std::string::String>>(
6128        mut self,
6129        v: T,
6130    ) -> Self {
6131        self.service_attachment = v.into();
6132        self
6133    }
6134}
6135
6136impl wkt::message::Message for PrivateServiceConnectConnectivity {
6137    fn typename() -> &'static str {
6138        "type.googleapis.com/google.cloud.clouddms.v1.PrivateServiceConnectConnectivity"
6139    }
6140}
6141
6142/// The details needed to configure a reverse SSH tunnel between the source and
6143/// destination databases. These details will be used when calling the
6144/// generateSshScript method (see
6145/// <https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.migrationJobs/generateSshScript>)
6146/// to produce the script that will help set up the reverse SSH tunnel, and to
6147/// set up the VPC peering between the Cloud SQL private network and the VPC.
6148#[derive(Clone, Default, PartialEq)]
6149#[non_exhaustive]
6150pub struct ReverseSshConnectivity {
6151    /// Required. The IP of the virtual machine (Compute Engine) used as the
6152    /// bastion server for the SSH tunnel.
6153    pub vm_ip: std::string::String,
6154
6155    /// Required. The forwarding port of the virtual machine (Compute Engine) used
6156    /// as the bastion server for the SSH tunnel.
6157    pub vm_port: i32,
6158
6159    /// The name of the virtual machine (Compute Engine) used as the bastion server
6160    /// for the SSH tunnel.
6161    pub vm: std::string::String,
6162
6163    /// The name of the VPC to peer with the Cloud SQL private network.
6164    pub vpc: std::string::String,
6165
6166    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6167}
6168
6169impl ReverseSshConnectivity {
6170    pub fn new() -> Self {
6171        std::default::Default::default()
6172    }
6173
6174    /// Sets the value of [vm_ip][crate::model::ReverseSshConnectivity::vm_ip].
6175    pub fn set_vm_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6176        self.vm_ip = v.into();
6177        self
6178    }
6179
6180    /// Sets the value of [vm_port][crate::model::ReverseSshConnectivity::vm_port].
6181    pub fn set_vm_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6182        self.vm_port = v.into();
6183        self
6184    }
6185
6186    /// Sets the value of [vm][crate::model::ReverseSshConnectivity::vm].
6187    pub fn set_vm<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6188        self.vm = v.into();
6189        self
6190    }
6191
6192    /// Sets the value of [vpc][crate::model::ReverseSshConnectivity::vpc].
6193    pub fn set_vpc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6194        self.vpc = v.into();
6195        self
6196    }
6197}
6198
6199impl wkt::message::Message for ReverseSshConnectivity {
6200    fn typename() -> &'static str {
6201        "type.googleapis.com/google.cloud.clouddms.v1.ReverseSshConnectivity"
6202    }
6203}
6204
6205/// The details of the VPC where the source database is located in Google Cloud.
6206/// We will use this information to set up the VPC peering connection between
6207/// Cloud SQL and this VPC.
6208#[derive(Clone, Default, PartialEq)]
6209#[non_exhaustive]
6210pub struct VpcPeeringConnectivity {
6211    /// The name of the VPC network to peer with the Cloud SQL private network.
6212    pub vpc: std::string::String,
6213
6214    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6215}
6216
6217impl VpcPeeringConnectivity {
6218    pub fn new() -> Self {
6219        std::default::Default::default()
6220    }
6221
6222    /// Sets the value of [vpc][crate::model::VpcPeeringConnectivity::vpc].
6223    pub fn set_vpc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6224        self.vpc = v.into();
6225        self
6226    }
6227}
6228
6229impl wkt::message::Message for VpcPeeringConnectivity {
6230    fn typename() -> &'static str {
6231        "type.googleapis.com/google.cloud.clouddms.v1.VpcPeeringConnectivity"
6232    }
6233}
6234
6235/// Forward SSH Tunnel connectivity.
6236#[derive(Clone, Default, PartialEq)]
6237#[non_exhaustive]
6238pub struct ForwardSshTunnelConnectivity {
6239    /// Required. Hostname for the SSH tunnel.
6240    pub hostname: std::string::String,
6241
6242    /// Required. Username for the SSH tunnel.
6243    pub username: std::string::String,
6244
6245    /// Port for the SSH tunnel, default value is 22.
6246    pub port: i32,
6247
6248    pub authentication_method:
6249        std::option::Option<crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod>,
6250
6251    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6252}
6253
6254impl ForwardSshTunnelConnectivity {
6255    pub fn new() -> Self {
6256        std::default::Default::default()
6257    }
6258
6259    /// Sets the value of [hostname][crate::model::ForwardSshTunnelConnectivity::hostname].
6260    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6261        self.hostname = v.into();
6262        self
6263    }
6264
6265    /// Sets the value of [username][crate::model::ForwardSshTunnelConnectivity::username].
6266    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6267        self.username = v.into();
6268        self
6269    }
6270
6271    /// Sets the value of [port][crate::model::ForwardSshTunnelConnectivity::port].
6272    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6273        self.port = v.into();
6274        self
6275    }
6276
6277    /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method].
6278    ///
6279    /// Note that all the setters affecting `authentication_method` are mutually
6280    /// exclusive.
6281    pub fn set_authentication_method<
6282        T: std::convert::Into<
6283                std::option::Option<
6284                    crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod,
6285                >,
6286            >,
6287    >(
6288        mut self,
6289        v: T,
6290    ) -> Self {
6291        self.authentication_method = v.into();
6292        self
6293    }
6294
6295    /// The value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
6296    /// if it holds a `Password`, `None` if the field is not set or
6297    /// holds a different branch.
6298    pub fn password(&self) -> std::option::Option<&std::string::String> {
6299        #[allow(unreachable_patterns)]
6300        self.authentication_method.as_ref().and_then(|v| match v {
6301            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::Password(v) => {
6302                std::option::Option::Some(v)
6303            }
6304            _ => std::option::Option::None,
6305        })
6306    }
6307
6308    /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
6309    /// to hold a `Password`.
6310    ///
6311    /// Note that all the setters affecting `authentication_method` are
6312    /// mutually exclusive.
6313    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6314        self.authentication_method = std::option::Option::Some(
6315            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::Password(v.into()),
6316        );
6317        self
6318    }
6319
6320    /// The value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
6321    /// if it holds a `PrivateKey`, `None` if the field is not set or
6322    /// holds a different branch.
6323    pub fn private_key(&self) -> std::option::Option<&std::string::String> {
6324        #[allow(unreachable_patterns)]
6325        self.authentication_method.as_ref().and_then(|v| match v {
6326            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::PrivateKey(v) => {
6327                std::option::Option::Some(v)
6328            }
6329            _ => std::option::Option::None,
6330        })
6331    }
6332
6333    /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
6334    /// to hold a `PrivateKey`.
6335    ///
6336    /// Note that all the setters affecting `authentication_method` are
6337    /// mutually exclusive.
6338    pub fn set_private_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6339        self.authentication_method = std::option::Option::Some(
6340            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::PrivateKey(
6341                v.into(),
6342            ),
6343        );
6344        self
6345    }
6346}
6347
6348impl wkt::message::Message for ForwardSshTunnelConnectivity {
6349    fn typename() -> &'static str {
6350        "type.googleapis.com/google.cloud.clouddms.v1.ForwardSshTunnelConnectivity"
6351    }
6352}
6353
6354/// Defines additional types related to [ForwardSshTunnelConnectivity].
6355pub mod forward_ssh_tunnel_connectivity {
6356    #[allow(unused_imports)]
6357    use super::*;
6358
6359    #[derive(Clone, Debug, PartialEq)]
6360    #[non_exhaustive]
6361    pub enum AuthenticationMethod {
6362        /// Input only. SSH password.
6363        Password(std::string::String),
6364        /// Input only. SSH private key.
6365        PrivateKey(std::string::String),
6366    }
6367}
6368
6369/// Static IP address connectivity configured on service project.
6370#[derive(Clone, Default, PartialEq)]
6371#[non_exhaustive]
6372pub struct StaticServiceIpConnectivity {
6373    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6374}
6375
6376impl StaticServiceIpConnectivity {
6377    pub fn new() -> Self {
6378        std::default::Default::default()
6379    }
6380}
6381
6382impl wkt::message::Message for StaticServiceIpConnectivity {
6383    fn typename() -> &'static str {
6384        "type.googleapis.com/google.cloud.clouddms.v1.StaticServiceIpConnectivity"
6385    }
6386}
6387
6388/// Private Connectivity.
6389#[derive(Clone, Default, PartialEq)]
6390#[non_exhaustive]
6391pub struct PrivateConnectivity {
6392    /// Required. The resource name (URI) of the private connection.
6393    pub private_connection: std::string::String,
6394
6395    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6396}
6397
6398impl PrivateConnectivity {
6399    pub fn new() -> Self {
6400        std::default::Default::default()
6401    }
6402
6403    /// Sets the value of [private_connection][crate::model::PrivateConnectivity::private_connection].
6404    pub fn set_private_connection<T: std::convert::Into<std::string::String>>(
6405        mut self,
6406        v: T,
6407    ) -> Self {
6408        self.private_connection = v.into();
6409        self
6410    }
6411}
6412
6413impl wkt::message::Message for PrivateConnectivity {
6414    fn typename() -> &'static str {
6415        "type.googleapis.com/google.cloud.clouddms.v1.PrivateConnectivity"
6416    }
6417}
6418
6419/// A message defining the database engine and provider.
6420#[derive(Clone, Default, PartialEq)]
6421#[non_exhaustive]
6422pub struct DatabaseType {
6423    /// The database provider.
6424    pub provider: crate::model::DatabaseProvider,
6425
6426    /// The database engine.
6427    pub engine: crate::model::DatabaseEngine,
6428
6429    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6430}
6431
6432impl DatabaseType {
6433    pub fn new() -> Self {
6434        std::default::Default::default()
6435    }
6436
6437    /// Sets the value of [provider][crate::model::DatabaseType::provider].
6438    pub fn set_provider<T: std::convert::Into<crate::model::DatabaseProvider>>(
6439        mut self,
6440        v: T,
6441    ) -> Self {
6442        self.provider = v.into();
6443        self
6444    }
6445
6446    /// Sets the value of [engine][crate::model::DatabaseType::engine].
6447    pub fn set_engine<T: std::convert::Into<crate::model::DatabaseEngine>>(mut self, v: T) -> Self {
6448        self.engine = v.into();
6449        self
6450    }
6451}
6452
6453impl wkt::message::Message for DatabaseType {
6454    fn typename() -> &'static str {
6455        "type.googleapis.com/google.cloud.clouddms.v1.DatabaseType"
6456    }
6457}
6458
6459/// Represents a Database Migration Service migration job object.
6460#[derive(Clone, Default, PartialEq)]
6461#[non_exhaustive]
6462pub struct MigrationJob {
6463    /// The name (URI) of this migration job resource, in the form of:
6464    /// projects/{project}/locations/{location}/migrationJobs/{migrationJob}.
6465    pub name: std::string::String,
6466
6467    /// Output only. The timestamp when the migration job resource was created.
6468    /// A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds.
6469    /// Example: "2014-10-02T15:01:23.045123456Z".
6470    pub create_time: std::option::Option<wkt::Timestamp>,
6471
6472    /// Output only. The timestamp when the migration job resource was last
6473    /// updated. A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds.
6474    /// Example: "2014-10-02T15:01:23.045123456Z".
6475    pub update_time: std::option::Option<wkt::Timestamp>,
6476
6477    /// The resource labels for migration job to use to annotate any related
6478    /// underlying resources such as Compute Engine VMs. An object containing a
6479    /// list of "key": "value" pairs.
6480    ///
6481    /// Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`.
6482    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6483
6484    /// The migration job display name.
6485    pub display_name: std::string::String,
6486
6487    /// The current migration job state.
6488    pub state: crate::model::migration_job::State,
6489
6490    /// Output only. The current migration job phase.
6491    pub phase: crate::model::migration_job::Phase,
6492
6493    /// Required. The migration job type.
6494    pub r#type: crate::model::migration_job::Type,
6495
6496    /// The path to the dump file in Google Cloud Storage,
6497    /// in the format: (gs://[BUCKET_NAME]/[OBJECT_NAME]).
6498    /// This field and the "dump_flags" field are mutually exclusive.
6499    pub dump_path: std::string::String,
6500
6501    /// The initial dump flags.
6502    /// This field and the "dump_path" field are mutually exclusive.
6503    pub dump_flags: std::option::Option<crate::model::migration_job::DumpFlags>,
6504
6505    /// Required. The resource name (URI) of the source connection profile.
6506    pub source: std::string::String,
6507
6508    /// Required. The resource name (URI) of the destination connection profile.
6509    pub destination: std::string::String,
6510
6511    /// Output only. The duration of the migration job (in seconds). A duration in
6512    /// seconds with up to nine fractional digits, terminated by 's'. Example:
6513    /// "3.5s".
6514    pub duration: std::option::Option<wkt::Duration>,
6515
6516    /// Output only. The error details in case of state FAILED.
6517    pub error: std::option::Option<rpc::model::Status>,
6518
6519    /// The database engine type and provider of the source.
6520    pub source_database: std::option::Option<crate::model::DatabaseType>,
6521
6522    /// The database engine type and provider of the destination.
6523    pub destination_database: std::option::Option<crate::model::DatabaseType>,
6524
6525    /// Output only. If the migration job is completed, the time when it was
6526    /// completed.
6527    pub end_time: std::option::Option<wkt::Timestamp>,
6528
6529    /// The conversion workspace used by the migration.
6530    pub conversion_workspace: std::option::Option<crate::model::ConversionWorkspaceInfo>,
6531
6532    /// This field can be used to select the entities to migrate as part of
6533    /// the migration job. It uses AIP-160 notation to select a subset of the
6534    /// entities configured on the associated conversion-workspace. This field
6535    /// should not be set on migration-jobs that are not associated with a
6536    /// conversion workspace.
6537    pub filter: std::string::String,
6538
6539    /// The CMEK (customer-managed encryption key) fully qualified key name used
6540    /// for the migration job.
6541    /// This field supports all migration jobs types except for:
6542    ///
6543    /// * Mysql to Mysql (use the cmek field in the cloudsql connection profile
6544    ///   instead).
6545    /// * PostrgeSQL to PostgreSQL (use the cmek field in the cloudsql
6546    ///   connection profile instead).
6547    /// * PostgreSQL to AlloyDB (use the kms_key_name field in the alloydb
6548    ///   connection profile instead).
6549    ///   Each Cloud CMEK key has the following format:
6550    ///   projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
6551    pub cmek_key_name: std::string::String,
6552
6553    /// Optional. Data dump parallelism settings used by the migration.
6554    /// Currently applicable only for MySQL to Cloud SQL for MySQL migrations only.
6555    pub performance_config: std::option::Option<crate::model::migration_job::PerformanceConfig>,
6556
6557    /// The connectivity method.
6558    pub connectivity: std::option::Option<crate::model::migration_job::Connectivity>,
6559
6560    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6561}
6562
6563impl MigrationJob {
6564    pub fn new() -> Self {
6565        std::default::Default::default()
6566    }
6567
6568    /// Sets the value of [name][crate::model::MigrationJob::name].
6569    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6570        self.name = v.into();
6571        self
6572    }
6573
6574    /// Sets the value of [create_time][crate::model::MigrationJob::create_time].
6575    pub fn set_create_time<T>(mut self, v: T) -> Self
6576    where
6577        T: std::convert::Into<wkt::Timestamp>,
6578    {
6579        self.create_time = std::option::Option::Some(v.into());
6580        self
6581    }
6582
6583    /// Sets or clears the value of [create_time][crate::model::MigrationJob::create_time].
6584    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6585    where
6586        T: std::convert::Into<wkt::Timestamp>,
6587    {
6588        self.create_time = v.map(|x| x.into());
6589        self
6590    }
6591
6592    /// Sets the value of [update_time][crate::model::MigrationJob::update_time].
6593    pub fn set_update_time<T>(mut self, v: T) -> Self
6594    where
6595        T: std::convert::Into<wkt::Timestamp>,
6596    {
6597        self.update_time = std::option::Option::Some(v.into());
6598        self
6599    }
6600
6601    /// Sets or clears the value of [update_time][crate::model::MigrationJob::update_time].
6602    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6603    where
6604        T: std::convert::Into<wkt::Timestamp>,
6605    {
6606        self.update_time = v.map(|x| x.into());
6607        self
6608    }
6609
6610    /// Sets the value of [labels][crate::model::MigrationJob::labels].
6611    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6612    where
6613        T: std::iter::IntoIterator<Item = (K, V)>,
6614        K: std::convert::Into<std::string::String>,
6615        V: std::convert::Into<std::string::String>,
6616    {
6617        use std::iter::Iterator;
6618        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6619        self
6620    }
6621
6622    /// Sets the value of [display_name][crate::model::MigrationJob::display_name].
6623    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6624        self.display_name = v.into();
6625        self
6626    }
6627
6628    /// Sets the value of [state][crate::model::MigrationJob::state].
6629    pub fn set_state<T: std::convert::Into<crate::model::migration_job::State>>(
6630        mut self,
6631        v: T,
6632    ) -> Self {
6633        self.state = v.into();
6634        self
6635    }
6636
6637    /// Sets the value of [phase][crate::model::MigrationJob::phase].
6638    pub fn set_phase<T: std::convert::Into<crate::model::migration_job::Phase>>(
6639        mut self,
6640        v: T,
6641    ) -> Self {
6642        self.phase = v.into();
6643        self
6644    }
6645
6646    /// Sets the value of [r#type][crate::model::MigrationJob::type].
6647    pub fn set_type<T: std::convert::Into<crate::model::migration_job::Type>>(
6648        mut self,
6649        v: T,
6650    ) -> Self {
6651        self.r#type = v.into();
6652        self
6653    }
6654
6655    /// Sets the value of [dump_path][crate::model::MigrationJob::dump_path].
6656    pub fn set_dump_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6657        self.dump_path = v.into();
6658        self
6659    }
6660
6661    /// Sets the value of [dump_flags][crate::model::MigrationJob::dump_flags].
6662    pub fn set_dump_flags<T>(mut self, v: T) -> Self
6663    where
6664        T: std::convert::Into<crate::model::migration_job::DumpFlags>,
6665    {
6666        self.dump_flags = std::option::Option::Some(v.into());
6667        self
6668    }
6669
6670    /// Sets or clears the value of [dump_flags][crate::model::MigrationJob::dump_flags].
6671    pub fn set_or_clear_dump_flags<T>(mut self, v: std::option::Option<T>) -> Self
6672    where
6673        T: std::convert::Into<crate::model::migration_job::DumpFlags>,
6674    {
6675        self.dump_flags = v.map(|x| x.into());
6676        self
6677    }
6678
6679    /// Sets the value of [source][crate::model::MigrationJob::source].
6680    pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6681        self.source = v.into();
6682        self
6683    }
6684
6685    /// Sets the value of [destination][crate::model::MigrationJob::destination].
6686    pub fn set_destination<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6687        self.destination = v.into();
6688        self
6689    }
6690
6691    /// Sets the value of [duration][crate::model::MigrationJob::duration].
6692    pub fn set_duration<T>(mut self, v: T) -> Self
6693    where
6694        T: std::convert::Into<wkt::Duration>,
6695    {
6696        self.duration = std::option::Option::Some(v.into());
6697        self
6698    }
6699
6700    /// Sets or clears the value of [duration][crate::model::MigrationJob::duration].
6701    pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
6702    where
6703        T: std::convert::Into<wkt::Duration>,
6704    {
6705        self.duration = v.map(|x| x.into());
6706        self
6707    }
6708
6709    /// Sets the value of [error][crate::model::MigrationJob::error].
6710    pub fn set_error<T>(mut self, v: T) -> Self
6711    where
6712        T: std::convert::Into<rpc::model::Status>,
6713    {
6714        self.error = std::option::Option::Some(v.into());
6715        self
6716    }
6717
6718    /// Sets or clears the value of [error][crate::model::MigrationJob::error].
6719    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
6720    where
6721        T: std::convert::Into<rpc::model::Status>,
6722    {
6723        self.error = v.map(|x| x.into());
6724        self
6725    }
6726
6727    /// Sets the value of [source_database][crate::model::MigrationJob::source_database].
6728    pub fn set_source_database<T>(mut self, v: T) -> Self
6729    where
6730        T: std::convert::Into<crate::model::DatabaseType>,
6731    {
6732        self.source_database = std::option::Option::Some(v.into());
6733        self
6734    }
6735
6736    /// Sets or clears the value of [source_database][crate::model::MigrationJob::source_database].
6737    pub fn set_or_clear_source_database<T>(mut self, v: std::option::Option<T>) -> Self
6738    where
6739        T: std::convert::Into<crate::model::DatabaseType>,
6740    {
6741        self.source_database = v.map(|x| x.into());
6742        self
6743    }
6744
6745    /// Sets the value of [destination_database][crate::model::MigrationJob::destination_database].
6746    pub fn set_destination_database<T>(mut self, v: T) -> Self
6747    where
6748        T: std::convert::Into<crate::model::DatabaseType>,
6749    {
6750        self.destination_database = std::option::Option::Some(v.into());
6751        self
6752    }
6753
6754    /// Sets or clears the value of [destination_database][crate::model::MigrationJob::destination_database].
6755    pub fn set_or_clear_destination_database<T>(mut self, v: std::option::Option<T>) -> Self
6756    where
6757        T: std::convert::Into<crate::model::DatabaseType>,
6758    {
6759        self.destination_database = v.map(|x| x.into());
6760        self
6761    }
6762
6763    /// Sets the value of [end_time][crate::model::MigrationJob::end_time].
6764    pub fn set_end_time<T>(mut self, v: T) -> Self
6765    where
6766        T: std::convert::Into<wkt::Timestamp>,
6767    {
6768        self.end_time = std::option::Option::Some(v.into());
6769        self
6770    }
6771
6772    /// Sets or clears the value of [end_time][crate::model::MigrationJob::end_time].
6773    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
6774    where
6775        T: std::convert::Into<wkt::Timestamp>,
6776    {
6777        self.end_time = v.map(|x| x.into());
6778        self
6779    }
6780
6781    /// Sets the value of [conversion_workspace][crate::model::MigrationJob::conversion_workspace].
6782    pub fn set_conversion_workspace<T>(mut self, v: T) -> Self
6783    where
6784        T: std::convert::Into<crate::model::ConversionWorkspaceInfo>,
6785    {
6786        self.conversion_workspace = std::option::Option::Some(v.into());
6787        self
6788    }
6789
6790    /// Sets or clears the value of [conversion_workspace][crate::model::MigrationJob::conversion_workspace].
6791    pub fn set_or_clear_conversion_workspace<T>(mut self, v: std::option::Option<T>) -> Self
6792    where
6793        T: std::convert::Into<crate::model::ConversionWorkspaceInfo>,
6794    {
6795        self.conversion_workspace = v.map(|x| x.into());
6796        self
6797    }
6798
6799    /// Sets the value of [filter][crate::model::MigrationJob::filter].
6800    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6801        self.filter = v.into();
6802        self
6803    }
6804
6805    /// Sets the value of [cmek_key_name][crate::model::MigrationJob::cmek_key_name].
6806    pub fn set_cmek_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6807        self.cmek_key_name = v.into();
6808        self
6809    }
6810
6811    /// Sets the value of [performance_config][crate::model::MigrationJob::performance_config].
6812    pub fn set_performance_config<T>(mut self, v: T) -> Self
6813    where
6814        T: std::convert::Into<crate::model::migration_job::PerformanceConfig>,
6815    {
6816        self.performance_config = std::option::Option::Some(v.into());
6817        self
6818    }
6819
6820    /// Sets or clears the value of [performance_config][crate::model::MigrationJob::performance_config].
6821    pub fn set_or_clear_performance_config<T>(mut self, v: std::option::Option<T>) -> Self
6822    where
6823        T: std::convert::Into<crate::model::migration_job::PerformanceConfig>,
6824    {
6825        self.performance_config = v.map(|x| x.into());
6826        self
6827    }
6828
6829    /// Sets the value of [connectivity][crate::model::MigrationJob::connectivity].
6830    ///
6831    /// Note that all the setters affecting `connectivity` are mutually
6832    /// exclusive.
6833    pub fn set_connectivity<
6834        T: std::convert::Into<std::option::Option<crate::model::migration_job::Connectivity>>,
6835    >(
6836        mut self,
6837        v: T,
6838    ) -> Self {
6839        self.connectivity = v.into();
6840        self
6841    }
6842
6843    /// The value of [connectivity][crate::model::MigrationJob::connectivity]
6844    /// if it holds a `ReverseSshConnectivity`, `None` if the field is not set or
6845    /// holds a different branch.
6846    pub fn reverse_ssh_connectivity(
6847        &self,
6848    ) -> std::option::Option<&std::boxed::Box<crate::model::ReverseSshConnectivity>> {
6849        #[allow(unreachable_patterns)]
6850        self.connectivity.as_ref().and_then(|v| match v {
6851            crate::model::migration_job::Connectivity::ReverseSshConnectivity(v) => {
6852                std::option::Option::Some(v)
6853            }
6854            _ => std::option::Option::None,
6855        })
6856    }
6857
6858    /// Sets the value of [connectivity][crate::model::MigrationJob::connectivity]
6859    /// to hold a `ReverseSshConnectivity`.
6860    ///
6861    /// Note that all the setters affecting `connectivity` are
6862    /// mutually exclusive.
6863    pub fn set_reverse_ssh_connectivity<
6864        T: std::convert::Into<std::boxed::Box<crate::model::ReverseSshConnectivity>>,
6865    >(
6866        mut self,
6867        v: T,
6868    ) -> Self {
6869        self.connectivity = std::option::Option::Some(
6870            crate::model::migration_job::Connectivity::ReverseSshConnectivity(v.into()),
6871        );
6872        self
6873    }
6874
6875    /// The value of [connectivity][crate::model::MigrationJob::connectivity]
6876    /// if it holds a `VpcPeeringConnectivity`, `None` if the field is not set or
6877    /// holds a different branch.
6878    pub fn vpc_peering_connectivity(
6879        &self,
6880    ) -> std::option::Option<&std::boxed::Box<crate::model::VpcPeeringConnectivity>> {
6881        #[allow(unreachable_patterns)]
6882        self.connectivity.as_ref().and_then(|v| match v {
6883            crate::model::migration_job::Connectivity::VpcPeeringConnectivity(v) => {
6884                std::option::Option::Some(v)
6885            }
6886            _ => std::option::Option::None,
6887        })
6888    }
6889
6890    /// Sets the value of [connectivity][crate::model::MigrationJob::connectivity]
6891    /// to hold a `VpcPeeringConnectivity`.
6892    ///
6893    /// Note that all the setters affecting `connectivity` are
6894    /// mutually exclusive.
6895    pub fn set_vpc_peering_connectivity<
6896        T: std::convert::Into<std::boxed::Box<crate::model::VpcPeeringConnectivity>>,
6897    >(
6898        mut self,
6899        v: T,
6900    ) -> Self {
6901        self.connectivity = std::option::Option::Some(
6902            crate::model::migration_job::Connectivity::VpcPeeringConnectivity(v.into()),
6903        );
6904        self
6905    }
6906
6907    /// The value of [connectivity][crate::model::MigrationJob::connectivity]
6908    /// if it holds a `StaticIpConnectivity`, `None` if the field is not set or
6909    /// holds a different branch.
6910    pub fn static_ip_connectivity(
6911        &self,
6912    ) -> std::option::Option<&std::boxed::Box<crate::model::StaticIpConnectivity>> {
6913        #[allow(unreachable_patterns)]
6914        self.connectivity.as_ref().and_then(|v| match v {
6915            crate::model::migration_job::Connectivity::StaticIpConnectivity(v) => {
6916                std::option::Option::Some(v)
6917            }
6918            _ => std::option::Option::None,
6919        })
6920    }
6921
6922    /// Sets the value of [connectivity][crate::model::MigrationJob::connectivity]
6923    /// to hold a `StaticIpConnectivity`.
6924    ///
6925    /// Note that all the setters affecting `connectivity` are
6926    /// mutually exclusive.
6927    pub fn set_static_ip_connectivity<
6928        T: std::convert::Into<std::boxed::Box<crate::model::StaticIpConnectivity>>,
6929    >(
6930        mut self,
6931        v: T,
6932    ) -> Self {
6933        self.connectivity = std::option::Option::Some(
6934            crate::model::migration_job::Connectivity::StaticIpConnectivity(v.into()),
6935        );
6936        self
6937    }
6938}
6939
6940impl wkt::message::Message for MigrationJob {
6941    fn typename() -> &'static str {
6942        "type.googleapis.com/google.cloud.clouddms.v1.MigrationJob"
6943    }
6944}
6945
6946/// Defines additional types related to [MigrationJob].
6947pub mod migration_job {
6948    #[allow(unused_imports)]
6949    use super::*;
6950
6951    /// Dump flag definition.
6952    #[derive(Clone, Default, PartialEq)]
6953    #[non_exhaustive]
6954    pub struct DumpFlag {
6955        /// The name of the flag
6956        pub name: std::string::String,
6957
6958        /// The value of the flag.
6959        pub value: std::string::String,
6960
6961        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6962    }
6963
6964    impl DumpFlag {
6965        pub fn new() -> Self {
6966            std::default::Default::default()
6967        }
6968
6969        /// Sets the value of [name][crate::model::migration_job::DumpFlag::name].
6970        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6971            self.name = v.into();
6972            self
6973        }
6974
6975        /// Sets the value of [value][crate::model::migration_job::DumpFlag::value].
6976        pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6977            self.value = v.into();
6978            self
6979        }
6980    }
6981
6982    impl wkt::message::Message for DumpFlag {
6983        fn typename() -> &'static str {
6984            "type.googleapis.com/google.cloud.clouddms.v1.MigrationJob.DumpFlag"
6985        }
6986    }
6987
6988    /// Dump flags definition.
6989    #[derive(Clone, Default, PartialEq)]
6990    #[non_exhaustive]
6991    pub struct DumpFlags {
6992        /// The flags for the initial dump.
6993        pub dump_flags: std::vec::Vec<crate::model::migration_job::DumpFlag>,
6994
6995        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6996    }
6997
6998    impl DumpFlags {
6999        pub fn new() -> Self {
7000            std::default::Default::default()
7001        }
7002
7003        /// Sets the value of [dump_flags][crate::model::migration_job::DumpFlags::dump_flags].
7004        pub fn set_dump_flags<T, V>(mut self, v: T) -> Self
7005        where
7006            T: std::iter::IntoIterator<Item = V>,
7007            V: std::convert::Into<crate::model::migration_job::DumpFlag>,
7008        {
7009            use std::iter::Iterator;
7010            self.dump_flags = v.into_iter().map(|i| i.into()).collect();
7011            self
7012        }
7013    }
7014
7015    impl wkt::message::Message for DumpFlags {
7016        fn typename() -> &'static str {
7017            "type.googleapis.com/google.cloud.clouddms.v1.MigrationJob.DumpFlags"
7018        }
7019    }
7020
7021    /// Performance configuration definition.
7022    #[derive(Clone, Default, PartialEq)]
7023    #[non_exhaustive]
7024    pub struct PerformanceConfig {
7025        /// Initial dump parallelism level.
7026        pub dump_parallel_level: crate::model::migration_job::performance_config::DumpParallelLevel,
7027
7028        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7029    }
7030
7031    impl PerformanceConfig {
7032        pub fn new() -> Self {
7033            std::default::Default::default()
7034        }
7035
7036        /// Sets the value of [dump_parallel_level][crate::model::migration_job::PerformanceConfig::dump_parallel_level].
7037        pub fn set_dump_parallel_level<
7038            T: std::convert::Into<crate::model::migration_job::performance_config::DumpParallelLevel>,
7039        >(
7040            mut self,
7041            v: T,
7042        ) -> Self {
7043            self.dump_parallel_level = v.into();
7044            self
7045        }
7046    }
7047
7048    impl wkt::message::Message for PerformanceConfig {
7049        fn typename() -> &'static str {
7050            "type.googleapis.com/google.cloud.clouddms.v1.MigrationJob.PerformanceConfig"
7051        }
7052    }
7053
7054    /// Defines additional types related to [PerformanceConfig].
7055    pub mod performance_config {
7056        #[allow(unused_imports)]
7057        use super::*;
7058
7059        /// Describes the parallelism level during initial dump.
7060        ///
7061        /// # Working with unknown values
7062        ///
7063        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7064        /// additional enum variants at any time. Adding new variants is not considered
7065        /// a breaking change. Applications should write their code in anticipation of:
7066        ///
7067        /// - New values appearing in future releases of the client library, **and**
7068        /// - New values received dynamically, without application changes.
7069        ///
7070        /// Please consult the [Working with enums] section in the user guide for some
7071        /// guidelines.
7072        ///
7073        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7074        #[derive(Clone, Debug, PartialEq)]
7075        #[non_exhaustive]
7076        pub enum DumpParallelLevel {
7077            /// Unknown dump parallel level. Will be defaulted to OPTIMAL.
7078            Unspecified,
7079            /// Minimal parallel level.
7080            Min,
7081            /// Optimal parallel level.
7082            Optimal,
7083            /// Maximum parallel level.
7084            Max,
7085            /// If set, the enum was initialized with an unknown value.
7086            ///
7087            /// Applications can examine the value using [DumpParallelLevel::value] or
7088            /// [DumpParallelLevel::name].
7089            UnknownValue(dump_parallel_level::UnknownValue),
7090        }
7091
7092        #[doc(hidden)]
7093        pub mod dump_parallel_level {
7094            #[allow(unused_imports)]
7095            use super::*;
7096            #[derive(Clone, Debug, PartialEq)]
7097            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7098        }
7099
7100        impl DumpParallelLevel {
7101            /// Gets the enum value.
7102            ///
7103            /// Returns `None` if the enum contains an unknown value deserialized from
7104            /// the string representation of enums.
7105            pub fn value(&self) -> std::option::Option<i32> {
7106                match self {
7107                    Self::Unspecified => std::option::Option::Some(0),
7108                    Self::Min => std::option::Option::Some(1),
7109                    Self::Optimal => std::option::Option::Some(2),
7110                    Self::Max => std::option::Option::Some(3),
7111                    Self::UnknownValue(u) => u.0.value(),
7112                }
7113            }
7114
7115            /// Gets the enum value as a string.
7116            ///
7117            /// Returns `None` if the enum contains an unknown value deserialized from
7118            /// the integer representation of enums.
7119            pub fn name(&self) -> std::option::Option<&str> {
7120                match self {
7121                    Self::Unspecified => {
7122                        std::option::Option::Some("DUMP_PARALLEL_LEVEL_UNSPECIFIED")
7123                    }
7124                    Self::Min => std::option::Option::Some("MIN"),
7125                    Self::Optimal => std::option::Option::Some("OPTIMAL"),
7126                    Self::Max => std::option::Option::Some("MAX"),
7127                    Self::UnknownValue(u) => u.0.name(),
7128                }
7129            }
7130        }
7131
7132        impl std::default::Default for DumpParallelLevel {
7133            fn default() -> Self {
7134                use std::convert::From;
7135                Self::from(0)
7136            }
7137        }
7138
7139        impl std::fmt::Display for DumpParallelLevel {
7140            fn fmt(
7141                &self,
7142                f: &mut std::fmt::Formatter<'_>,
7143            ) -> std::result::Result<(), std::fmt::Error> {
7144                wkt::internal::display_enum(f, self.name(), self.value())
7145            }
7146        }
7147
7148        impl std::convert::From<i32> for DumpParallelLevel {
7149            fn from(value: i32) -> Self {
7150                match value {
7151                    0 => Self::Unspecified,
7152                    1 => Self::Min,
7153                    2 => Self::Optimal,
7154                    3 => Self::Max,
7155                    _ => Self::UnknownValue(dump_parallel_level::UnknownValue(
7156                        wkt::internal::UnknownEnumValue::Integer(value),
7157                    )),
7158                }
7159            }
7160        }
7161
7162        impl std::convert::From<&str> for DumpParallelLevel {
7163            fn from(value: &str) -> Self {
7164                use std::string::ToString;
7165                match value {
7166                    "DUMP_PARALLEL_LEVEL_UNSPECIFIED" => Self::Unspecified,
7167                    "MIN" => Self::Min,
7168                    "OPTIMAL" => Self::Optimal,
7169                    "MAX" => Self::Max,
7170                    _ => Self::UnknownValue(dump_parallel_level::UnknownValue(
7171                        wkt::internal::UnknownEnumValue::String(value.to_string()),
7172                    )),
7173                }
7174            }
7175        }
7176
7177        impl serde::ser::Serialize for DumpParallelLevel {
7178            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7179            where
7180                S: serde::Serializer,
7181            {
7182                match self {
7183                    Self::Unspecified => serializer.serialize_i32(0),
7184                    Self::Min => serializer.serialize_i32(1),
7185                    Self::Optimal => serializer.serialize_i32(2),
7186                    Self::Max => serializer.serialize_i32(3),
7187                    Self::UnknownValue(u) => u.0.serialize(serializer),
7188                }
7189            }
7190        }
7191
7192        impl<'de> serde::de::Deserialize<'de> for DumpParallelLevel {
7193            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7194            where
7195                D: serde::Deserializer<'de>,
7196            {
7197                deserializer.deserialize_any(wkt::internal::EnumVisitor::<DumpParallelLevel>::new(
7198                    ".google.cloud.clouddms.v1.MigrationJob.PerformanceConfig.DumpParallelLevel",
7199                ))
7200            }
7201        }
7202    }
7203
7204    /// The current migration job states.
7205    ///
7206    /// # Working with unknown values
7207    ///
7208    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7209    /// additional enum variants at any time. Adding new variants is not considered
7210    /// a breaking change. Applications should write their code in anticipation of:
7211    ///
7212    /// - New values appearing in future releases of the client library, **and**
7213    /// - New values received dynamically, without application changes.
7214    ///
7215    /// Please consult the [Working with enums] section in the user guide for some
7216    /// guidelines.
7217    ///
7218    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7219    #[derive(Clone, Debug, PartialEq)]
7220    #[non_exhaustive]
7221    pub enum State {
7222        /// The state of the migration job is unknown.
7223        Unspecified,
7224        /// The migration job is down for maintenance.
7225        Maintenance,
7226        /// The migration job is in draft mode and no resources are created.
7227        Draft,
7228        /// The migration job is being created.
7229        Creating,
7230        /// The migration job is created and not started.
7231        NotStarted,
7232        /// The migration job is running.
7233        Running,
7234        /// The migration job failed.
7235        Failed,
7236        /// The migration job has been completed.
7237        Completed,
7238        /// The migration job is being deleted.
7239        Deleting,
7240        /// The migration job is being stopped.
7241        Stopping,
7242        /// The migration job is currently stopped.
7243        Stopped,
7244        /// The migration job has been deleted.
7245        Deleted,
7246        /// The migration job is being updated.
7247        Updating,
7248        /// The migration job is starting.
7249        Starting,
7250        /// The migration job is restarting.
7251        Restarting,
7252        /// The migration job is resuming.
7253        Resuming,
7254        /// If set, the enum was initialized with an unknown value.
7255        ///
7256        /// Applications can examine the value using [State::value] or
7257        /// [State::name].
7258        UnknownValue(state::UnknownValue),
7259    }
7260
7261    #[doc(hidden)]
7262    pub mod state {
7263        #[allow(unused_imports)]
7264        use super::*;
7265        #[derive(Clone, Debug, PartialEq)]
7266        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7267    }
7268
7269    impl State {
7270        /// Gets the enum value.
7271        ///
7272        /// Returns `None` if the enum contains an unknown value deserialized from
7273        /// the string representation of enums.
7274        pub fn value(&self) -> std::option::Option<i32> {
7275            match self {
7276                Self::Unspecified => std::option::Option::Some(0),
7277                Self::Maintenance => std::option::Option::Some(1),
7278                Self::Draft => std::option::Option::Some(2),
7279                Self::Creating => std::option::Option::Some(3),
7280                Self::NotStarted => std::option::Option::Some(4),
7281                Self::Running => std::option::Option::Some(5),
7282                Self::Failed => std::option::Option::Some(6),
7283                Self::Completed => std::option::Option::Some(7),
7284                Self::Deleting => std::option::Option::Some(8),
7285                Self::Stopping => std::option::Option::Some(9),
7286                Self::Stopped => std::option::Option::Some(10),
7287                Self::Deleted => std::option::Option::Some(11),
7288                Self::Updating => std::option::Option::Some(12),
7289                Self::Starting => std::option::Option::Some(13),
7290                Self::Restarting => std::option::Option::Some(14),
7291                Self::Resuming => std::option::Option::Some(15),
7292                Self::UnknownValue(u) => u.0.value(),
7293            }
7294        }
7295
7296        /// Gets the enum value as a string.
7297        ///
7298        /// Returns `None` if the enum contains an unknown value deserialized from
7299        /// the integer representation of enums.
7300        pub fn name(&self) -> std::option::Option<&str> {
7301            match self {
7302                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7303                Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
7304                Self::Draft => std::option::Option::Some("DRAFT"),
7305                Self::Creating => std::option::Option::Some("CREATING"),
7306                Self::NotStarted => std::option::Option::Some("NOT_STARTED"),
7307                Self::Running => std::option::Option::Some("RUNNING"),
7308                Self::Failed => std::option::Option::Some("FAILED"),
7309                Self::Completed => std::option::Option::Some("COMPLETED"),
7310                Self::Deleting => std::option::Option::Some("DELETING"),
7311                Self::Stopping => std::option::Option::Some("STOPPING"),
7312                Self::Stopped => std::option::Option::Some("STOPPED"),
7313                Self::Deleted => std::option::Option::Some("DELETED"),
7314                Self::Updating => std::option::Option::Some("UPDATING"),
7315                Self::Starting => std::option::Option::Some("STARTING"),
7316                Self::Restarting => std::option::Option::Some("RESTARTING"),
7317                Self::Resuming => std::option::Option::Some("RESUMING"),
7318                Self::UnknownValue(u) => u.0.name(),
7319            }
7320        }
7321    }
7322
7323    impl std::default::Default for State {
7324        fn default() -> Self {
7325            use std::convert::From;
7326            Self::from(0)
7327        }
7328    }
7329
7330    impl std::fmt::Display for State {
7331        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7332            wkt::internal::display_enum(f, self.name(), self.value())
7333        }
7334    }
7335
7336    impl std::convert::From<i32> for State {
7337        fn from(value: i32) -> Self {
7338            match value {
7339                0 => Self::Unspecified,
7340                1 => Self::Maintenance,
7341                2 => Self::Draft,
7342                3 => Self::Creating,
7343                4 => Self::NotStarted,
7344                5 => Self::Running,
7345                6 => Self::Failed,
7346                7 => Self::Completed,
7347                8 => Self::Deleting,
7348                9 => Self::Stopping,
7349                10 => Self::Stopped,
7350                11 => Self::Deleted,
7351                12 => Self::Updating,
7352                13 => Self::Starting,
7353                14 => Self::Restarting,
7354                15 => Self::Resuming,
7355                _ => Self::UnknownValue(state::UnknownValue(
7356                    wkt::internal::UnknownEnumValue::Integer(value),
7357                )),
7358            }
7359        }
7360    }
7361
7362    impl std::convert::From<&str> for State {
7363        fn from(value: &str) -> Self {
7364            use std::string::ToString;
7365            match value {
7366                "STATE_UNSPECIFIED" => Self::Unspecified,
7367                "MAINTENANCE" => Self::Maintenance,
7368                "DRAFT" => Self::Draft,
7369                "CREATING" => Self::Creating,
7370                "NOT_STARTED" => Self::NotStarted,
7371                "RUNNING" => Self::Running,
7372                "FAILED" => Self::Failed,
7373                "COMPLETED" => Self::Completed,
7374                "DELETING" => Self::Deleting,
7375                "STOPPING" => Self::Stopping,
7376                "STOPPED" => Self::Stopped,
7377                "DELETED" => Self::Deleted,
7378                "UPDATING" => Self::Updating,
7379                "STARTING" => Self::Starting,
7380                "RESTARTING" => Self::Restarting,
7381                "RESUMING" => Self::Resuming,
7382                _ => Self::UnknownValue(state::UnknownValue(
7383                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7384                )),
7385            }
7386        }
7387    }
7388
7389    impl serde::ser::Serialize for State {
7390        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7391        where
7392            S: serde::Serializer,
7393        {
7394            match self {
7395                Self::Unspecified => serializer.serialize_i32(0),
7396                Self::Maintenance => serializer.serialize_i32(1),
7397                Self::Draft => serializer.serialize_i32(2),
7398                Self::Creating => serializer.serialize_i32(3),
7399                Self::NotStarted => serializer.serialize_i32(4),
7400                Self::Running => serializer.serialize_i32(5),
7401                Self::Failed => serializer.serialize_i32(6),
7402                Self::Completed => serializer.serialize_i32(7),
7403                Self::Deleting => serializer.serialize_i32(8),
7404                Self::Stopping => serializer.serialize_i32(9),
7405                Self::Stopped => serializer.serialize_i32(10),
7406                Self::Deleted => serializer.serialize_i32(11),
7407                Self::Updating => serializer.serialize_i32(12),
7408                Self::Starting => serializer.serialize_i32(13),
7409                Self::Restarting => serializer.serialize_i32(14),
7410                Self::Resuming => serializer.serialize_i32(15),
7411                Self::UnknownValue(u) => u.0.serialize(serializer),
7412            }
7413        }
7414    }
7415
7416    impl<'de> serde::de::Deserialize<'de> for State {
7417        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7418        where
7419            D: serde::Deserializer<'de>,
7420        {
7421            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
7422                ".google.cloud.clouddms.v1.MigrationJob.State",
7423            ))
7424        }
7425    }
7426
7427    /// The current migration job phase.
7428    ///
7429    /// # Working with unknown values
7430    ///
7431    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7432    /// additional enum variants at any time. Adding new variants is not considered
7433    /// a breaking change. Applications should write their code in anticipation of:
7434    ///
7435    /// - New values appearing in future releases of the client library, **and**
7436    /// - New values received dynamically, without application changes.
7437    ///
7438    /// Please consult the [Working with enums] section in the user guide for some
7439    /// guidelines.
7440    ///
7441    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7442    #[derive(Clone, Debug, PartialEq)]
7443    #[non_exhaustive]
7444    pub enum Phase {
7445        /// The phase of the migration job is unknown.
7446        Unspecified,
7447        /// The migration job is in the full dump phase.
7448        FullDump,
7449        /// The migration job is CDC phase.
7450        Cdc,
7451        /// The migration job is running the promote phase.
7452        PromoteInProgress,
7453        /// Only RDS flow - waiting for source writes to stop
7454        WaitingForSourceWritesToStop,
7455        /// Only RDS flow - the sources writes stopped, waiting for dump to begin
7456        PreparingTheDump,
7457        /// If set, the enum was initialized with an unknown value.
7458        ///
7459        /// Applications can examine the value using [Phase::value] or
7460        /// [Phase::name].
7461        UnknownValue(phase::UnknownValue),
7462    }
7463
7464    #[doc(hidden)]
7465    pub mod phase {
7466        #[allow(unused_imports)]
7467        use super::*;
7468        #[derive(Clone, Debug, PartialEq)]
7469        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7470    }
7471
7472    impl Phase {
7473        /// Gets the enum value.
7474        ///
7475        /// Returns `None` if the enum contains an unknown value deserialized from
7476        /// the string representation of enums.
7477        pub fn value(&self) -> std::option::Option<i32> {
7478            match self {
7479                Self::Unspecified => std::option::Option::Some(0),
7480                Self::FullDump => std::option::Option::Some(1),
7481                Self::Cdc => std::option::Option::Some(2),
7482                Self::PromoteInProgress => std::option::Option::Some(3),
7483                Self::WaitingForSourceWritesToStop => std::option::Option::Some(4),
7484                Self::PreparingTheDump => std::option::Option::Some(5),
7485                Self::UnknownValue(u) => u.0.value(),
7486            }
7487        }
7488
7489        /// Gets the enum value as a string.
7490        ///
7491        /// Returns `None` if the enum contains an unknown value deserialized from
7492        /// the integer representation of enums.
7493        pub fn name(&self) -> std::option::Option<&str> {
7494            match self {
7495                Self::Unspecified => std::option::Option::Some("PHASE_UNSPECIFIED"),
7496                Self::FullDump => std::option::Option::Some("FULL_DUMP"),
7497                Self::Cdc => std::option::Option::Some("CDC"),
7498                Self::PromoteInProgress => std::option::Option::Some("PROMOTE_IN_PROGRESS"),
7499                Self::WaitingForSourceWritesToStop => {
7500                    std::option::Option::Some("WAITING_FOR_SOURCE_WRITES_TO_STOP")
7501                }
7502                Self::PreparingTheDump => std::option::Option::Some("PREPARING_THE_DUMP"),
7503                Self::UnknownValue(u) => u.0.name(),
7504            }
7505        }
7506    }
7507
7508    impl std::default::Default for Phase {
7509        fn default() -> Self {
7510            use std::convert::From;
7511            Self::from(0)
7512        }
7513    }
7514
7515    impl std::fmt::Display for Phase {
7516        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7517            wkt::internal::display_enum(f, self.name(), self.value())
7518        }
7519    }
7520
7521    impl std::convert::From<i32> for Phase {
7522        fn from(value: i32) -> Self {
7523            match value {
7524                0 => Self::Unspecified,
7525                1 => Self::FullDump,
7526                2 => Self::Cdc,
7527                3 => Self::PromoteInProgress,
7528                4 => Self::WaitingForSourceWritesToStop,
7529                5 => Self::PreparingTheDump,
7530                _ => Self::UnknownValue(phase::UnknownValue(
7531                    wkt::internal::UnknownEnumValue::Integer(value),
7532                )),
7533            }
7534        }
7535    }
7536
7537    impl std::convert::From<&str> for Phase {
7538        fn from(value: &str) -> Self {
7539            use std::string::ToString;
7540            match value {
7541                "PHASE_UNSPECIFIED" => Self::Unspecified,
7542                "FULL_DUMP" => Self::FullDump,
7543                "CDC" => Self::Cdc,
7544                "PROMOTE_IN_PROGRESS" => Self::PromoteInProgress,
7545                "WAITING_FOR_SOURCE_WRITES_TO_STOP" => Self::WaitingForSourceWritesToStop,
7546                "PREPARING_THE_DUMP" => Self::PreparingTheDump,
7547                _ => Self::UnknownValue(phase::UnknownValue(
7548                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7549                )),
7550            }
7551        }
7552    }
7553
7554    impl serde::ser::Serialize for Phase {
7555        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7556        where
7557            S: serde::Serializer,
7558        {
7559            match self {
7560                Self::Unspecified => serializer.serialize_i32(0),
7561                Self::FullDump => serializer.serialize_i32(1),
7562                Self::Cdc => serializer.serialize_i32(2),
7563                Self::PromoteInProgress => serializer.serialize_i32(3),
7564                Self::WaitingForSourceWritesToStop => serializer.serialize_i32(4),
7565                Self::PreparingTheDump => serializer.serialize_i32(5),
7566                Self::UnknownValue(u) => u.0.serialize(serializer),
7567            }
7568        }
7569    }
7570
7571    impl<'de> serde::de::Deserialize<'de> for Phase {
7572        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7573        where
7574            D: serde::Deserializer<'de>,
7575        {
7576            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Phase>::new(
7577                ".google.cloud.clouddms.v1.MigrationJob.Phase",
7578            ))
7579        }
7580    }
7581
7582    /// The type of migration job (one-time or continuous).
7583    ///
7584    /// # Working with unknown values
7585    ///
7586    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7587    /// additional enum variants at any time. Adding new variants is not considered
7588    /// a breaking change. Applications should write their code in anticipation of:
7589    ///
7590    /// - New values appearing in future releases of the client library, **and**
7591    /// - New values received dynamically, without application changes.
7592    ///
7593    /// Please consult the [Working with enums] section in the user guide for some
7594    /// guidelines.
7595    ///
7596    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7597    #[derive(Clone, Debug, PartialEq)]
7598    #[non_exhaustive]
7599    pub enum Type {
7600        /// The type of the migration job is unknown.
7601        Unspecified,
7602        /// The migration job is a one time migration.
7603        OneTime,
7604        /// The migration job is a continuous migration.
7605        Continuous,
7606        /// If set, the enum was initialized with an unknown value.
7607        ///
7608        /// Applications can examine the value using [Type::value] or
7609        /// [Type::name].
7610        UnknownValue(r#type::UnknownValue),
7611    }
7612
7613    #[doc(hidden)]
7614    pub mod r#type {
7615        #[allow(unused_imports)]
7616        use super::*;
7617        #[derive(Clone, Debug, PartialEq)]
7618        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7619    }
7620
7621    impl Type {
7622        /// Gets the enum value.
7623        ///
7624        /// Returns `None` if the enum contains an unknown value deserialized from
7625        /// the string representation of enums.
7626        pub fn value(&self) -> std::option::Option<i32> {
7627            match self {
7628                Self::Unspecified => std::option::Option::Some(0),
7629                Self::OneTime => std::option::Option::Some(1),
7630                Self::Continuous => std::option::Option::Some(2),
7631                Self::UnknownValue(u) => u.0.value(),
7632            }
7633        }
7634
7635        /// Gets the enum value as a string.
7636        ///
7637        /// Returns `None` if the enum contains an unknown value deserialized from
7638        /// the integer representation of enums.
7639        pub fn name(&self) -> std::option::Option<&str> {
7640            match self {
7641                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
7642                Self::OneTime => std::option::Option::Some("ONE_TIME"),
7643                Self::Continuous => std::option::Option::Some("CONTINUOUS"),
7644                Self::UnknownValue(u) => u.0.name(),
7645            }
7646        }
7647    }
7648
7649    impl std::default::Default for Type {
7650        fn default() -> Self {
7651            use std::convert::From;
7652            Self::from(0)
7653        }
7654    }
7655
7656    impl std::fmt::Display for Type {
7657        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7658            wkt::internal::display_enum(f, self.name(), self.value())
7659        }
7660    }
7661
7662    impl std::convert::From<i32> for Type {
7663        fn from(value: i32) -> Self {
7664            match value {
7665                0 => Self::Unspecified,
7666                1 => Self::OneTime,
7667                2 => Self::Continuous,
7668                _ => Self::UnknownValue(r#type::UnknownValue(
7669                    wkt::internal::UnknownEnumValue::Integer(value),
7670                )),
7671            }
7672        }
7673    }
7674
7675    impl std::convert::From<&str> for Type {
7676        fn from(value: &str) -> Self {
7677            use std::string::ToString;
7678            match value {
7679                "TYPE_UNSPECIFIED" => Self::Unspecified,
7680                "ONE_TIME" => Self::OneTime,
7681                "CONTINUOUS" => Self::Continuous,
7682                _ => Self::UnknownValue(r#type::UnknownValue(
7683                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7684                )),
7685            }
7686        }
7687    }
7688
7689    impl serde::ser::Serialize for Type {
7690        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7691        where
7692            S: serde::Serializer,
7693        {
7694            match self {
7695                Self::Unspecified => serializer.serialize_i32(0),
7696                Self::OneTime => serializer.serialize_i32(1),
7697                Self::Continuous => serializer.serialize_i32(2),
7698                Self::UnknownValue(u) => u.0.serialize(serializer),
7699            }
7700        }
7701    }
7702
7703    impl<'de> serde::de::Deserialize<'de> for Type {
7704        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7705        where
7706            D: serde::Deserializer<'de>,
7707        {
7708            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
7709                ".google.cloud.clouddms.v1.MigrationJob.Type",
7710            ))
7711        }
7712    }
7713
7714    /// The connectivity method.
7715    #[derive(Clone, Debug, PartialEq)]
7716    #[non_exhaustive]
7717    pub enum Connectivity {
7718        /// The details needed to communicate to the source over Reverse SSH
7719        /// tunnel connectivity.
7720        ReverseSshConnectivity(std::boxed::Box<crate::model::ReverseSshConnectivity>),
7721        /// The details of the VPC network that the source database is located in.
7722        VpcPeeringConnectivity(std::boxed::Box<crate::model::VpcPeeringConnectivity>),
7723        /// static ip connectivity data (default, no additional details needed).
7724        StaticIpConnectivity(std::boxed::Box<crate::model::StaticIpConnectivity>),
7725    }
7726}
7727
7728/// A conversion workspace's version.
7729#[derive(Clone, Default, PartialEq)]
7730#[non_exhaustive]
7731pub struct ConversionWorkspaceInfo {
7732    /// The resource name (URI) of the conversion workspace.
7733    pub name: std::string::String,
7734
7735    /// The commit ID of the conversion workspace.
7736    pub commit_id: std::string::String,
7737
7738    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7739}
7740
7741impl ConversionWorkspaceInfo {
7742    pub fn new() -> Self {
7743        std::default::Default::default()
7744    }
7745
7746    /// Sets the value of [name][crate::model::ConversionWorkspaceInfo::name].
7747    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7748        self.name = v.into();
7749        self
7750    }
7751
7752    /// Sets the value of [commit_id][crate::model::ConversionWorkspaceInfo::commit_id].
7753    pub fn set_commit_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7754        self.commit_id = v.into();
7755        self
7756    }
7757}
7758
7759impl wkt::message::Message for ConversionWorkspaceInfo {
7760    fn typename() -> &'static str {
7761        "type.googleapis.com/google.cloud.clouddms.v1.ConversionWorkspaceInfo"
7762    }
7763}
7764
7765/// A connection profile definition.
7766#[derive(Clone, Default, PartialEq)]
7767#[non_exhaustive]
7768pub struct ConnectionProfile {
7769    /// The name of this connection profile resource in the form of
7770    /// projects/{project}/locations/{location}/connectionProfiles/{connectionProfile}.
7771    pub name: std::string::String,
7772
7773    /// Output only. The timestamp when the resource was created.
7774    /// A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds.
7775    /// Example: "2014-10-02T15:01:23.045123456Z".
7776    pub create_time: std::option::Option<wkt::Timestamp>,
7777
7778    /// Output only. The timestamp when the resource was last updated.
7779    /// A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds.
7780    /// Example: "2014-10-02T15:01:23.045123456Z".
7781    pub update_time: std::option::Option<wkt::Timestamp>,
7782
7783    /// The resource labels for connection profile to use to annotate any related
7784    /// underlying resources such as Compute Engine VMs. An object containing a
7785    /// list of "key": "value" pairs.
7786    ///
7787    /// Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`.
7788    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7789
7790    /// The current connection profile state (e.g. DRAFT, READY, or FAILED).
7791    pub state: crate::model::connection_profile::State,
7792
7793    /// The connection profile display name.
7794    pub display_name: std::string::String,
7795
7796    /// Output only. The error details in case of state FAILED.
7797    pub error: std::option::Option<rpc::model::Status>,
7798
7799    /// The database provider.
7800    pub provider: crate::model::DatabaseProvider,
7801
7802    /// The connection profile definition.
7803    pub connection_profile:
7804        std::option::Option<crate::model::connection_profile::ConnectionProfile>,
7805
7806    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7807}
7808
7809impl ConnectionProfile {
7810    pub fn new() -> Self {
7811        std::default::Default::default()
7812    }
7813
7814    /// Sets the value of [name][crate::model::ConnectionProfile::name].
7815    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7816        self.name = v.into();
7817        self
7818    }
7819
7820    /// Sets the value of [create_time][crate::model::ConnectionProfile::create_time].
7821    pub fn set_create_time<T>(mut self, v: T) -> Self
7822    where
7823        T: std::convert::Into<wkt::Timestamp>,
7824    {
7825        self.create_time = std::option::Option::Some(v.into());
7826        self
7827    }
7828
7829    /// Sets or clears the value of [create_time][crate::model::ConnectionProfile::create_time].
7830    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7831    where
7832        T: std::convert::Into<wkt::Timestamp>,
7833    {
7834        self.create_time = v.map(|x| x.into());
7835        self
7836    }
7837
7838    /// Sets the value of [update_time][crate::model::ConnectionProfile::update_time].
7839    pub fn set_update_time<T>(mut self, v: T) -> Self
7840    where
7841        T: std::convert::Into<wkt::Timestamp>,
7842    {
7843        self.update_time = std::option::Option::Some(v.into());
7844        self
7845    }
7846
7847    /// Sets or clears the value of [update_time][crate::model::ConnectionProfile::update_time].
7848    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7849    where
7850        T: std::convert::Into<wkt::Timestamp>,
7851    {
7852        self.update_time = v.map(|x| x.into());
7853        self
7854    }
7855
7856    /// Sets the value of [labels][crate::model::ConnectionProfile::labels].
7857    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7858    where
7859        T: std::iter::IntoIterator<Item = (K, V)>,
7860        K: std::convert::Into<std::string::String>,
7861        V: std::convert::Into<std::string::String>,
7862    {
7863        use std::iter::Iterator;
7864        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7865        self
7866    }
7867
7868    /// Sets the value of [state][crate::model::ConnectionProfile::state].
7869    pub fn set_state<T: std::convert::Into<crate::model::connection_profile::State>>(
7870        mut self,
7871        v: T,
7872    ) -> Self {
7873        self.state = v.into();
7874        self
7875    }
7876
7877    /// Sets the value of [display_name][crate::model::ConnectionProfile::display_name].
7878    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7879        self.display_name = v.into();
7880        self
7881    }
7882
7883    /// Sets the value of [error][crate::model::ConnectionProfile::error].
7884    pub fn set_error<T>(mut self, v: T) -> Self
7885    where
7886        T: std::convert::Into<rpc::model::Status>,
7887    {
7888        self.error = std::option::Option::Some(v.into());
7889        self
7890    }
7891
7892    /// Sets or clears the value of [error][crate::model::ConnectionProfile::error].
7893    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
7894    where
7895        T: std::convert::Into<rpc::model::Status>,
7896    {
7897        self.error = v.map(|x| x.into());
7898        self
7899    }
7900
7901    /// Sets the value of [provider][crate::model::ConnectionProfile::provider].
7902    pub fn set_provider<T: std::convert::Into<crate::model::DatabaseProvider>>(
7903        mut self,
7904        v: T,
7905    ) -> Self {
7906        self.provider = v.into();
7907        self
7908    }
7909
7910    /// Sets the value of [connection_profile][crate::model::ConnectionProfile::connection_profile].
7911    ///
7912    /// Note that all the setters affecting `connection_profile` are mutually
7913    /// exclusive.
7914    pub fn set_connection_profile<
7915        T: std::convert::Into<
7916                std::option::Option<crate::model::connection_profile::ConnectionProfile>,
7917            >,
7918    >(
7919        mut self,
7920        v: T,
7921    ) -> Self {
7922        self.connection_profile = v.into();
7923        self
7924    }
7925
7926    /// The value of [connection_profile][crate::model::ConnectionProfile::connection_profile]
7927    /// if it holds a `Mysql`, `None` if the field is not set or
7928    /// holds a different branch.
7929    pub fn mysql(
7930        &self,
7931    ) -> std::option::Option<&std::boxed::Box<crate::model::MySqlConnectionProfile>> {
7932        #[allow(unreachable_patterns)]
7933        self.connection_profile.as_ref().and_then(|v| match v {
7934            crate::model::connection_profile::ConnectionProfile::Mysql(v) => {
7935                std::option::Option::Some(v)
7936            }
7937            _ => std::option::Option::None,
7938        })
7939    }
7940
7941    /// Sets the value of [connection_profile][crate::model::ConnectionProfile::connection_profile]
7942    /// to hold a `Mysql`.
7943    ///
7944    /// Note that all the setters affecting `connection_profile` are
7945    /// mutually exclusive.
7946    pub fn set_mysql<
7947        T: std::convert::Into<std::boxed::Box<crate::model::MySqlConnectionProfile>>,
7948    >(
7949        mut self,
7950        v: T,
7951    ) -> Self {
7952        self.connection_profile = std::option::Option::Some(
7953            crate::model::connection_profile::ConnectionProfile::Mysql(v.into()),
7954        );
7955        self
7956    }
7957
7958    /// The value of [connection_profile][crate::model::ConnectionProfile::connection_profile]
7959    /// if it holds a `Postgresql`, `None` if the field is not set or
7960    /// holds a different branch.
7961    pub fn postgresql(
7962        &self,
7963    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgreSqlConnectionProfile>> {
7964        #[allow(unreachable_patterns)]
7965        self.connection_profile.as_ref().and_then(|v| match v {
7966            crate::model::connection_profile::ConnectionProfile::Postgresql(v) => {
7967                std::option::Option::Some(v)
7968            }
7969            _ => std::option::Option::None,
7970        })
7971    }
7972
7973    /// Sets the value of [connection_profile][crate::model::ConnectionProfile::connection_profile]
7974    /// to hold a `Postgresql`.
7975    ///
7976    /// Note that all the setters affecting `connection_profile` are
7977    /// mutually exclusive.
7978    pub fn set_postgresql<
7979        T: std::convert::Into<std::boxed::Box<crate::model::PostgreSqlConnectionProfile>>,
7980    >(
7981        mut self,
7982        v: T,
7983    ) -> Self {
7984        self.connection_profile = std::option::Option::Some(
7985            crate::model::connection_profile::ConnectionProfile::Postgresql(v.into()),
7986        );
7987        self
7988    }
7989
7990    /// The value of [connection_profile][crate::model::ConnectionProfile::connection_profile]
7991    /// if it holds a `Oracle`, `None` if the field is not set or
7992    /// holds a different branch.
7993    pub fn oracle(
7994        &self,
7995    ) -> std::option::Option<&std::boxed::Box<crate::model::OracleConnectionProfile>> {
7996        #[allow(unreachable_patterns)]
7997        self.connection_profile.as_ref().and_then(|v| match v {
7998            crate::model::connection_profile::ConnectionProfile::Oracle(v) => {
7999                std::option::Option::Some(v)
8000            }
8001            _ => std::option::Option::None,
8002        })
8003    }
8004
8005    /// Sets the value of [connection_profile][crate::model::ConnectionProfile::connection_profile]
8006    /// to hold a `Oracle`.
8007    ///
8008    /// Note that all the setters affecting `connection_profile` are
8009    /// mutually exclusive.
8010    pub fn set_oracle<
8011        T: std::convert::Into<std::boxed::Box<crate::model::OracleConnectionProfile>>,
8012    >(
8013        mut self,
8014        v: T,
8015    ) -> Self {
8016        self.connection_profile = std::option::Option::Some(
8017            crate::model::connection_profile::ConnectionProfile::Oracle(v.into()),
8018        );
8019        self
8020    }
8021
8022    /// The value of [connection_profile][crate::model::ConnectionProfile::connection_profile]
8023    /// if it holds a `Cloudsql`, `None` if the field is not set or
8024    /// holds a different branch.
8025    pub fn cloudsql(
8026        &self,
8027    ) -> std::option::Option<&std::boxed::Box<crate::model::CloudSqlConnectionProfile>> {
8028        #[allow(unreachable_patterns)]
8029        self.connection_profile.as_ref().and_then(|v| match v {
8030            crate::model::connection_profile::ConnectionProfile::Cloudsql(v) => {
8031                std::option::Option::Some(v)
8032            }
8033            _ => std::option::Option::None,
8034        })
8035    }
8036
8037    /// Sets the value of [connection_profile][crate::model::ConnectionProfile::connection_profile]
8038    /// to hold a `Cloudsql`.
8039    ///
8040    /// Note that all the setters affecting `connection_profile` are
8041    /// mutually exclusive.
8042    pub fn set_cloudsql<
8043        T: std::convert::Into<std::boxed::Box<crate::model::CloudSqlConnectionProfile>>,
8044    >(
8045        mut self,
8046        v: T,
8047    ) -> Self {
8048        self.connection_profile = std::option::Option::Some(
8049            crate::model::connection_profile::ConnectionProfile::Cloudsql(v.into()),
8050        );
8051        self
8052    }
8053
8054    /// The value of [connection_profile][crate::model::ConnectionProfile::connection_profile]
8055    /// if it holds a `Alloydb`, `None` if the field is not set or
8056    /// holds a different branch.
8057    pub fn alloydb(
8058        &self,
8059    ) -> std::option::Option<&std::boxed::Box<crate::model::AlloyDbConnectionProfile>> {
8060        #[allow(unreachable_patterns)]
8061        self.connection_profile.as_ref().and_then(|v| match v {
8062            crate::model::connection_profile::ConnectionProfile::Alloydb(v) => {
8063                std::option::Option::Some(v)
8064            }
8065            _ => std::option::Option::None,
8066        })
8067    }
8068
8069    /// Sets the value of [connection_profile][crate::model::ConnectionProfile::connection_profile]
8070    /// to hold a `Alloydb`.
8071    ///
8072    /// Note that all the setters affecting `connection_profile` are
8073    /// mutually exclusive.
8074    pub fn set_alloydb<
8075        T: std::convert::Into<std::boxed::Box<crate::model::AlloyDbConnectionProfile>>,
8076    >(
8077        mut self,
8078        v: T,
8079    ) -> Self {
8080        self.connection_profile = std::option::Option::Some(
8081            crate::model::connection_profile::ConnectionProfile::Alloydb(v.into()),
8082        );
8083        self
8084    }
8085}
8086
8087impl wkt::message::Message for ConnectionProfile {
8088    fn typename() -> &'static str {
8089        "type.googleapis.com/google.cloud.clouddms.v1.ConnectionProfile"
8090    }
8091}
8092
8093/// Defines additional types related to [ConnectionProfile].
8094pub mod connection_profile {
8095    #[allow(unused_imports)]
8096    use super::*;
8097
8098    /// The current connection profile state (e.g. DRAFT, READY, or FAILED).
8099    ///
8100    /// # Working with unknown values
8101    ///
8102    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8103    /// additional enum variants at any time. Adding new variants is not considered
8104    /// a breaking change. Applications should write their code in anticipation of:
8105    ///
8106    /// - New values appearing in future releases of the client library, **and**
8107    /// - New values received dynamically, without application changes.
8108    ///
8109    /// Please consult the [Working with enums] section in the user guide for some
8110    /// guidelines.
8111    ///
8112    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8113    #[derive(Clone, Debug, PartialEq)]
8114    #[non_exhaustive]
8115    pub enum State {
8116        /// The state of the connection profile is unknown.
8117        Unspecified,
8118        /// The connection profile is in draft mode and fully editable.
8119        Draft,
8120        /// The connection profile is being created.
8121        Creating,
8122        /// The connection profile is ready.
8123        Ready,
8124        /// The connection profile is being updated.
8125        Updating,
8126        /// The connection profile is being deleted.
8127        Deleting,
8128        /// The connection profile has been deleted.
8129        Deleted,
8130        /// The last action on the connection profile failed.
8131        Failed,
8132        /// If set, the enum was initialized with an unknown value.
8133        ///
8134        /// Applications can examine the value using [State::value] or
8135        /// [State::name].
8136        UnknownValue(state::UnknownValue),
8137    }
8138
8139    #[doc(hidden)]
8140    pub mod state {
8141        #[allow(unused_imports)]
8142        use super::*;
8143        #[derive(Clone, Debug, PartialEq)]
8144        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8145    }
8146
8147    impl State {
8148        /// Gets the enum value.
8149        ///
8150        /// Returns `None` if the enum contains an unknown value deserialized from
8151        /// the string representation of enums.
8152        pub fn value(&self) -> std::option::Option<i32> {
8153            match self {
8154                Self::Unspecified => std::option::Option::Some(0),
8155                Self::Draft => std::option::Option::Some(1),
8156                Self::Creating => std::option::Option::Some(2),
8157                Self::Ready => std::option::Option::Some(3),
8158                Self::Updating => std::option::Option::Some(4),
8159                Self::Deleting => std::option::Option::Some(5),
8160                Self::Deleted => std::option::Option::Some(6),
8161                Self::Failed => std::option::Option::Some(7),
8162                Self::UnknownValue(u) => u.0.value(),
8163            }
8164        }
8165
8166        /// Gets the enum value as a string.
8167        ///
8168        /// Returns `None` if the enum contains an unknown value deserialized from
8169        /// the integer representation of enums.
8170        pub fn name(&self) -> std::option::Option<&str> {
8171            match self {
8172                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
8173                Self::Draft => std::option::Option::Some("DRAFT"),
8174                Self::Creating => std::option::Option::Some("CREATING"),
8175                Self::Ready => std::option::Option::Some("READY"),
8176                Self::Updating => std::option::Option::Some("UPDATING"),
8177                Self::Deleting => std::option::Option::Some("DELETING"),
8178                Self::Deleted => std::option::Option::Some("DELETED"),
8179                Self::Failed => std::option::Option::Some("FAILED"),
8180                Self::UnknownValue(u) => u.0.name(),
8181            }
8182        }
8183    }
8184
8185    impl std::default::Default for State {
8186        fn default() -> Self {
8187            use std::convert::From;
8188            Self::from(0)
8189        }
8190    }
8191
8192    impl std::fmt::Display for State {
8193        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8194            wkt::internal::display_enum(f, self.name(), self.value())
8195        }
8196    }
8197
8198    impl std::convert::From<i32> for State {
8199        fn from(value: i32) -> Self {
8200            match value {
8201                0 => Self::Unspecified,
8202                1 => Self::Draft,
8203                2 => Self::Creating,
8204                3 => Self::Ready,
8205                4 => Self::Updating,
8206                5 => Self::Deleting,
8207                6 => Self::Deleted,
8208                7 => Self::Failed,
8209                _ => Self::UnknownValue(state::UnknownValue(
8210                    wkt::internal::UnknownEnumValue::Integer(value),
8211                )),
8212            }
8213        }
8214    }
8215
8216    impl std::convert::From<&str> for State {
8217        fn from(value: &str) -> Self {
8218            use std::string::ToString;
8219            match value {
8220                "STATE_UNSPECIFIED" => Self::Unspecified,
8221                "DRAFT" => Self::Draft,
8222                "CREATING" => Self::Creating,
8223                "READY" => Self::Ready,
8224                "UPDATING" => Self::Updating,
8225                "DELETING" => Self::Deleting,
8226                "DELETED" => Self::Deleted,
8227                "FAILED" => Self::Failed,
8228                _ => Self::UnknownValue(state::UnknownValue(
8229                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8230                )),
8231            }
8232        }
8233    }
8234
8235    impl serde::ser::Serialize for State {
8236        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8237        where
8238            S: serde::Serializer,
8239        {
8240            match self {
8241                Self::Unspecified => serializer.serialize_i32(0),
8242                Self::Draft => serializer.serialize_i32(1),
8243                Self::Creating => serializer.serialize_i32(2),
8244                Self::Ready => serializer.serialize_i32(3),
8245                Self::Updating => serializer.serialize_i32(4),
8246                Self::Deleting => serializer.serialize_i32(5),
8247                Self::Deleted => serializer.serialize_i32(6),
8248                Self::Failed => serializer.serialize_i32(7),
8249                Self::UnknownValue(u) => u.0.serialize(serializer),
8250            }
8251        }
8252    }
8253
8254    impl<'de> serde::de::Deserialize<'de> for State {
8255        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8256        where
8257            D: serde::Deserializer<'de>,
8258        {
8259            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
8260                ".google.cloud.clouddms.v1.ConnectionProfile.State",
8261            ))
8262        }
8263    }
8264
8265    /// The connection profile definition.
8266    #[derive(Clone, Debug, PartialEq)]
8267    #[non_exhaustive]
8268    pub enum ConnectionProfile {
8269        /// A MySQL database connection profile.
8270        Mysql(std::boxed::Box<crate::model::MySqlConnectionProfile>),
8271        /// A PostgreSQL database connection profile.
8272        Postgresql(std::boxed::Box<crate::model::PostgreSqlConnectionProfile>),
8273        /// An Oracle database connection profile.
8274        Oracle(std::boxed::Box<crate::model::OracleConnectionProfile>),
8275        /// A CloudSQL database connection profile.
8276        Cloudsql(std::boxed::Box<crate::model::CloudSqlConnectionProfile>),
8277        /// An AlloyDB cluster connection profile.
8278        Alloydb(std::boxed::Box<crate::model::AlloyDbConnectionProfile>),
8279    }
8280}
8281
8282/// Error message of a verification Migration job.
8283#[derive(Clone, Default, PartialEq)]
8284#[non_exhaustive]
8285pub struct MigrationJobVerificationError {
8286    /// Output only. An instance of ErrorCode specifying the error that occurred.
8287    pub error_code: crate::model::migration_job_verification_error::ErrorCode,
8288
8289    /// Output only. A formatted message with further details about the error and a
8290    /// CTA.
8291    pub error_message: std::string::String,
8292
8293    /// Output only. A specific detailed error message, if supplied by the engine.
8294    pub error_detail_message: std::string::String,
8295
8296    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8297}
8298
8299impl MigrationJobVerificationError {
8300    pub fn new() -> Self {
8301        std::default::Default::default()
8302    }
8303
8304    /// Sets the value of [error_code][crate::model::MigrationJobVerificationError::error_code].
8305    pub fn set_error_code<
8306        T: std::convert::Into<crate::model::migration_job_verification_error::ErrorCode>,
8307    >(
8308        mut self,
8309        v: T,
8310    ) -> Self {
8311        self.error_code = v.into();
8312        self
8313    }
8314
8315    /// Sets the value of [error_message][crate::model::MigrationJobVerificationError::error_message].
8316    pub fn set_error_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8317        self.error_message = v.into();
8318        self
8319    }
8320
8321    /// Sets the value of [error_detail_message][crate::model::MigrationJobVerificationError::error_detail_message].
8322    pub fn set_error_detail_message<T: std::convert::Into<std::string::String>>(
8323        mut self,
8324        v: T,
8325    ) -> Self {
8326        self.error_detail_message = v.into();
8327        self
8328    }
8329}
8330
8331impl wkt::message::Message for MigrationJobVerificationError {
8332    fn typename() -> &'static str {
8333        "type.googleapis.com/google.cloud.clouddms.v1.MigrationJobVerificationError"
8334    }
8335}
8336
8337/// Defines additional types related to [MigrationJobVerificationError].
8338pub mod migration_job_verification_error {
8339    #[allow(unused_imports)]
8340    use super::*;
8341
8342    /// A general error code describing the type of error that occurred.
8343    ///
8344    /// # Working with unknown values
8345    ///
8346    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8347    /// additional enum variants at any time. Adding new variants is not considered
8348    /// a breaking change. Applications should write their code in anticipation of:
8349    ///
8350    /// - New values appearing in future releases of the client library, **and**
8351    /// - New values received dynamically, without application changes.
8352    ///
8353    /// Please consult the [Working with enums] section in the user guide for some
8354    /// guidelines.
8355    ///
8356    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8357    #[derive(Clone, Debug, PartialEq)]
8358    #[non_exhaustive]
8359    pub enum ErrorCode {
8360        /// An unknown error occurred
8361        Unspecified,
8362        /// We failed to connect to one of the connection profile.
8363        ConnectionFailure,
8364        /// We failed to authenticate to one of the connection profile.
8365        AuthenticationFailure,
8366        /// One of the involved connection profiles has an invalid configuration.
8367        InvalidConnectionProfileConfig,
8368        /// The versions of the source and the destination are incompatible.
8369        VersionIncompatibility,
8370        /// The types of the source and the destination are incompatible.
8371        ConnectionProfileTypesIncompatibility,
8372        /// No pglogical extension installed on databases, applicable for postgres.
8373        NoPglogicalInstalled,
8374        /// pglogical node already exists on databases, applicable for postgres.
8375        PglogicalNodeAlreadyExists,
8376        /// The value of parameter wal_level is not set to logical.
8377        InvalidWalLevel,
8378        /// The value of parameter shared_preload_libraries does not include
8379        /// pglogical.
8380        InvalidSharedPreloadLibrary,
8381        /// The value of parameter max_replication_slots is not sufficient.
8382        InsufficientMaxReplicationSlots,
8383        /// The value of parameter max_wal_senders is not sufficient.
8384        InsufficientMaxWalSenders,
8385        /// The value of parameter max_worker_processes is not sufficient.
8386        InsufficientMaxWorkerProcesses,
8387        /// Extensions installed are either not supported or having unsupported
8388        /// versions.
8389        UnsupportedExtensions,
8390        /// Unsupported migration type.
8391        UnsupportedMigrationType,
8392        /// Invalid RDS logical replication.
8393        InvalidRdsLogicalReplication,
8394        /// The gtid_mode is not supported, applicable for MySQL.
8395        UnsupportedGtidMode,
8396        /// The table definition is not support due to missing primary key or replica
8397        /// identity.
8398        UnsupportedTableDefinition,
8399        /// The definer is not supported.
8400        UnsupportedDefiner,
8401        /// Migration is already running at the time of restart request.
8402        CantRestartRunningMigration,
8403        /// The source already has a replication setup.
8404        SourceAlreadySetup,
8405        /// The source has tables with limited support.
8406        /// E.g. PostgreSQL tables without primary keys.
8407        TablesWithLimitedSupport,
8408        /// The source uses an unsupported locale.
8409        UnsupportedDatabaseLocale,
8410        /// The source uses an unsupported Foreign Data Wrapper configuration.
8411        UnsupportedDatabaseFdwConfig,
8412        /// There was an underlying RDBMS error.
8413        ErrorRdbms,
8414        /// The source DB size in Bytes exceeds a certain threshold. The migration
8415        /// might require an increase of quota, or might not be supported.
8416        SourceSizeExceedsThreshold,
8417        /// The destination DB contains existing databases that are conflicting with
8418        /// those in the source DB.
8419        ExistingConflictingDatabases,
8420        /// Insufficient privilege to enable the parallelism configuration.
8421        ParallelImportInsufficientPrivilege,
8422        /// If set, the enum was initialized with an unknown value.
8423        ///
8424        /// Applications can examine the value using [ErrorCode::value] or
8425        /// [ErrorCode::name].
8426        UnknownValue(error_code::UnknownValue),
8427    }
8428
8429    #[doc(hidden)]
8430    pub mod error_code {
8431        #[allow(unused_imports)]
8432        use super::*;
8433        #[derive(Clone, Debug, PartialEq)]
8434        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8435    }
8436
8437    impl ErrorCode {
8438        /// Gets the enum value.
8439        ///
8440        /// Returns `None` if the enum contains an unknown value deserialized from
8441        /// the string representation of enums.
8442        pub fn value(&self) -> std::option::Option<i32> {
8443            match self {
8444                Self::Unspecified => std::option::Option::Some(0),
8445                Self::ConnectionFailure => std::option::Option::Some(1),
8446                Self::AuthenticationFailure => std::option::Option::Some(2),
8447                Self::InvalidConnectionProfileConfig => std::option::Option::Some(3),
8448                Self::VersionIncompatibility => std::option::Option::Some(4),
8449                Self::ConnectionProfileTypesIncompatibility => std::option::Option::Some(5),
8450                Self::NoPglogicalInstalled => std::option::Option::Some(7),
8451                Self::PglogicalNodeAlreadyExists => std::option::Option::Some(8),
8452                Self::InvalidWalLevel => std::option::Option::Some(9),
8453                Self::InvalidSharedPreloadLibrary => std::option::Option::Some(10),
8454                Self::InsufficientMaxReplicationSlots => std::option::Option::Some(11),
8455                Self::InsufficientMaxWalSenders => std::option::Option::Some(12),
8456                Self::InsufficientMaxWorkerProcesses => std::option::Option::Some(13),
8457                Self::UnsupportedExtensions => std::option::Option::Some(14),
8458                Self::UnsupportedMigrationType => std::option::Option::Some(15),
8459                Self::InvalidRdsLogicalReplication => std::option::Option::Some(16),
8460                Self::UnsupportedGtidMode => std::option::Option::Some(17),
8461                Self::UnsupportedTableDefinition => std::option::Option::Some(18),
8462                Self::UnsupportedDefiner => std::option::Option::Some(19),
8463                Self::CantRestartRunningMigration => std::option::Option::Some(21),
8464                Self::SourceAlreadySetup => std::option::Option::Some(23),
8465                Self::TablesWithLimitedSupport => std::option::Option::Some(24),
8466                Self::UnsupportedDatabaseLocale => std::option::Option::Some(25),
8467                Self::UnsupportedDatabaseFdwConfig => std::option::Option::Some(26),
8468                Self::ErrorRdbms => std::option::Option::Some(27),
8469                Self::SourceSizeExceedsThreshold => std::option::Option::Some(28),
8470                Self::ExistingConflictingDatabases => std::option::Option::Some(29),
8471                Self::ParallelImportInsufficientPrivilege => std::option::Option::Some(30),
8472                Self::UnknownValue(u) => u.0.value(),
8473            }
8474        }
8475
8476        /// Gets the enum value as a string.
8477        ///
8478        /// Returns `None` if the enum contains an unknown value deserialized from
8479        /// the integer representation of enums.
8480        pub fn name(&self) -> std::option::Option<&str> {
8481            match self {
8482                Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
8483                Self::ConnectionFailure => std::option::Option::Some("CONNECTION_FAILURE"),
8484                Self::AuthenticationFailure => std::option::Option::Some("AUTHENTICATION_FAILURE"),
8485                Self::InvalidConnectionProfileConfig => {
8486                    std::option::Option::Some("INVALID_CONNECTION_PROFILE_CONFIG")
8487                }
8488                Self::VersionIncompatibility => {
8489                    std::option::Option::Some("VERSION_INCOMPATIBILITY")
8490                }
8491                Self::ConnectionProfileTypesIncompatibility => {
8492                    std::option::Option::Some("CONNECTION_PROFILE_TYPES_INCOMPATIBILITY")
8493                }
8494                Self::NoPglogicalInstalled => std::option::Option::Some("NO_PGLOGICAL_INSTALLED"),
8495                Self::PglogicalNodeAlreadyExists => {
8496                    std::option::Option::Some("PGLOGICAL_NODE_ALREADY_EXISTS")
8497                }
8498                Self::InvalidWalLevel => std::option::Option::Some("INVALID_WAL_LEVEL"),
8499                Self::InvalidSharedPreloadLibrary => {
8500                    std::option::Option::Some("INVALID_SHARED_PRELOAD_LIBRARY")
8501                }
8502                Self::InsufficientMaxReplicationSlots => {
8503                    std::option::Option::Some("INSUFFICIENT_MAX_REPLICATION_SLOTS")
8504                }
8505                Self::InsufficientMaxWalSenders => {
8506                    std::option::Option::Some("INSUFFICIENT_MAX_WAL_SENDERS")
8507                }
8508                Self::InsufficientMaxWorkerProcesses => {
8509                    std::option::Option::Some("INSUFFICIENT_MAX_WORKER_PROCESSES")
8510                }
8511                Self::UnsupportedExtensions => std::option::Option::Some("UNSUPPORTED_EXTENSIONS"),
8512                Self::UnsupportedMigrationType => {
8513                    std::option::Option::Some("UNSUPPORTED_MIGRATION_TYPE")
8514                }
8515                Self::InvalidRdsLogicalReplication => {
8516                    std::option::Option::Some("INVALID_RDS_LOGICAL_REPLICATION")
8517                }
8518                Self::UnsupportedGtidMode => std::option::Option::Some("UNSUPPORTED_GTID_MODE"),
8519                Self::UnsupportedTableDefinition => {
8520                    std::option::Option::Some("UNSUPPORTED_TABLE_DEFINITION")
8521                }
8522                Self::UnsupportedDefiner => std::option::Option::Some("UNSUPPORTED_DEFINER"),
8523                Self::CantRestartRunningMigration => {
8524                    std::option::Option::Some("CANT_RESTART_RUNNING_MIGRATION")
8525                }
8526                Self::SourceAlreadySetup => std::option::Option::Some("SOURCE_ALREADY_SETUP"),
8527                Self::TablesWithLimitedSupport => {
8528                    std::option::Option::Some("TABLES_WITH_LIMITED_SUPPORT")
8529                }
8530                Self::UnsupportedDatabaseLocale => {
8531                    std::option::Option::Some("UNSUPPORTED_DATABASE_LOCALE")
8532                }
8533                Self::UnsupportedDatabaseFdwConfig => {
8534                    std::option::Option::Some("UNSUPPORTED_DATABASE_FDW_CONFIG")
8535                }
8536                Self::ErrorRdbms => std::option::Option::Some("ERROR_RDBMS"),
8537                Self::SourceSizeExceedsThreshold => {
8538                    std::option::Option::Some("SOURCE_SIZE_EXCEEDS_THRESHOLD")
8539                }
8540                Self::ExistingConflictingDatabases => {
8541                    std::option::Option::Some("EXISTING_CONFLICTING_DATABASES")
8542                }
8543                Self::ParallelImportInsufficientPrivilege => {
8544                    std::option::Option::Some("PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE")
8545                }
8546                Self::UnknownValue(u) => u.0.name(),
8547            }
8548        }
8549    }
8550
8551    impl std::default::Default for ErrorCode {
8552        fn default() -> Self {
8553            use std::convert::From;
8554            Self::from(0)
8555        }
8556    }
8557
8558    impl std::fmt::Display for ErrorCode {
8559        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8560            wkt::internal::display_enum(f, self.name(), self.value())
8561        }
8562    }
8563
8564    impl std::convert::From<i32> for ErrorCode {
8565        fn from(value: i32) -> Self {
8566            match value {
8567                0 => Self::Unspecified,
8568                1 => Self::ConnectionFailure,
8569                2 => Self::AuthenticationFailure,
8570                3 => Self::InvalidConnectionProfileConfig,
8571                4 => Self::VersionIncompatibility,
8572                5 => Self::ConnectionProfileTypesIncompatibility,
8573                7 => Self::NoPglogicalInstalled,
8574                8 => Self::PglogicalNodeAlreadyExists,
8575                9 => Self::InvalidWalLevel,
8576                10 => Self::InvalidSharedPreloadLibrary,
8577                11 => Self::InsufficientMaxReplicationSlots,
8578                12 => Self::InsufficientMaxWalSenders,
8579                13 => Self::InsufficientMaxWorkerProcesses,
8580                14 => Self::UnsupportedExtensions,
8581                15 => Self::UnsupportedMigrationType,
8582                16 => Self::InvalidRdsLogicalReplication,
8583                17 => Self::UnsupportedGtidMode,
8584                18 => Self::UnsupportedTableDefinition,
8585                19 => Self::UnsupportedDefiner,
8586                21 => Self::CantRestartRunningMigration,
8587                23 => Self::SourceAlreadySetup,
8588                24 => Self::TablesWithLimitedSupport,
8589                25 => Self::UnsupportedDatabaseLocale,
8590                26 => Self::UnsupportedDatabaseFdwConfig,
8591                27 => Self::ErrorRdbms,
8592                28 => Self::SourceSizeExceedsThreshold,
8593                29 => Self::ExistingConflictingDatabases,
8594                30 => Self::ParallelImportInsufficientPrivilege,
8595                _ => Self::UnknownValue(error_code::UnknownValue(
8596                    wkt::internal::UnknownEnumValue::Integer(value),
8597                )),
8598            }
8599        }
8600    }
8601
8602    impl std::convert::From<&str> for ErrorCode {
8603        fn from(value: &str) -> Self {
8604            use std::string::ToString;
8605            match value {
8606                "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
8607                "CONNECTION_FAILURE" => Self::ConnectionFailure,
8608                "AUTHENTICATION_FAILURE" => Self::AuthenticationFailure,
8609                "INVALID_CONNECTION_PROFILE_CONFIG" => Self::InvalidConnectionProfileConfig,
8610                "VERSION_INCOMPATIBILITY" => Self::VersionIncompatibility,
8611                "CONNECTION_PROFILE_TYPES_INCOMPATIBILITY" => {
8612                    Self::ConnectionProfileTypesIncompatibility
8613                }
8614                "NO_PGLOGICAL_INSTALLED" => Self::NoPglogicalInstalled,
8615                "PGLOGICAL_NODE_ALREADY_EXISTS" => Self::PglogicalNodeAlreadyExists,
8616                "INVALID_WAL_LEVEL" => Self::InvalidWalLevel,
8617                "INVALID_SHARED_PRELOAD_LIBRARY" => Self::InvalidSharedPreloadLibrary,
8618                "INSUFFICIENT_MAX_REPLICATION_SLOTS" => Self::InsufficientMaxReplicationSlots,
8619                "INSUFFICIENT_MAX_WAL_SENDERS" => Self::InsufficientMaxWalSenders,
8620                "INSUFFICIENT_MAX_WORKER_PROCESSES" => Self::InsufficientMaxWorkerProcesses,
8621                "UNSUPPORTED_EXTENSIONS" => Self::UnsupportedExtensions,
8622                "UNSUPPORTED_MIGRATION_TYPE" => Self::UnsupportedMigrationType,
8623                "INVALID_RDS_LOGICAL_REPLICATION" => Self::InvalidRdsLogicalReplication,
8624                "UNSUPPORTED_GTID_MODE" => Self::UnsupportedGtidMode,
8625                "UNSUPPORTED_TABLE_DEFINITION" => Self::UnsupportedTableDefinition,
8626                "UNSUPPORTED_DEFINER" => Self::UnsupportedDefiner,
8627                "CANT_RESTART_RUNNING_MIGRATION" => Self::CantRestartRunningMigration,
8628                "SOURCE_ALREADY_SETUP" => Self::SourceAlreadySetup,
8629                "TABLES_WITH_LIMITED_SUPPORT" => Self::TablesWithLimitedSupport,
8630                "UNSUPPORTED_DATABASE_LOCALE" => Self::UnsupportedDatabaseLocale,
8631                "UNSUPPORTED_DATABASE_FDW_CONFIG" => Self::UnsupportedDatabaseFdwConfig,
8632                "ERROR_RDBMS" => Self::ErrorRdbms,
8633                "SOURCE_SIZE_EXCEEDS_THRESHOLD" => Self::SourceSizeExceedsThreshold,
8634                "EXISTING_CONFLICTING_DATABASES" => Self::ExistingConflictingDatabases,
8635                "PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE" => {
8636                    Self::ParallelImportInsufficientPrivilege
8637                }
8638                _ => Self::UnknownValue(error_code::UnknownValue(
8639                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8640                )),
8641            }
8642        }
8643    }
8644
8645    impl serde::ser::Serialize for ErrorCode {
8646        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8647        where
8648            S: serde::Serializer,
8649        {
8650            match self {
8651                Self::Unspecified => serializer.serialize_i32(0),
8652                Self::ConnectionFailure => serializer.serialize_i32(1),
8653                Self::AuthenticationFailure => serializer.serialize_i32(2),
8654                Self::InvalidConnectionProfileConfig => serializer.serialize_i32(3),
8655                Self::VersionIncompatibility => serializer.serialize_i32(4),
8656                Self::ConnectionProfileTypesIncompatibility => serializer.serialize_i32(5),
8657                Self::NoPglogicalInstalled => serializer.serialize_i32(7),
8658                Self::PglogicalNodeAlreadyExists => serializer.serialize_i32(8),
8659                Self::InvalidWalLevel => serializer.serialize_i32(9),
8660                Self::InvalidSharedPreloadLibrary => serializer.serialize_i32(10),
8661                Self::InsufficientMaxReplicationSlots => serializer.serialize_i32(11),
8662                Self::InsufficientMaxWalSenders => serializer.serialize_i32(12),
8663                Self::InsufficientMaxWorkerProcesses => serializer.serialize_i32(13),
8664                Self::UnsupportedExtensions => serializer.serialize_i32(14),
8665                Self::UnsupportedMigrationType => serializer.serialize_i32(15),
8666                Self::InvalidRdsLogicalReplication => serializer.serialize_i32(16),
8667                Self::UnsupportedGtidMode => serializer.serialize_i32(17),
8668                Self::UnsupportedTableDefinition => serializer.serialize_i32(18),
8669                Self::UnsupportedDefiner => serializer.serialize_i32(19),
8670                Self::CantRestartRunningMigration => serializer.serialize_i32(21),
8671                Self::SourceAlreadySetup => serializer.serialize_i32(23),
8672                Self::TablesWithLimitedSupport => serializer.serialize_i32(24),
8673                Self::UnsupportedDatabaseLocale => serializer.serialize_i32(25),
8674                Self::UnsupportedDatabaseFdwConfig => serializer.serialize_i32(26),
8675                Self::ErrorRdbms => serializer.serialize_i32(27),
8676                Self::SourceSizeExceedsThreshold => serializer.serialize_i32(28),
8677                Self::ExistingConflictingDatabases => serializer.serialize_i32(29),
8678                Self::ParallelImportInsufficientPrivilege => serializer.serialize_i32(30),
8679                Self::UnknownValue(u) => u.0.serialize(serializer),
8680            }
8681        }
8682    }
8683
8684    impl<'de> serde::de::Deserialize<'de> for ErrorCode {
8685        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8686        where
8687            D: serde::Deserializer<'de>,
8688        {
8689            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
8690                ".google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode",
8691            ))
8692        }
8693    }
8694}
8695
8696/// The PrivateConnection resource is used to establish private connectivity
8697/// with the customer's network.
8698#[derive(Clone, Default, PartialEq)]
8699#[non_exhaustive]
8700pub struct PrivateConnection {
8701    /// The name of the resource.
8702    pub name: std::string::String,
8703
8704    /// Output only. The create time of the resource.
8705    pub create_time: std::option::Option<wkt::Timestamp>,
8706
8707    /// Output only. The last update time of the resource.
8708    pub update_time: std::option::Option<wkt::Timestamp>,
8709
8710    /// The resource labels for private connections to use to annotate any related
8711    /// underlying resources such as Compute Engine VMs. An object containing a
8712    /// list of "key": "value" pairs.
8713    ///
8714    /// Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`.
8715    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8716
8717    /// The private connection display name.
8718    pub display_name: std::string::String,
8719
8720    /// Output only. The state of the private connection.
8721    pub state: crate::model::private_connection::State,
8722
8723    /// Output only. The error details in case of state FAILED.
8724    pub error: std::option::Option<rpc::model::Status>,
8725
8726    pub connectivity: std::option::Option<crate::model::private_connection::Connectivity>,
8727
8728    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8729}
8730
8731impl PrivateConnection {
8732    pub fn new() -> Self {
8733        std::default::Default::default()
8734    }
8735
8736    /// Sets the value of [name][crate::model::PrivateConnection::name].
8737    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8738        self.name = v.into();
8739        self
8740    }
8741
8742    /// Sets the value of [create_time][crate::model::PrivateConnection::create_time].
8743    pub fn set_create_time<T>(mut self, v: T) -> Self
8744    where
8745        T: std::convert::Into<wkt::Timestamp>,
8746    {
8747        self.create_time = std::option::Option::Some(v.into());
8748        self
8749    }
8750
8751    /// Sets or clears the value of [create_time][crate::model::PrivateConnection::create_time].
8752    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8753    where
8754        T: std::convert::Into<wkt::Timestamp>,
8755    {
8756        self.create_time = v.map(|x| x.into());
8757        self
8758    }
8759
8760    /// Sets the value of [update_time][crate::model::PrivateConnection::update_time].
8761    pub fn set_update_time<T>(mut self, v: T) -> Self
8762    where
8763        T: std::convert::Into<wkt::Timestamp>,
8764    {
8765        self.update_time = std::option::Option::Some(v.into());
8766        self
8767    }
8768
8769    /// Sets or clears the value of [update_time][crate::model::PrivateConnection::update_time].
8770    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8771    where
8772        T: std::convert::Into<wkt::Timestamp>,
8773    {
8774        self.update_time = v.map(|x| x.into());
8775        self
8776    }
8777
8778    /// Sets the value of [labels][crate::model::PrivateConnection::labels].
8779    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8780    where
8781        T: std::iter::IntoIterator<Item = (K, V)>,
8782        K: std::convert::Into<std::string::String>,
8783        V: std::convert::Into<std::string::String>,
8784    {
8785        use std::iter::Iterator;
8786        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8787        self
8788    }
8789
8790    /// Sets the value of [display_name][crate::model::PrivateConnection::display_name].
8791    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8792        self.display_name = v.into();
8793        self
8794    }
8795
8796    /// Sets the value of [state][crate::model::PrivateConnection::state].
8797    pub fn set_state<T: std::convert::Into<crate::model::private_connection::State>>(
8798        mut self,
8799        v: T,
8800    ) -> Self {
8801        self.state = v.into();
8802        self
8803    }
8804
8805    /// Sets the value of [error][crate::model::PrivateConnection::error].
8806    pub fn set_error<T>(mut self, v: T) -> Self
8807    where
8808        T: std::convert::Into<rpc::model::Status>,
8809    {
8810        self.error = std::option::Option::Some(v.into());
8811        self
8812    }
8813
8814    /// Sets or clears the value of [error][crate::model::PrivateConnection::error].
8815    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
8816    where
8817        T: std::convert::Into<rpc::model::Status>,
8818    {
8819        self.error = v.map(|x| x.into());
8820        self
8821    }
8822
8823    /// Sets the value of [connectivity][crate::model::PrivateConnection::connectivity].
8824    ///
8825    /// Note that all the setters affecting `connectivity` are mutually
8826    /// exclusive.
8827    pub fn set_connectivity<
8828        T: std::convert::Into<std::option::Option<crate::model::private_connection::Connectivity>>,
8829    >(
8830        mut self,
8831        v: T,
8832    ) -> Self {
8833        self.connectivity = v.into();
8834        self
8835    }
8836
8837    /// The value of [connectivity][crate::model::PrivateConnection::connectivity]
8838    /// if it holds a `VpcPeeringConfig`, `None` if the field is not set or
8839    /// holds a different branch.
8840    pub fn vpc_peering_config(
8841        &self,
8842    ) -> std::option::Option<&std::boxed::Box<crate::model::VpcPeeringConfig>> {
8843        #[allow(unreachable_patterns)]
8844        self.connectivity.as_ref().and_then(|v| match v {
8845            crate::model::private_connection::Connectivity::VpcPeeringConfig(v) => {
8846                std::option::Option::Some(v)
8847            }
8848            _ => std::option::Option::None,
8849        })
8850    }
8851
8852    /// Sets the value of [connectivity][crate::model::PrivateConnection::connectivity]
8853    /// to hold a `VpcPeeringConfig`.
8854    ///
8855    /// Note that all the setters affecting `connectivity` are
8856    /// mutually exclusive.
8857    pub fn set_vpc_peering_config<
8858        T: std::convert::Into<std::boxed::Box<crate::model::VpcPeeringConfig>>,
8859    >(
8860        mut self,
8861        v: T,
8862    ) -> Self {
8863        self.connectivity = std::option::Option::Some(
8864            crate::model::private_connection::Connectivity::VpcPeeringConfig(v.into()),
8865        );
8866        self
8867    }
8868}
8869
8870impl wkt::message::Message for PrivateConnection {
8871    fn typename() -> &'static str {
8872        "type.googleapis.com/google.cloud.clouddms.v1.PrivateConnection"
8873    }
8874}
8875
8876/// Defines additional types related to [PrivateConnection].
8877pub mod private_connection {
8878    #[allow(unused_imports)]
8879    use super::*;
8880
8881    /// Private Connection state.
8882    ///
8883    /// # Working with unknown values
8884    ///
8885    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8886    /// additional enum variants at any time. Adding new variants is not considered
8887    /// a breaking change. Applications should write their code in anticipation of:
8888    ///
8889    /// - New values appearing in future releases of the client library, **and**
8890    /// - New values received dynamically, without application changes.
8891    ///
8892    /// Please consult the [Working with enums] section in the user guide for some
8893    /// guidelines.
8894    ///
8895    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8896    #[derive(Clone, Debug, PartialEq)]
8897    #[non_exhaustive]
8898    pub enum State {
8899        Unspecified,
8900        /// The private connection is in creation state - creating resources.
8901        Creating,
8902        /// The private connection has been created with all of its resources.
8903        Created,
8904        /// The private connection creation has failed.
8905        Failed,
8906        /// The private connection is being deleted.
8907        Deleting,
8908        /// Delete request has failed, resource is in invalid state.
8909        FailedToDelete,
8910        /// The private connection has been deleted.
8911        Deleted,
8912        /// If set, the enum was initialized with an unknown value.
8913        ///
8914        /// Applications can examine the value using [State::value] or
8915        /// [State::name].
8916        UnknownValue(state::UnknownValue),
8917    }
8918
8919    #[doc(hidden)]
8920    pub mod state {
8921        #[allow(unused_imports)]
8922        use super::*;
8923        #[derive(Clone, Debug, PartialEq)]
8924        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8925    }
8926
8927    impl State {
8928        /// Gets the enum value.
8929        ///
8930        /// Returns `None` if the enum contains an unknown value deserialized from
8931        /// the string representation of enums.
8932        pub fn value(&self) -> std::option::Option<i32> {
8933            match self {
8934                Self::Unspecified => std::option::Option::Some(0),
8935                Self::Creating => std::option::Option::Some(1),
8936                Self::Created => std::option::Option::Some(2),
8937                Self::Failed => std::option::Option::Some(3),
8938                Self::Deleting => std::option::Option::Some(4),
8939                Self::FailedToDelete => std::option::Option::Some(5),
8940                Self::Deleted => std::option::Option::Some(6),
8941                Self::UnknownValue(u) => u.0.value(),
8942            }
8943        }
8944
8945        /// Gets the enum value as a string.
8946        ///
8947        /// Returns `None` if the enum contains an unknown value deserialized from
8948        /// the integer representation of enums.
8949        pub fn name(&self) -> std::option::Option<&str> {
8950            match self {
8951                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
8952                Self::Creating => std::option::Option::Some("CREATING"),
8953                Self::Created => std::option::Option::Some("CREATED"),
8954                Self::Failed => std::option::Option::Some("FAILED"),
8955                Self::Deleting => std::option::Option::Some("DELETING"),
8956                Self::FailedToDelete => std::option::Option::Some("FAILED_TO_DELETE"),
8957                Self::Deleted => std::option::Option::Some("DELETED"),
8958                Self::UnknownValue(u) => u.0.name(),
8959            }
8960        }
8961    }
8962
8963    impl std::default::Default for State {
8964        fn default() -> Self {
8965            use std::convert::From;
8966            Self::from(0)
8967        }
8968    }
8969
8970    impl std::fmt::Display for State {
8971        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8972            wkt::internal::display_enum(f, self.name(), self.value())
8973        }
8974    }
8975
8976    impl std::convert::From<i32> for State {
8977        fn from(value: i32) -> Self {
8978            match value {
8979                0 => Self::Unspecified,
8980                1 => Self::Creating,
8981                2 => Self::Created,
8982                3 => Self::Failed,
8983                4 => Self::Deleting,
8984                5 => Self::FailedToDelete,
8985                6 => Self::Deleted,
8986                _ => Self::UnknownValue(state::UnknownValue(
8987                    wkt::internal::UnknownEnumValue::Integer(value),
8988                )),
8989            }
8990        }
8991    }
8992
8993    impl std::convert::From<&str> for State {
8994        fn from(value: &str) -> Self {
8995            use std::string::ToString;
8996            match value {
8997                "STATE_UNSPECIFIED" => Self::Unspecified,
8998                "CREATING" => Self::Creating,
8999                "CREATED" => Self::Created,
9000                "FAILED" => Self::Failed,
9001                "DELETING" => Self::Deleting,
9002                "FAILED_TO_DELETE" => Self::FailedToDelete,
9003                "DELETED" => Self::Deleted,
9004                _ => Self::UnknownValue(state::UnknownValue(
9005                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9006                )),
9007            }
9008        }
9009    }
9010
9011    impl serde::ser::Serialize for State {
9012        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9013        where
9014            S: serde::Serializer,
9015        {
9016            match self {
9017                Self::Unspecified => serializer.serialize_i32(0),
9018                Self::Creating => serializer.serialize_i32(1),
9019                Self::Created => serializer.serialize_i32(2),
9020                Self::Failed => serializer.serialize_i32(3),
9021                Self::Deleting => serializer.serialize_i32(4),
9022                Self::FailedToDelete => serializer.serialize_i32(5),
9023                Self::Deleted => serializer.serialize_i32(6),
9024                Self::UnknownValue(u) => u.0.serialize(serializer),
9025            }
9026        }
9027    }
9028
9029    impl<'de> serde::de::Deserialize<'de> for State {
9030        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9031        where
9032            D: serde::Deserializer<'de>,
9033        {
9034            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9035                ".google.cloud.clouddms.v1.PrivateConnection.State",
9036            ))
9037        }
9038    }
9039
9040    #[derive(Clone, Debug, PartialEq)]
9041    #[non_exhaustive]
9042    pub enum Connectivity {
9043        /// VPC peering configuration.
9044        VpcPeeringConfig(std::boxed::Box<crate::model::VpcPeeringConfig>),
9045    }
9046}
9047
9048/// The VPC peering configuration is used to create VPC peering with the
9049/// consumer's VPC.
9050#[derive(Clone, Default, PartialEq)]
9051#[non_exhaustive]
9052pub struct VpcPeeringConfig {
9053    /// Required. Fully qualified name of the VPC that Database Migration Service
9054    /// will peer to.
9055    pub vpc_name: std::string::String,
9056
9057    /// Required. A free subnet for peering. (CIDR of /29)
9058    pub subnet: std::string::String,
9059
9060    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9061}
9062
9063impl VpcPeeringConfig {
9064    pub fn new() -> Self {
9065        std::default::Default::default()
9066    }
9067
9068    /// Sets the value of [vpc_name][crate::model::VpcPeeringConfig::vpc_name].
9069    pub fn set_vpc_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9070        self.vpc_name = v.into();
9071        self
9072    }
9073
9074    /// Sets the value of [subnet][crate::model::VpcPeeringConfig::subnet].
9075    pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9076        self.subnet = v.into();
9077        self
9078    }
9079}
9080
9081impl wkt::message::Message for VpcPeeringConfig {
9082    fn typename() -> &'static str {
9083        "type.googleapis.com/google.cloud.clouddms.v1.VpcPeeringConfig"
9084    }
9085}
9086
9087/// The type and version of a source or destination database.
9088#[derive(Clone, Default, PartialEq)]
9089#[non_exhaustive]
9090pub struct DatabaseEngineInfo {
9091    /// Required. Engine type.
9092    pub engine: crate::model::DatabaseEngine,
9093
9094    /// Required. Engine named version, for example 12.c.1.
9095    pub version: std::string::String,
9096
9097    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9098}
9099
9100impl DatabaseEngineInfo {
9101    pub fn new() -> Self {
9102        std::default::Default::default()
9103    }
9104
9105    /// Sets the value of [engine][crate::model::DatabaseEngineInfo::engine].
9106    pub fn set_engine<T: std::convert::Into<crate::model::DatabaseEngine>>(mut self, v: T) -> Self {
9107        self.engine = v.into();
9108        self
9109    }
9110
9111    /// Sets the value of [version][crate::model::DatabaseEngineInfo::version].
9112    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9113        self.version = v.into();
9114        self
9115    }
9116}
9117
9118impl wkt::message::Message for DatabaseEngineInfo {
9119    fn typename() -> &'static str {
9120        "type.googleapis.com/google.cloud.clouddms.v1.DatabaseEngineInfo"
9121    }
9122}
9123
9124/// The main conversion workspace resource entity.
9125#[derive(Clone, Default, PartialEq)]
9126#[non_exhaustive]
9127pub struct ConversionWorkspace {
9128    /// Full name of the workspace resource, in the form of:
9129    /// projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.
9130    pub name: std::string::String,
9131
9132    /// Required. The source engine details.
9133    pub source: std::option::Option<crate::model::DatabaseEngineInfo>,
9134
9135    /// Required. The destination engine details.
9136    pub destination: std::option::Option<crate::model::DatabaseEngineInfo>,
9137
9138    /// Optional. A generic list of settings for the workspace.
9139    /// The settings are database pair dependant and can indicate default behavior
9140    /// for the mapping rules engine or turn on or off specific features.
9141    /// Such examples can be: convert_foreign_key_to_interleave=true,
9142    /// skip_triggers=false, ignore_non_table_synonyms=true
9143    pub global_settings: std::collections::HashMap<std::string::String, std::string::String>,
9144
9145    /// Output only. Whether the workspace has uncommitted changes (changes which
9146    /// were made after the workspace was committed).
9147    pub has_uncommitted_changes: bool,
9148
9149    /// Output only. The latest commit ID.
9150    pub latest_commit_id: std::string::String,
9151
9152    /// Output only. The timestamp when the workspace was committed.
9153    pub latest_commit_time: std::option::Option<wkt::Timestamp>,
9154
9155    /// Output only. The timestamp when the workspace resource was created.
9156    pub create_time: std::option::Option<wkt::Timestamp>,
9157
9158    /// Output only. The timestamp when the workspace resource was last updated.
9159    pub update_time: std::option::Option<wkt::Timestamp>,
9160
9161    /// Optional. The display name for the workspace.
9162    pub display_name: std::string::String,
9163
9164    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9165}
9166
9167impl ConversionWorkspace {
9168    pub fn new() -> Self {
9169        std::default::Default::default()
9170    }
9171
9172    /// Sets the value of [name][crate::model::ConversionWorkspace::name].
9173    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9174        self.name = v.into();
9175        self
9176    }
9177
9178    /// Sets the value of [source][crate::model::ConversionWorkspace::source].
9179    pub fn set_source<T>(mut self, v: T) -> Self
9180    where
9181        T: std::convert::Into<crate::model::DatabaseEngineInfo>,
9182    {
9183        self.source = std::option::Option::Some(v.into());
9184        self
9185    }
9186
9187    /// Sets or clears the value of [source][crate::model::ConversionWorkspace::source].
9188    pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
9189    where
9190        T: std::convert::Into<crate::model::DatabaseEngineInfo>,
9191    {
9192        self.source = v.map(|x| x.into());
9193        self
9194    }
9195
9196    /// Sets the value of [destination][crate::model::ConversionWorkspace::destination].
9197    pub fn set_destination<T>(mut self, v: T) -> Self
9198    where
9199        T: std::convert::Into<crate::model::DatabaseEngineInfo>,
9200    {
9201        self.destination = std::option::Option::Some(v.into());
9202        self
9203    }
9204
9205    /// Sets or clears the value of [destination][crate::model::ConversionWorkspace::destination].
9206    pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
9207    where
9208        T: std::convert::Into<crate::model::DatabaseEngineInfo>,
9209    {
9210        self.destination = v.map(|x| x.into());
9211        self
9212    }
9213
9214    /// Sets the value of [global_settings][crate::model::ConversionWorkspace::global_settings].
9215    pub fn set_global_settings<T, K, V>(mut self, v: T) -> Self
9216    where
9217        T: std::iter::IntoIterator<Item = (K, V)>,
9218        K: std::convert::Into<std::string::String>,
9219        V: std::convert::Into<std::string::String>,
9220    {
9221        use std::iter::Iterator;
9222        self.global_settings = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9223        self
9224    }
9225
9226    /// Sets the value of [has_uncommitted_changes][crate::model::ConversionWorkspace::has_uncommitted_changes].
9227    pub fn set_has_uncommitted_changes<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9228        self.has_uncommitted_changes = v.into();
9229        self
9230    }
9231
9232    /// Sets the value of [latest_commit_id][crate::model::ConversionWorkspace::latest_commit_id].
9233    pub fn set_latest_commit_id<T: std::convert::Into<std::string::String>>(
9234        mut self,
9235        v: T,
9236    ) -> Self {
9237        self.latest_commit_id = v.into();
9238        self
9239    }
9240
9241    /// Sets the value of [latest_commit_time][crate::model::ConversionWorkspace::latest_commit_time].
9242    pub fn set_latest_commit_time<T>(mut self, v: T) -> Self
9243    where
9244        T: std::convert::Into<wkt::Timestamp>,
9245    {
9246        self.latest_commit_time = std::option::Option::Some(v.into());
9247        self
9248    }
9249
9250    /// Sets or clears the value of [latest_commit_time][crate::model::ConversionWorkspace::latest_commit_time].
9251    pub fn set_or_clear_latest_commit_time<T>(mut self, v: std::option::Option<T>) -> Self
9252    where
9253        T: std::convert::Into<wkt::Timestamp>,
9254    {
9255        self.latest_commit_time = v.map(|x| x.into());
9256        self
9257    }
9258
9259    /// Sets the value of [create_time][crate::model::ConversionWorkspace::create_time].
9260    pub fn set_create_time<T>(mut self, v: T) -> Self
9261    where
9262        T: std::convert::Into<wkt::Timestamp>,
9263    {
9264        self.create_time = std::option::Option::Some(v.into());
9265        self
9266    }
9267
9268    /// Sets or clears the value of [create_time][crate::model::ConversionWorkspace::create_time].
9269    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9270    where
9271        T: std::convert::Into<wkt::Timestamp>,
9272    {
9273        self.create_time = v.map(|x| x.into());
9274        self
9275    }
9276
9277    /// Sets the value of [update_time][crate::model::ConversionWorkspace::update_time].
9278    pub fn set_update_time<T>(mut self, v: T) -> Self
9279    where
9280        T: std::convert::Into<wkt::Timestamp>,
9281    {
9282        self.update_time = std::option::Option::Some(v.into());
9283        self
9284    }
9285
9286    /// Sets or clears the value of [update_time][crate::model::ConversionWorkspace::update_time].
9287    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9288    where
9289        T: std::convert::Into<wkt::Timestamp>,
9290    {
9291        self.update_time = v.map(|x| x.into());
9292        self
9293    }
9294
9295    /// Sets the value of [display_name][crate::model::ConversionWorkspace::display_name].
9296    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9297        self.display_name = v.into();
9298        self
9299    }
9300}
9301
9302impl wkt::message::Message for ConversionWorkspace {
9303    fn typename() -> &'static str {
9304        "type.googleapis.com/google.cloud.clouddms.v1.ConversionWorkspace"
9305    }
9306}
9307
9308/// Execution log of a background job.
9309#[derive(Clone, Default, PartialEq)]
9310#[non_exhaustive]
9311pub struct BackgroundJobLogEntry {
9312    /// The background job log entry ID.
9313    pub id: std::string::String,
9314
9315    /// The type of job that was executed.
9316    pub job_type: crate::model::BackgroundJobType,
9317
9318    /// The timestamp when the background job was started.
9319    pub start_time: std::option::Option<wkt::Timestamp>,
9320
9321    /// The timestamp when the background job was finished.
9322    pub finish_time: std::option::Option<wkt::Timestamp>,
9323
9324    /// Output only. Job completion state, i.e. the final state after the job
9325    /// completed.
9326    pub completion_state: crate::model::background_job_log_entry::JobCompletionState,
9327
9328    /// Output only. Job completion comment, such as how many entities were seeded,
9329    /// how many warnings were found during conversion, and similar information.
9330    pub completion_comment: std::string::String,
9331
9332    /// Output only. Whether the client requested the conversion workspace to be
9333    /// committed after a successful completion of the job.
9334    pub request_autocommit: bool,
9335
9336    pub job_details: std::option::Option<crate::model::background_job_log_entry::JobDetails>,
9337
9338    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9339}
9340
9341impl BackgroundJobLogEntry {
9342    pub fn new() -> Self {
9343        std::default::Default::default()
9344    }
9345
9346    /// Sets the value of [id][crate::model::BackgroundJobLogEntry::id].
9347    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9348        self.id = v.into();
9349        self
9350    }
9351
9352    /// Sets the value of [job_type][crate::model::BackgroundJobLogEntry::job_type].
9353    pub fn set_job_type<T: std::convert::Into<crate::model::BackgroundJobType>>(
9354        mut self,
9355        v: T,
9356    ) -> Self {
9357        self.job_type = v.into();
9358        self
9359    }
9360
9361    /// Sets the value of [start_time][crate::model::BackgroundJobLogEntry::start_time].
9362    pub fn set_start_time<T>(mut self, v: T) -> Self
9363    where
9364        T: std::convert::Into<wkt::Timestamp>,
9365    {
9366        self.start_time = std::option::Option::Some(v.into());
9367        self
9368    }
9369
9370    /// Sets or clears the value of [start_time][crate::model::BackgroundJobLogEntry::start_time].
9371    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
9372    where
9373        T: std::convert::Into<wkt::Timestamp>,
9374    {
9375        self.start_time = v.map(|x| x.into());
9376        self
9377    }
9378
9379    /// Sets the value of [finish_time][crate::model::BackgroundJobLogEntry::finish_time].
9380    pub fn set_finish_time<T>(mut self, v: T) -> Self
9381    where
9382        T: std::convert::Into<wkt::Timestamp>,
9383    {
9384        self.finish_time = std::option::Option::Some(v.into());
9385        self
9386    }
9387
9388    /// Sets or clears the value of [finish_time][crate::model::BackgroundJobLogEntry::finish_time].
9389    pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
9390    where
9391        T: std::convert::Into<wkt::Timestamp>,
9392    {
9393        self.finish_time = v.map(|x| x.into());
9394        self
9395    }
9396
9397    /// Sets the value of [completion_state][crate::model::BackgroundJobLogEntry::completion_state].
9398    pub fn set_completion_state<
9399        T: std::convert::Into<crate::model::background_job_log_entry::JobCompletionState>,
9400    >(
9401        mut self,
9402        v: T,
9403    ) -> Self {
9404        self.completion_state = v.into();
9405        self
9406    }
9407
9408    /// Sets the value of [completion_comment][crate::model::BackgroundJobLogEntry::completion_comment].
9409    pub fn set_completion_comment<T: std::convert::Into<std::string::String>>(
9410        mut self,
9411        v: T,
9412    ) -> Self {
9413        self.completion_comment = v.into();
9414        self
9415    }
9416
9417    /// Sets the value of [request_autocommit][crate::model::BackgroundJobLogEntry::request_autocommit].
9418    pub fn set_request_autocommit<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9419        self.request_autocommit = v.into();
9420        self
9421    }
9422
9423    /// Sets the value of [job_details][crate::model::BackgroundJobLogEntry::job_details].
9424    ///
9425    /// Note that all the setters affecting `job_details` are mutually
9426    /// exclusive.
9427    pub fn set_job_details<
9428        T: std::convert::Into<std::option::Option<crate::model::background_job_log_entry::JobDetails>>,
9429    >(
9430        mut self,
9431        v: T,
9432    ) -> Self {
9433        self.job_details = v.into();
9434        self
9435    }
9436
9437    /// The value of [job_details][crate::model::BackgroundJobLogEntry::job_details]
9438    /// if it holds a `SeedJobDetails`, `None` if the field is not set or
9439    /// holds a different branch.
9440    pub fn seed_job_details(
9441        &self,
9442    ) -> std::option::Option<&std::boxed::Box<crate::model::background_job_log_entry::SeedJobDetails>>
9443    {
9444        #[allow(unreachable_patterns)]
9445        self.job_details.as_ref().and_then(|v| match v {
9446            crate::model::background_job_log_entry::JobDetails::SeedJobDetails(v) => {
9447                std::option::Option::Some(v)
9448            }
9449            _ => std::option::Option::None,
9450        })
9451    }
9452
9453    /// Sets the value of [job_details][crate::model::BackgroundJobLogEntry::job_details]
9454    /// to hold a `SeedJobDetails`.
9455    ///
9456    /// Note that all the setters affecting `job_details` are
9457    /// mutually exclusive.
9458    pub fn set_seed_job_details<
9459        T: std::convert::Into<std::boxed::Box<crate::model::background_job_log_entry::SeedJobDetails>>,
9460    >(
9461        mut self,
9462        v: T,
9463    ) -> Self {
9464        self.job_details = std::option::Option::Some(
9465            crate::model::background_job_log_entry::JobDetails::SeedJobDetails(v.into()),
9466        );
9467        self
9468    }
9469
9470    /// The value of [job_details][crate::model::BackgroundJobLogEntry::job_details]
9471    /// if it holds a `ImportRulesJobDetails`, `None` if the field is not set or
9472    /// holds a different branch.
9473    pub fn import_rules_job_details(
9474        &self,
9475    ) -> std::option::Option<
9476        &std::boxed::Box<crate::model::background_job_log_entry::ImportRulesJobDetails>,
9477    > {
9478        #[allow(unreachable_patterns)]
9479        self.job_details.as_ref().and_then(|v| match v {
9480            crate::model::background_job_log_entry::JobDetails::ImportRulesJobDetails(v) => {
9481                std::option::Option::Some(v)
9482            }
9483            _ => std::option::Option::None,
9484        })
9485    }
9486
9487    /// Sets the value of [job_details][crate::model::BackgroundJobLogEntry::job_details]
9488    /// to hold a `ImportRulesJobDetails`.
9489    ///
9490    /// Note that all the setters affecting `job_details` are
9491    /// mutually exclusive.
9492    pub fn set_import_rules_job_details<
9493        T: std::convert::Into<
9494                std::boxed::Box<crate::model::background_job_log_entry::ImportRulesJobDetails>,
9495            >,
9496    >(
9497        mut self,
9498        v: T,
9499    ) -> Self {
9500        self.job_details = std::option::Option::Some(
9501            crate::model::background_job_log_entry::JobDetails::ImportRulesJobDetails(v.into()),
9502        );
9503        self
9504    }
9505
9506    /// The value of [job_details][crate::model::BackgroundJobLogEntry::job_details]
9507    /// if it holds a `ConvertJobDetails`, `None` if the field is not set or
9508    /// holds a different branch.
9509    pub fn convert_job_details(
9510        &self,
9511    ) -> std::option::Option<
9512        &std::boxed::Box<crate::model::background_job_log_entry::ConvertJobDetails>,
9513    > {
9514        #[allow(unreachable_patterns)]
9515        self.job_details.as_ref().and_then(|v| match v {
9516            crate::model::background_job_log_entry::JobDetails::ConvertJobDetails(v) => {
9517                std::option::Option::Some(v)
9518            }
9519            _ => std::option::Option::None,
9520        })
9521    }
9522
9523    /// Sets the value of [job_details][crate::model::BackgroundJobLogEntry::job_details]
9524    /// to hold a `ConvertJobDetails`.
9525    ///
9526    /// Note that all the setters affecting `job_details` are
9527    /// mutually exclusive.
9528    pub fn set_convert_job_details<
9529        T: std::convert::Into<
9530                std::boxed::Box<crate::model::background_job_log_entry::ConvertJobDetails>,
9531            >,
9532    >(
9533        mut self,
9534        v: T,
9535    ) -> Self {
9536        self.job_details = std::option::Option::Some(
9537            crate::model::background_job_log_entry::JobDetails::ConvertJobDetails(v.into()),
9538        );
9539        self
9540    }
9541
9542    /// The value of [job_details][crate::model::BackgroundJobLogEntry::job_details]
9543    /// if it holds a `ApplyJobDetails`, `None` if the field is not set or
9544    /// holds a different branch.
9545    pub fn apply_job_details(
9546        &self,
9547    ) -> std::option::Option<
9548        &std::boxed::Box<crate::model::background_job_log_entry::ApplyJobDetails>,
9549    > {
9550        #[allow(unreachable_patterns)]
9551        self.job_details.as_ref().and_then(|v| match v {
9552            crate::model::background_job_log_entry::JobDetails::ApplyJobDetails(v) => {
9553                std::option::Option::Some(v)
9554            }
9555            _ => std::option::Option::None,
9556        })
9557    }
9558
9559    /// Sets the value of [job_details][crate::model::BackgroundJobLogEntry::job_details]
9560    /// to hold a `ApplyJobDetails`.
9561    ///
9562    /// Note that all the setters affecting `job_details` are
9563    /// mutually exclusive.
9564    pub fn set_apply_job_details<
9565        T: std::convert::Into<
9566                std::boxed::Box<crate::model::background_job_log_entry::ApplyJobDetails>,
9567            >,
9568    >(
9569        mut self,
9570        v: T,
9571    ) -> Self {
9572        self.job_details = std::option::Option::Some(
9573            crate::model::background_job_log_entry::JobDetails::ApplyJobDetails(v.into()),
9574        );
9575        self
9576    }
9577}
9578
9579impl wkt::message::Message for BackgroundJobLogEntry {
9580    fn typename() -> &'static str {
9581        "type.googleapis.com/google.cloud.clouddms.v1.BackgroundJobLogEntry"
9582    }
9583}
9584
9585/// Defines additional types related to [BackgroundJobLogEntry].
9586pub mod background_job_log_entry {
9587    #[allow(unused_imports)]
9588    use super::*;
9589
9590    /// Details regarding a Seed background job.
9591    #[derive(Clone, Default, PartialEq)]
9592    #[non_exhaustive]
9593    pub struct SeedJobDetails {
9594        /// Output only. The connection profile which was used for the seed job.
9595        pub connection_profile: std::string::String,
9596
9597        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9598    }
9599
9600    impl SeedJobDetails {
9601        pub fn new() -> Self {
9602            std::default::Default::default()
9603        }
9604
9605        /// Sets the value of [connection_profile][crate::model::background_job_log_entry::SeedJobDetails::connection_profile].
9606        pub fn set_connection_profile<T: std::convert::Into<std::string::String>>(
9607            mut self,
9608            v: T,
9609        ) -> Self {
9610            self.connection_profile = v.into();
9611            self
9612        }
9613    }
9614
9615    impl wkt::message::Message for SeedJobDetails {
9616        fn typename() -> &'static str {
9617            "type.googleapis.com/google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails"
9618        }
9619    }
9620
9621    /// Details regarding an Import Rules background job.
9622    #[derive(Clone, Default, PartialEq)]
9623    #[non_exhaustive]
9624    pub struct ImportRulesJobDetails {
9625        /// Output only. File names used for the import rules job.
9626        pub files: std::vec::Vec<std::string::String>,
9627
9628        /// Output only. The requested file format.
9629        pub file_format: crate::model::ImportRulesFileFormat,
9630
9631        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9632    }
9633
9634    impl ImportRulesJobDetails {
9635        pub fn new() -> Self {
9636            std::default::Default::default()
9637        }
9638
9639        /// Sets the value of [files][crate::model::background_job_log_entry::ImportRulesJobDetails::files].
9640        pub fn set_files<T, V>(mut self, v: T) -> Self
9641        where
9642            T: std::iter::IntoIterator<Item = V>,
9643            V: std::convert::Into<std::string::String>,
9644        {
9645            use std::iter::Iterator;
9646            self.files = v.into_iter().map(|i| i.into()).collect();
9647            self
9648        }
9649
9650        /// Sets the value of [file_format][crate::model::background_job_log_entry::ImportRulesJobDetails::file_format].
9651        pub fn set_file_format<T: std::convert::Into<crate::model::ImportRulesFileFormat>>(
9652            mut self,
9653            v: T,
9654        ) -> Self {
9655            self.file_format = v.into();
9656            self
9657        }
9658    }
9659
9660    impl wkt::message::Message for ImportRulesJobDetails {
9661        fn typename() -> &'static str {
9662            "type.googleapis.com/google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails"
9663        }
9664    }
9665
9666    /// Details regarding a Convert background job.
9667    #[derive(Clone, Default, PartialEq)]
9668    #[non_exhaustive]
9669    pub struct ConvertJobDetails {
9670        /// Output only. AIP-160 based filter used to specify the entities to convert
9671        pub filter: std::string::String,
9672
9673        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9674    }
9675
9676    impl ConvertJobDetails {
9677        pub fn new() -> Self {
9678            std::default::Default::default()
9679        }
9680
9681        /// Sets the value of [filter][crate::model::background_job_log_entry::ConvertJobDetails::filter].
9682        pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9683            self.filter = v.into();
9684            self
9685        }
9686    }
9687
9688    impl wkt::message::Message for ConvertJobDetails {
9689        fn typename() -> &'static str {
9690            "type.googleapis.com/google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails"
9691        }
9692    }
9693
9694    /// Details regarding an Apply background job.
9695    #[derive(Clone, Default, PartialEq)]
9696    #[non_exhaustive]
9697    pub struct ApplyJobDetails {
9698        /// Output only. The connection profile which was used for the apply job.
9699        pub connection_profile: std::string::String,
9700
9701        /// Output only. AIP-160 based filter used to specify the entities to apply
9702        pub filter: std::string::String,
9703
9704        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9705    }
9706
9707    impl ApplyJobDetails {
9708        pub fn new() -> Self {
9709            std::default::Default::default()
9710        }
9711
9712        /// Sets the value of [connection_profile][crate::model::background_job_log_entry::ApplyJobDetails::connection_profile].
9713        pub fn set_connection_profile<T: std::convert::Into<std::string::String>>(
9714            mut self,
9715            v: T,
9716        ) -> Self {
9717            self.connection_profile = v.into();
9718            self
9719        }
9720
9721        /// Sets the value of [filter][crate::model::background_job_log_entry::ApplyJobDetails::filter].
9722        pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9723            self.filter = v.into();
9724            self
9725        }
9726    }
9727
9728    impl wkt::message::Message for ApplyJobDetails {
9729        fn typename() -> &'static str {
9730            "type.googleapis.com/google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails"
9731        }
9732    }
9733
9734    /// Final state after a job completes.
9735    ///
9736    /// # Working with unknown values
9737    ///
9738    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9739    /// additional enum variants at any time. Adding new variants is not considered
9740    /// a breaking change. Applications should write their code in anticipation of:
9741    ///
9742    /// - New values appearing in future releases of the client library, **and**
9743    /// - New values received dynamically, without application changes.
9744    ///
9745    /// Please consult the [Working with enums] section in the user guide for some
9746    /// guidelines.
9747    ///
9748    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9749    #[derive(Clone, Debug, PartialEq)]
9750    #[non_exhaustive]
9751    pub enum JobCompletionState {
9752        /// The status is not specified. This state is used when job is not yet
9753        /// finished.
9754        Unspecified,
9755        /// Success.
9756        Succeeded,
9757        /// Error.
9758        Failed,
9759        /// If set, the enum was initialized with an unknown value.
9760        ///
9761        /// Applications can examine the value using [JobCompletionState::value] or
9762        /// [JobCompletionState::name].
9763        UnknownValue(job_completion_state::UnknownValue),
9764    }
9765
9766    #[doc(hidden)]
9767    pub mod job_completion_state {
9768        #[allow(unused_imports)]
9769        use super::*;
9770        #[derive(Clone, Debug, PartialEq)]
9771        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9772    }
9773
9774    impl JobCompletionState {
9775        /// Gets the enum value.
9776        ///
9777        /// Returns `None` if the enum contains an unknown value deserialized from
9778        /// the string representation of enums.
9779        pub fn value(&self) -> std::option::Option<i32> {
9780            match self {
9781                Self::Unspecified => std::option::Option::Some(0),
9782                Self::Succeeded => std::option::Option::Some(1),
9783                Self::Failed => std::option::Option::Some(2),
9784                Self::UnknownValue(u) => u.0.value(),
9785            }
9786        }
9787
9788        /// Gets the enum value as a string.
9789        ///
9790        /// Returns `None` if the enum contains an unknown value deserialized from
9791        /// the integer representation of enums.
9792        pub fn name(&self) -> std::option::Option<&str> {
9793            match self {
9794                Self::Unspecified => std::option::Option::Some("JOB_COMPLETION_STATE_UNSPECIFIED"),
9795                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
9796                Self::Failed => std::option::Option::Some("FAILED"),
9797                Self::UnknownValue(u) => u.0.name(),
9798            }
9799        }
9800    }
9801
9802    impl std::default::Default for JobCompletionState {
9803        fn default() -> Self {
9804            use std::convert::From;
9805            Self::from(0)
9806        }
9807    }
9808
9809    impl std::fmt::Display for JobCompletionState {
9810        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9811            wkt::internal::display_enum(f, self.name(), self.value())
9812        }
9813    }
9814
9815    impl std::convert::From<i32> for JobCompletionState {
9816        fn from(value: i32) -> Self {
9817            match value {
9818                0 => Self::Unspecified,
9819                1 => Self::Succeeded,
9820                2 => Self::Failed,
9821                _ => Self::UnknownValue(job_completion_state::UnknownValue(
9822                    wkt::internal::UnknownEnumValue::Integer(value),
9823                )),
9824            }
9825        }
9826    }
9827
9828    impl std::convert::From<&str> for JobCompletionState {
9829        fn from(value: &str) -> Self {
9830            use std::string::ToString;
9831            match value {
9832                "JOB_COMPLETION_STATE_UNSPECIFIED" => Self::Unspecified,
9833                "SUCCEEDED" => Self::Succeeded,
9834                "FAILED" => Self::Failed,
9835                _ => Self::UnknownValue(job_completion_state::UnknownValue(
9836                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9837                )),
9838            }
9839        }
9840    }
9841
9842    impl serde::ser::Serialize for JobCompletionState {
9843        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9844        where
9845            S: serde::Serializer,
9846        {
9847            match self {
9848                Self::Unspecified => serializer.serialize_i32(0),
9849                Self::Succeeded => serializer.serialize_i32(1),
9850                Self::Failed => serializer.serialize_i32(2),
9851                Self::UnknownValue(u) => u.0.serialize(serializer),
9852            }
9853        }
9854    }
9855
9856    impl<'de> serde::de::Deserialize<'de> for JobCompletionState {
9857        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9858        where
9859            D: serde::Deserializer<'de>,
9860        {
9861            deserializer.deserialize_any(wkt::internal::EnumVisitor::<JobCompletionState>::new(
9862                ".google.cloud.clouddms.v1.BackgroundJobLogEntry.JobCompletionState",
9863            ))
9864        }
9865    }
9866
9867    #[derive(Clone, Debug, PartialEq)]
9868    #[non_exhaustive]
9869    pub enum JobDetails {
9870        /// Output only. Seed job details.
9871        SeedJobDetails(std::boxed::Box<crate::model::background_job_log_entry::SeedJobDetails>),
9872        /// Output only. Import rules job details.
9873        ImportRulesJobDetails(
9874            std::boxed::Box<crate::model::background_job_log_entry::ImportRulesJobDetails>,
9875        ),
9876        /// Output only. Convert job details.
9877        ConvertJobDetails(
9878            std::boxed::Box<crate::model::background_job_log_entry::ConvertJobDetails>,
9879        ),
9880        /// Output only. Apply job details.
9881        ApplyJobDetails(std::boxed::Box<crate::model::background_job_log_entry::ApplyJobDetails>),
9882    }
9883}
9884
9885/// A filter defining the entities that a mapping rule should be applied to.
9886/// When more than one field is specified, the rule is applied only to
9887/// entities which match all the fields.
9888#[derive(Clone, Default, PartialEq)]
9889#[non_exhaustive]
9890pub struct MappingRuleFilter {
9891    /// Optional. The rule should be applied to entities whose parent entity
9892    /// (fully qualified name) matches the given value.
9893    /// For example, if the rule applies to a table entity, the expected value
9894    /// should be a schema (schema). If the rule applies to a column or index
9895    /// entity, the expected value can be either a schema (schema) or a table
9896    /// (schema.table)
9897    pub parent_entity: std::string::String,
9898
9899    /// Optional. The rule should be applied to entities whose non-qualified name
9900    /// starts with the given prefix.
9901    pub entity_name_prefix: std::string::String,
9902
9903    /// Optional. The rule should be applied to entities whose non-qualified name
9904    /// ends with the given suffix.
9905    pub entity_name_suffix: std::string::String,
9906
9907    /// Optional. The rule should be applied to entities whose non-qualified name
9908    /// contains the given string.
9909    pub entity_name_contains: std::string::String,
9910
9911    /// Optional. The rule should be applied to specific entities defined by their
9912    /// fully qualified names.
9913    pub entities: std::vec::Vec<std::string::String>,
9914
9915    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9916}
9917
9918impl MappingRuleFilter {
9919    pub fn new() -> Self {
9920        std::default::Default::default()
9921    }
9922
9923    /// Sets the value of [parent_entity][crate::model::MappingRuleFilter::parent_entity].
9924    pub fn set_parent_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9925        self.parent_entity = v.into();
9926        self
9927    }
9928
9929    /// Sets the value of [entity_name_prefix][crate::model::MappingRuleFilter::entity_name_prefix].
9930    pub fn set_entity_name_prefix<T: std::convert::Into<std::string::String>>(
9931        mut self,
9932        v: T,
9933    ) -> Self {
9934        self.entity_name_prefix = v.into();
9935        self
9936    }
9937
9938    /// Sets the value of [entity_name_suffix][crate::model::MappingRuleFilter::entity_name_suffix].
9939    pub fn set_entity_name_suffix<T: std::convert::Into<std::string::String>>(
9940        mut self,
9941        v: T,
9942    ) -> Self {
9943        self.entity_name_suffix = v.into();
9944        self
9945    }
9946
9947    /// Sets the value of [entity_name_contains][crate::model::MappingRuleFilter::entity_name_contains].
9948    pub fn set_entity_name_contains<T: std::convert::Into<std::string::String>>(
9949        mut self,
9950        v: T,
9951    ) -> Self {
9952        self.entity_name_contains = v.into();
9953        self
9954    }
9955
9956    /// Sets the value of [entities][crate::model::MappingRuleFilter::entities].
9957    pub fn set_entities<T, V>(mut self, v: T) -> Self
9958    where
9959        T: std::iter::IntoIterator<Item = V>,
9960        V: std::convert::Into<std::string::String>,
9961    {
9962        use std::iter::Iterator;
9963        self.entities = v.into_iter().map(|i| i.into()).collect();
9964        self
9965    }
9966}
9967
9968impl wkt::message::Message for MappingRuleFilter {
9969    fn typename() -> &'static str {
9970        "type.googleapis.com/google.cloud.clouddms.v1.MappingRuleFilter"
9971    }
9972}
9973
9974/// Definition of a transformation that is to be applied to a group of entities
9975/// in the source schema. Several such transformations can be applied to an
9976/// entity sequentially to define the corresponding entity in the target schema.
9977#[derive(Clone, Default, PartialEq)]
9978#[non_exhaustive]
9979pub struct MappingRule {
9980    /// Full name of the mapping rule resource, in the form of:
9981    /// projects/{project}/locations/{location}/conversionWorkspaces/{set}/mappingRule/{rule}.
9982    pub name: std::string::String,
9983
9984    /// Optional. A human readable name
9985    pub display_name: std::string::String,
9986
9987    /// Optional. The mapping rule state
9988    pub state: crate::model::mapping_rule::State,
9989
9990    /// Required. The rule scope
9991    pub rule_scope: crate::model::DatabaseEntityType,
9992
9993    /// Required. The rule filter
9994    pub filter: std::option::Option<crate::model::MappingRuleFilter>,
9995
9996    /// Required. The order in which the rule is applied. Lower order rules are
9997    /// applied before higher value rules so they may end up being overridden.
9998    pub rule_order: i64,
9999
10000    /// Output only. The revision ID of the mapping rule.
10001    /// A new revision is committed whenever the mapping rule is changed in any
10002    /// way. The format is an 8-character hexadecimal string.
10003    pub revision_id: std::string::String,
10004
10005    /// Output only. The timestamp that the revision was created.
10006    pub revision_create_time: std::option::Option<wkt::Timestamp>,
10007
10008    /// The rule specific details.
10009    pub details: std::option::Option<crate::model::mapping_rule::Details>,
10010
10011    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10012}
10013
10014impl MappingRule {
10015    pub fn new() -> Self {
10016        std::default::Default::default()
10017    }
10018
10019    /// Sets the value of [name][crate::model::MappingRule::name].
10020    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10021        self.name = v.into();
10022        self
10023    }
10024
10025    /// Sets the value of [display_name][crate::model::MappingRule::display_name].
10026    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10027        self.display_name = v.into();
10028        self
10029    }
10030
10031    /// Sets the value of [state][crate::model::MappingRule::state].
10032    pub fn set_state<T: std::convert::Into<crate::model::mapping_rule::State>>(
10033        mut self,
10034        v: T,
10035    ) -> Self {
10036        self.state = v.into();
10037        self
10038    }
10039
10040    /// Sets the value of [rule_scope][crate::model::MappingRule::rule_scope].
10041    pub fn set_rule_scope<T: std::convert::Into<crate::model::DatabaseEntityType>>(
10042        mut self,
10043        v: T,
10044    ) -> Self {
10045        self.rule_scope = v.into();
10046        self
10047    }
10048
10049    /// Sets the value of [filter][crate::model::MappingRule::filter].
10050    pub fn set_filter<T>(mut self, v: T) -> Self
10051    where
10052        T: std::convert::Into<crate::model::MappingRuleFilter>,
10053    {
10054        self.filter = std::option::Option::Some(v.into());
10055        self
10056    }
10057
10058    /// Sets or clears the value of [filter][crate::model::MappingRule::filter].
10059    pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
10060    where
10061        T: std::convert::Into<crate::model::MappingRuleFilter>,
10062    {
10063        self.filter = v.map(|x| x.into());
10064        self
10065    }
10066
10067    /// Sets the value of [rule_order][crate::model::MappingRule::rule_order].
10068    pub fn set_rule_order<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10069        self.rule_order = v.into();
10070        self
10071    }
10072
10073    /// Sets the value of [revision_id][crate::model::MappingRule::revision_id].
10074    pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10075        self.revision_id = v.into();
10076        self
10077    }
10078
10079    /// Sets the value of [revision_create_time][crate::model::MappingRule::revision_create_time].
10080    pub fn set_revision_create_time<T>(mut self, v: T) -> Self
10081    where
10082        T: std::convert::Into<wkt::Timestamp>,
10083    {
10084        self.revision_create_time = std::option::Option::Some(v.into());
10085        self
10086    }
10087
10088    /// Sets or clears the value of [revision_create_time][crate::model::MappingRule::revision_create_time].
10089    pub fn set_or_clear_revision_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10090    where
10091        T: std::convert::Into<wkt::Timestamp>,
10092    {
10093        self.revision_create_time = v.map(|x| x.into());
10094        self
10095    }
10096
10097    /// Sets the value of [details][crate::model::MappingRule::details].
10098    ///
10099    /// Note that all the setters affecting `details` are mutually
10100    /// exclusive.
10101    pub fn set_details<
10102        T: std::convert::Into<std::option::Option<crate::model::mapping_rule::Details>>,
10103    >(
10104        mut self,
10105        v: T,
10106    ) -> Self {
10107        self.details = v.into();
10108        self
10109    }
10110
10111    /// The value of [details][crate::model::MappingRule::details]
10112    /// if it holds a `SingleEntityRename`, `None` if the field is not set or
10113    /// holds a different branch.
10114    pub fn single_entity_rename(
10115        &self,
10116    ) -> std::option::Option<&std::boxed::Box<crate::model::SingleEntityRename>> {
10117        #[allow(unreachable_patterns)]
10118        self.details.as_ref().and_then(|v| match v {
10119            crate::model::mapping_rule::Details::SingleEntityRename(v) => {
10120                std::option::Option::Some(v)
10121            }
10122            _ => std::option::Option::None,
10123        })
10124    }
10125
10126    /// Sets the value of [details][crate::model::MappingRule::details]
10127    /// to hold a `SingleEntityRename`.
10128    ///
10129    /// Note that all the setters affecting `details` are
10130    /// mutually exclusive.
10131    pub fn set_single_entity_rename<
10132        T: std::convert::Into<std::boxed::Box<crate::model::SingleEntityRename>>,
10133    >(
10134        mut self,
10135        v: T,
10136    ) -> Self {
10137        self.details = std::option::Option::Some(
10138            crate::model::mapping_rule::Details::SingleEntityRename(v.into()),
10139        );
10140        self
10141    }
10142
10143    /// The value of [details][crate::model::MappingRule::details]
10144    /// if it holds a `MultiEntityRename`, `None` if the field is not set or
10145    /// holds a different branch.
10146    pub fn multi_entity_rename(
10147        &self,
10148    ) -> std::option::Option<&std::boxed::Box<crate::model::MultiEntityRename>> {
10149        #[allow(unreachable_patterns)]
10150        self.details.as_ref().and_then(|v| match v {
10151            crate::model::mapping_rule::Details::MultiEntityRename(v) => {
10152                std::option::Option::Some(v)
10153            }
10154            _ => std::option::Option::None,
10155        })
10156    }
10157
10158    /// Sets the value of [details][crate::model::MappingRule::details]
10159    /// to hold a `MultiEntityRename`.
10160    ///
10161    /// Note that all the setters affecting `details` are
10162    /// mutually exclusive.
10163    pub fn set_multi_entity_rename<
10164        T: std::convert::Into<std::boxed::Box<crate::model::MultiEntityRename>>,
10165    >(
10166        mut self,
10167        v: T,
10168    ) -> Self {
10169        self.details = std::option::Option::Some(
10170            crate::model::mapping_rule::Details::MultiEntityRename(v.into()),
10171        );
10172        self
10173    }
10174
10175    /// The value of [details][crate::model::MappingRule::details]
10176    /// if it holds a `EntityMove`, `None` if the field is not set or
10177    /// holds a different branch.
10178    pub fn entity_move(&self) -> std::option::Option<&std::boxed::Box<crate::model::EntityMove>> {
10179        #[allow(unreachable_patterns)]
10180        self.details.as_ref().and_then(|v| match v {
10181            crate::model::mapping_rule::Details::EntityMove(v) => std::option::Option::Some(v),
10182            _ => std::option::Option::None,
10183        })
10184    }
10185
10186    /// Sets the value of [details][crate::model::MappingRule::details]
10187    /// to hold a `EntityMove`.
10188    ///
10189    /// Note that all the setters affecting `details` are
10190    /// mutually exclusive.
10191    pub fn set_entity_move<T: std::convert::Into<std::boxed::Box<crate::model::EntityMove>>>(
10192        mut self,
10193        v: T,
10194    ) -> Self {
10195        self.details =
10196            std::option::Option::Some(crate::model::mapping_rule::Details::EntityMove(v.into()));
10197        self
10198    }
10199
10200    /// The value of [details][crate::model::MappingRule::details]
10201    /// if it holds a `SingleColumnChange`, `None` if the field is not set or
10202    /// holds a different branch.
10203    pub fn single_column_change(
10204        &self,
10205    ) -> std::option::Option<&std::boxed::Box<crate::model::SingleColumnChange>> {
10206        #[allow(unreachable_patterns)]
10207        self.details.as_ref().and_then(|v| match v {
10208            crate::model::mapping_rule::Details::SingleColumnChange(v) => {
10209                std::option::Option::Some(v)
10210            }
10211            _ => std::option::Option::None,
10212        })
10213    }
10214
10215    /// Sets the value of [details][crate::model::MappingRule::details]
10216    /// to hold a `SingleColumnChange`.
10217    ///
10218    /// Note that all the setters affecting `details` are
10219    /// mutually exclusive.
10220    pub fn set_single_column_change<
10221        T: std::convert::Into<std::boxed::Box<crate::model::SingleColumnChange>>,
10222    >(
10223        mut self,
10224        v: T,
10225    ) -> Self {
10226        self.details = std::option::Option::Some(
10227            crate::model::mapping_rule::Details::SingleColumnChange(v.into()),
10228        );
10229        self
10230    }
10231
10232    /// The value of [details][crate::model::MappingRule::details]
10233    /// if it holds a `MultiColumnDataTypeChange`, `None` if the field is not set or
10234    /// holds a different branch.
10235    pub fn multi_column_data_type_change(
10236        &self,
10237    ) -> std::option::Option<&std::boxed::Box<crate::model::MultiColumnDatatypeChange>> {
10238        #[allow(unreachable_patterns)]
10239        self.details.as_ref().and_then(|v| match v {
10240            crate::model::mapping_rule::Details::MultiColumnDataTypeChange(v) => {
10241                std::option::Option::Some(v)
10242            }
10243            _ => std::option::Option::None,
10244        })
10245    }
10246
10247    /// Sets the value of [details][crate::model::MappingRule::details]
10248    /// to hold a `MultiColumnDataTypeChange`.
10249    ///
10250    /// Note that all the setters affecting `details` are
10251    /// mutually exclusive.
10252    pub fn set_multi_column_data_type_change<
10253        T: std::convert::Into<std::boxed::Box<crate::model::MultiColumnDatatypeChange>>,
10254    >(
10255        mut self,
10256        v: T,
10257    ) -> Self {
10258        self.details = std::option::Option::Some(
10259            crate::model::mapping_rule::Details::MultiColumnDataTypeChange(v.into()),
10260        );
10261        self
10262    }
10263
10264    /// The value of [details][crate::model::MappingRule::details]
10265    /// if it holds a `ConditionalColumnSetValue`, `None` if the field is not set or
10266    /// holds a different branch.
10267    pub fn conditional_column_set_value(
10268        &self,
10269    ) -> std::option::Option<&std::boxed::Box<crate::model::ConditionalColumnSetValue>> {
10270        #[allow(unreachable_patterns)]
10271        self.details.as_ref().and_then(|v| match v {
10272            crate::model::mapping_rule::Details::ConditionalColumnSetValue(v) => {
10273                std::option::Option::Some(v)
10274            }
10275            _ => std::option::Option::None,
10276        })
10277    }
10278
10279    /// Sets the value of [details][crate::model::MappingRule::details]
10280    /// to hold a `ConditionalColumnSetValue`.
10281    ///
10282    /// Note that all the setters affecting `details` are
10283    /// mutually exclusive.
10284    pub fn set_conditional_column_set_value<
10285        T: std::convert::Into<std::boxed::Box<crate::model::ConditionalColumnSetValue>>,
10286    >(
10287        mut self,
10288        v: T,
10289    ) -> Self {
10290        self.details = std::option::Option::Some(
10291            crate::model::mapping_rule::Details::ConditionalColumnSetValue(v.into()),
10292        );
10293        self
10294    }
10295
10296    /// The value of [details][crate::model::MappingRule::details]
10297    /// if it holds a `ConvertRowidColumn`, `None` if the field is not set or
10298    /// holds a different branch.
10299    pub fn convert_rowid_column(
10300        &self,
10301    ) -> std::option::Option<&std::boxed::Box<crate::model::ConvertRowIdToColumn>> {
10302        #[allow(unreachable_patterns)]
10303        self.details.as_ref().and_then(|v| match v {
10304            crate::model::mapping_rule::Details::ConvertRowidColumn(v) => {
10305                std::option::Option::Some(v)
10306            }
10307            _ => std::option::Option::None,
10308        })
10309    }
10310
10311    /// Sets the value of [details][crate::model::MappingRule::details]
10312    /// to hold a `ConvertRowidColumn`.
10313    ///
10314    /// Note that all the setters affecting `details` are
10315    /// mutually exclusive.
10316    pub fn set_convert_rowid_column<
10317        T: std::convert::Into<std::boxed::Box<crate::model::ConvertRowIdToColumn>>,
10318    >(
10319        mut self,
10320        v: T,
10321    ) -> Self {
10322        self.details = std::option::Option::Some(
10323            crate::model::mapping_rule::Details::ConvertRowidColumn(v.into()),
10324        );
10325        self
10326    }
10327
10328    /// The value of [details][crate::model::MappingRule::details]
10329    /// if it holds a `SetTablePrimaryKey`, `None` if the field is not set or
10330    /// holds a different branch.
10331    pub fn set_table_primary_key(
10332        &self,
10333    ) -> std::option::Option<&std::boxed::Box<crate::model::SetTablePrimaryKey>> {
10334        #[allow(unreachable_patterns)]
10335        self.details.as_ref().and_then(|v| match v {
10336            crate::model::mapping_rule::Details::SetTablePrimaryKey(v) => {
10337                std::option::Option::Some(v)
10338            }
10339            _ => std::option::Option::None,
10340        })
10341    }
10342
10343    /// Sets the value of [details][crate::model::MappingRule::details]
10344    /// to hold a `SetTablePrimaryKey`.
10345    ///
10346    /// Note that all the setters affecting `details` are
10347    /// mutually exclusive.
10348    pub fn set_set_table_primary_key<
10349        T: std::convert::Into<std::boxed::Box<crate::model::SetTablePrimaryKey>>,
10350    >(
10351        mut self,
10352        v: T,
10353    ) -> Self {
10354        self.details = std::option::Option::Some(
10355            crate::model::mapping_rule::Details::SetTablePrimaryKey(v.into()),
10356        );
10357        self
10358    }
10359
10360    /// The value of [details][crate::model::MappingRule::details]
10361    /// if it holds a `SinglePackageChange`, `None` if the field is not set or
10362    /// holds a different branch.
10363    pub fn single_package_change(
10364        &self,
10365    ) -> std::option::Option<&std::boxed::Box<crate::model::SinglePackageChange>> {
10366        #[allow(unreachable_patterns)]
10367        self.details.as_ref().and_then(|v| match v {
10368            crate::model::mapping_rule::Details::SinglePackageChange(v) => {
10369                std::option::Option::Some(v)
10370            }
10371            _ => std::option::Option::None,
10372        })
10373    }
10374
10375    /// Sets the value of [details][crate::model::MappingRule::details]
10376    /// to hold a `SinglePackageChange`.
10377    ///
10378    /// Note that all the setters affecting `details` are
10379    /// mutually exclusive.
10380    pub fn set_single_package_change<
10381        T: std::convert::Into<std::boxed::Box<crate::model::SinglePackageChange>>,
10382    >(
10383        mut self,
10384        v: T,
10385    ) -> Self {
10386        self.details = std::option::Option::Some(
10387            crate::model::mapping_rule::Details::SinglePackageChange(v.into()),
10388        );
10389        self
10390    }
10391
10392    /// The value of [details][crate::model::MappingRule::details]
10393    /// if it holds a `SourceSqlChange`, `None` if the field is not set or
10394    /// holds a different branch.
10395    pub fn source_sql_change(
10396        &self,
10397    ) -> std::option::Option<&std::boxed::Box<crate::model::SourceSqlChange>> {
10398        #[allow(unreachable_patterns)]
10399        self.details.as_ref().and_then(|v| match v {
10400            crate::model::mapping_rule::Details::SourceSqlChange(v) => std::option::Option::Some(v),
10401            _ => std::option::Option::None,
10402        })
10403    }
10404
10405    /// Sets the value of [details][crate::model::MappingRule::details]
10406    /// to hold a `SourceSqlChange`.
10407    ///
10408    /// Note that all the setters affecting `details` are
10409    /// mutually exclusive.
10410    pub fn set_source_sql_change<
10411        T: std::convert::Into<std::boxed::Box<crate::model::SourceSqlChange>>,
10412    >(
10413        mut self,
10414        v: T,
10415    ) -> Self {
10416        self.details = std::option::Option::Some(
10417            crate::model::mapping_rule::Details::SourceSqlChange(v.into()),
10418        );
10419        self
10420    }
10421
10422    /// The value of [details][crate::model::MappingRule::details]
10423    /// if it holds a `FilterTableColumns`, `None` if the field is not set or
10424    /// holds a different branch.
10425    pub fn filter_table_columns(
10426        &self,
10427    ) -> std::option::Option<&std::boxed::Box<crate::model::FilterTableColumns>> {
10428        #[allow(unreachable_patterns)]
10429        self.details.as_ref().and_then(|v| match v {
10430            crate::model::mapping_rule::Details::FilterTableColumns(v) => {
10431                std::option::Option::Some(v)
10432            }
10433            _ => std::option::Option::None,
10434        })
10435    }
10436
10437    /// Sets the value of [details][crate::model::MappingRule::details]
10438    /// to hold a `FilterTableColumns`.
10439    ///
10440    /// Note that all the setters affecting `details` are
10441    /// mutually exclusive.
10442    pub fn set_filter_table_columns<
10443        T: std::convert::Into<std::boxed::Box<crate::model::FilterTableColumns>>,
10444    >(
10445        mut self,
10446        v: T,
10447    ) -> Self {
10448        self.details = std::option::Option::Some(
10449            crate::model::mapping_rule::Details::FilterTableColumns(v.into()),
10450        );
10451        self
10452    }
10453}
10454
10455impl wkt::message::Message for MappingRule {
10456    fn typename() -> &'static str {
10457        "type.googleapis.com/google.cloud.clouddms.v1.MappingRule"
10458    }
10459}
10460
10461/// Defines additional types related to [MappingRule].
10462pub mod mapping_rule {
10463    #[allow(unused_imports)]
10464    use super::*;
10465
10466    /// The current mapping rule state such as enabled, disabled or deleted.
10467    ///
10468    /// # Working with unknown values
10469    ///
10470    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10471    /// additional enum variants at any time. Adding new variants is not considered
10472    /// a breaking change. Applications should write their code in anticipation of:
10473    ///
10474    /// - New values appearing in future releases of the client library, **and**
10475    /// - New values received dynamically, without application changes.
10476    ///
10477    /// Please consult the [Working with enums] section in the user guide for some
10478    /// guidelines.
10479    ///
10480    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10481    #[derive(Clone, Debug, PartialEq)]
10482    #[non_exhaustive]
10483    pub enum State {
10484        /// The state of the mapping rule is unknown.
10485        Unspecified,
10486        /// The rule is enabled.
10487        Enabled,
10488        /// The rule is disabled.
10489        Disabled,
10490        /// The rule is logically deleted.
10491        Deleted,
10492        /// If set, the enum was initialized with an unknown value.
10493        ///
10494        /// Applications can examine the value using [State::value] or
10495        /// [State::name].
10496        UnknownValue(state::UnknownValue),
10497    }
10498
10499    #[doc(hidden)]
10500    pub mod state {
10501        #[allow(unused_imports)]
10502        use super::*;
10503        #[derive(Clone, Debug, PartialEq)]
10504        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10505    }
10506
10507    impl State {
10508        /// Gets the enum value.
10509        ///
10510        /// Returns `None` if the enum contains an unknown value deserialized from
10511        /// the string representation of enums.
10512        pub fn value(&self) -> std::option::Option<i32> {
10513            match self {
10514                Self::Unspecified => std::option::Option::Some(0),
10515                Self::Enabled => std::option::Option::Some(1),
10516                Self::Disabled => std::option::Option::Some(2),
10517                Self::Deleted => std::option::Option::Some(3),
10518                Self::UnknownValue(u) => u.0.value(),
10519            }
10520        }
10521
10522        /// Gets the enum value as a string.
10523        ///
10524        /// Returns `None` if the enum contains an unknown value deserialized from
10525        /// the integer representation of enums.
10526        pub fn name(&self) -> std::option::Option<&str> {
10527            match self {
10528                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
10529                Self::Enabled => std::option::Option::Some("ENABLED"),
10530                Self::Disabled => std::option::Option::Some("DISABLED"),
10531                Self::Deleted => std::option::Option::Some("DELETED"),
10532                Self::UnknownValue(u) => u.0.name(),
10533            }
10534        }
10535    }
10536
10537    impl std::default::Default for State {
10538        fn default() -> Self {
10539            use std::convert::From;
10540            Self::from(0)
10541        }
10542    }
10543
10544    impl std::fmt::Display for State {
10545        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10546            wkt::internal::display_enum(f, self.name(), self.value())
10547        }
10548    }
10549
10550    impl std::convert::From<i32> for State {
10551        fn from(value: i32) -> Self {
10552            match value {
10553                0 => Self::Unspecified,
10554                1 => Self::Enabled,
10555                2 => Self::Disabled,
10556                3 => Self::Deleted,
10557                _ => Self::UnknownValue(state::UnknownValue(
10558                    wkt::internal::UnknownEnumValue::Integer(value),
10559                )),
10560            }
10561        }
10562    }
10563
10564    impl std::convert::From<&str> for State {
10565        fn from(value: &str) -> Self {
10566            use std::string::ToString;
10567            match value {
10568                "STATE_UNSPECIFIED" => Self::Unspecified,
10569                "ENABLED" => Self::Enabled,
10570                "DISABLED" => Self::Disabled,
10571                "DELETED" => Self::Deleted,
10572                _ => Self::UnknownValue(state::UnknownValue(
10573                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10574                )),
10575            }
10576        }
10577    }
10578
10579    impl serde::ser::Serialize for State {
10580        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10581        where
10582            S: serde::Serializer,
10583        {
10584            match self {
10585                Self::Unspecified => serializer.serialize_i32(0),
10586                Self::Enabled => serializer.serialize_i32(1),
10587                Self::Disabled => serializer.serialize_i32(2),
10588                Self::Deleted => serializer.serialize_i32(3),
10589                Self::UnknownValue(u) => u.0.serialize(serializer),
10590            }
10591        }
10592    }
10593
10594    impl<'de> serde::de::Deserialize<'de> for State {
10595        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10596        where
10597            D: serde::Deserializer<'de>,
10598        {
10599            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10600                ".google.cloud.clouddms.v1.MappingRule.State",
10601            ))
10602        }
10603    }
10604
10605    /// The rule specific details.
10606    #[derive(Clone, Debug, PartialEq)]
10607    #[non_exhaustive]
10608    pub enum Details {
10609        /// Optional. Rule to specify how a single entity should be renamed.
10610        SingleEntityRename(std::boxed::Box<crate::model::SingleEntityRename>),
10611        /// Optional. Rule to specify how multiple entities should be renamed.
10612        MultiEntityRename(std::boxed::Box<crate::model::MultiEntityRename>),
10613        /// Optional. Rule to specify how multiple entities should be relocated into
10614        /// a different schema.
10615        EntityMove(std::boxed::Box<crate::model::EntityMove>),
10616        /// Optional. Rule to specify how a single column is converted.
10617        SingleColumnChange(std::boxed::Box<crate::model::SingleColumnChange>),
10618        /// Optional. Rule to specify how multiple columns should be converted to a
10619        /// different data type.
10620        MultiColumnDataTypeChange(std::boxed::Box<crate::model::MultiColumnDatatypeChange>),
10621        /// Optional. Rule to specify how the data contained in a column should be
10622        /// transformed (such as trimmed, rounded, etc) provided that the data meets
10623        /// certain criteria.
10624        ConditionalColumnSetValue(std::boxed::Box<crate::model::ConditionalColumnSetValue>),
10625        /// Optional. Rule to specify how multiple tables should be converted with an
10626        /// additional rowid column.
10627        ConvertRowidColumn(std::boxed::Box<crate::model::ConvertRowIdToColumn>),
10628        /// Optional. Rule to specify the primary key for a table
10629        SetTablePrimaryKey(std::boxed::Box<crate::model::SetTablePrimaryKey>),
10630        /// Optional. Rule to specify how a single package is converted.
10631        SinglePackageChange(std::boxed::Box<crate::model::SinglePackageChange>),
10632        /// Optional. Rule to change the sql code for an entity, for example,
10633        /// function, procedure.
10634        SourceSqlChange(std::boxed::Box<crate::model::SourceSqlChange>),
10635        /// Optional. Rule to specify the list of columns to include or exclude from
10636        /// a table.
10637        FilterTableColumns(std::boxed::Box<crate::model::FilterTableColumns>),
10638    }
10639}
10640
10641/// Options to configure rule type SingleEntityRename.
10642/// The rule is used to rename an entity.
10643///
10644/// The rule filter field can refer to only one entity.
10645///
10646/// The rule scope can be one of: Database, Schema, Table, Column, Constraint,
10647/// Index, View, Function, Stored Procedure, Materialized View, Sequence, UDT,
10648/// Synonym
10649#[derive(Clone, Default, PartialEq)]
10650#[non_exhaustive]
10651pub struct SingleEntityRename {
10652    /// Required. The new name of the destination entity
10653    pub new_name: std::string::String,
10654
10655    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10656}
10657
10658impl SingleEntityRename {
10659    pub fn new() -> Self {
10660        std::default::Default::default()
10661    }
10662
10663    /// Sets the value of [new_name][crate::model::SingleEntityRename::new_name].
10664    pub fn set_new_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10665        self.new_name = v.into();
10666        self
10667    }
10668}
10669
10670impl wkt::message::Message for SingleEntityRename {
10671    fn typename() -> &'static str {
10672        "type.googleapis.com/google.cloud.clouddms.v1.SingleEntityRename"
10673    }
10674}
10675
10676/// Options to configure rule type MultiEntityRename.
10677/// The rule is used to rename multiple entities.
10678///
10679/// The rule filter field can refer to one or more entities.
10680///
10681/// The rule scope can be one of: Database, Schema, Table, Column, Constraint,
10682/// Index, View, Function, Stored Procedure, Materialized View, Sequence, UDT
10683#[derive(Clone, Default, PartialEq)]
10684#[non_exhaustive]
10685pub struct MultiEntityRename {
10686    /// Optional. The pattern used to generate the new entity's name. This pattern
10687    /// must include the characters '{name}', which will be replaced with the name
10688    /// of the original entity. For example, the pattern 't_{name}' for an entity
10689    /// name jobs would be converted to 't_jobs'.
10690    ///
10691    /// If unspecified, the default value for this field is '{name}'
10692    pub new_name_pattern: std::string::String,
10693
10694    /// Optional. Additional transformation that can be done on the source entity
10695    /// name before it is being used by the new_name_pattern, for example lower
10696    /// case. If no transformation is desired, use NO_TRANSFORMATION
10697    pub source_name_transformation: crate::model::EntityNameTransformation,
10698
10699    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10700}
10701
10702impl MultiEntityRename {
10703    pub fn new() -> Self {
10704        std::default::Default::default()
10705    }
10706
10707    /// Sets the value of [new_name_pattern][crate::model::MultiEntityRename::new_name_pattern].
10708    pub fn set_new_name_pattern<T: std::convert::Into<std::string::String>>(
10709        mut self,
10710        v: T,
10711    ) -> Self {
10712        self.new_name_pattern = v.into();
10713        self
10714    }
10715
10716    /// Sets the value of [source_name_transformation][crate::model::MultiEntityRename::source_name_transformation].
10717    pub fn set_source_name_transformation<
10718        T: std::convert::Into<crate::model::EntityNameTransformation>,
10719    >(
10720        mut self,
10721        v: T,
10722    ) -> Self {
10723        self.source_name_transformation = v.into();
10724        self
10725    }
10726}
10727
10728impl wkt::message::Message for MultiEntityRename {
10729    fn typename() -> &'static str {
10730        "type.googleapis.com/google.cloud.clouddms.v1.MultiEntityRename"
10731    }
10732}
10733
10734/// Options to configure rule type EntityMove.
10735/// The rule is used to move an entity to a new schema.
10736///
10737/// The rule filter field can refer to one or more entities.
10738///
10739/// The rule scope can be one of: Table, Column, Constraint, Index, View,
10740/// Function, Stored Procedure, Materialized View, Sequence, UDT
10741#[derive(Clone, Default, PartialEq)]
10742#[non_exhaustive]
10743pub struct EntityMove {
10744    /// Required. The new schema
10745    pub new_schema: std::string::String,
10746
10747    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10748}
10749
10750impl EntityMove {
10751    pub fn new() -> Self {
10752        std::default::Default::default()
10753    }
10754
10755    /// Sets the value of [new_schema][crate::model::EntityMove::new_schema].
10756    pub fn set_new_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10757        self.new_schema = v.into();
10758        self
10759    }
10760}
10761
10762impl wkt::message::Message for EntityMove {
10763    fn typename() -> &'static str {
10764        "type.googleapis.com/google.cloud.clouddms.v1.EntityMove"
10765    }
10766}
10767
10768/// Options to configure rule type SingleColumnChange.
10769/// The rule is used to change the properties of a column.
10770///
10771/// The rule filter field can refer to one entity.
10772///
10773/// The rule scope can be one of: Column.
10774///
10775/// When using this rule, if a field is not specified than the destination
10776/// column's configuration will be the same as the one in the source column..
10777#[derive(Clone, Default, PartialEq)]
10778#[non_exhaustive]
10779pub struct SingleColumnChange {
10780    /// Optional. Column data type name.
10781    pub data_type: std::string::String,
10782
10783    /// Optional. Charset override - instead of table level charset.
10784    pub charset: std::string::String,
10785
10786    /// Optional. Collation override - instead of table level collation.
10787    pub collation: std::string::String,
10788
10789    /// Optional. Column length - e.g. 50 as in varchar (50) - when relevant.
10790    pub length: i64,
10791
10792    /// Optional. Column precision - e.g. 8 as in double (8,2) - when relevant.
10793    pub precision: i32,
10794
10795    /// Optional. Column scale - e.g. 2 as in double (8,2) - when relevant.
10796    pub scale: i32,
10797
10798    /// Optional. Column fractional seconds precision - e.g. 2 as in timestamp (2)
10799    ///
10800    /// - when relevant.
10801    pub fractional_seconds_precision: i32,
10802
10803    /// Optional. Is the column of array type.
10804    pub array: bool,
10805
10806    /// Optional. The length of the array, only relevant if the column type is an
10807    /// array.
10808    pub array_length: i32,
10809
10810    /// Optional. Is the column nullable.
10811    pub nullable: bool,
10812
10813    /// Optional. Is the column auto-generated/identity.
10814    pub auto_generated: bool,
10815
10816    /// Optional. Is the column a UDT (User-defined Type).
10817    pub udt: bool,
10818
10819    /// Optional. Custom engine specific features.
10820    pub custom_features: std::option::Option<wkt::Struct>,
10821
10822    /// Optional. Specifies the list of values allowed in the column.
10823    pub set_values: std::vec::Vec<std::string::String>,
10824
10825    /// Optional. Comment associated with the column.
10826    pub comment: std::string::String,
10827
10828    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10829}
10830
10831impl SingleColumnChange {
10832    pub fn new() -> Self {
10833        std::default::Default::default()
10834    }
10835
10836    /// Sets the value of [data_type][crate::model::SingleColumnChange::data_type].
10837    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10838        self.data_type = v.into();
10839        self
10840    }
10841
10842    /// Sets the value of [charset][crate::model::SingleColumnChange::charset].
10843    pub fn set_charset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10844        self.charset = v.into();
10845        self
10846    }
10847
10848    /// Sets the value of [collation][crate::model::SingleColumnChange::collation].
10849    pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10850        self.collation = v.into();
10851        self
10852    }
10853
10854    /// Sets the value of [length][crate::model::SingleColumnChange::length].
10855    pub fn set_length<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10856        self.length = v.into();
10857        self
10858    }
10859
10860    /// Sets the value of [precision][crate::model::SingleColumnChange::precision].
10861    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10862        self.precision = v.into();
10863        self
10864    }
10865
10866    /// Sets the value of [scale][crate::model::SingleColumnChange::scale].
10867    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10868        self.scale = v.into();
10869        self
10870    }
10871
10872    /// Sets the value of [fractional_seconds_precision][crate::model::SingleColumnChange::fractional_seconds_precision].
10873    pub fn set_fractional_seconds_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10874        self.fractional_seconds_precision = v.into();
10875        self
10876    }
10877
10878    /// Sets the value of [array][crate::model::SingleColumnChange::array].
10879    pub fn set_array<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10880        self.array = v.into();
10881        self
10882    }
10883
10884    /// Sets the value of [array_length][crate::model::SingleColumnChange::array_length].
10885    pub fn set_array_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10886        self.array_length = v.into();
10887        self
10888    }
10889
10890    /// Sets the value of [nullable][crate::model::SingleColumnChange::nullable].
10891    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10892        self.nullable = v.into();
10893        self
10894    }
10895
10896    /// Sets the value of [auto_generated][crate::model::SingleColumnChange::auto_generated].
10897    pub fn set_auto_generated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10898        self.auto_generated = v.into();
10899        self
10900    }
10901
10902    /// Sets the value of [udt][crate::model::SingleColumnChange::udt].
10903    pub fn set_udt<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10904        self.udt = v.into();
10905        self
10906    }
10907
10908    /// Sets the value of [custom_features][crate::model::SingleColumnChange::custom_features].
10909    pub fn set_custom_features<T>(mut self, v: T) -> Self
10910    where
10911        T: std::convert::Into<wkt::Struct>,
10912    {
10913        self.custom_features = std::option::Option::Some(v.into());
10914        self
10915    }
10916
10917    /// Sets or clears the value of [custom_features][crate::model::SingleColumnChange::custom_features].
10918    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
10919    where
10920        T: std::convert::Into<wkt::Struct>,
10921    {
10922        self.custom_features = v.map(|x| x.into());
10923        self
10924    }
10925
10926    /// Sets the value of [set_values][crate::model::SingleColumnChange::set_values].
10927    pub fn set_set_values<T, V>(mut self, v: T) -> Self
10928    where
10929        T: std::iter::IntoIterator<Item = V>,
10930        V: std::convert::Into<std::string::String>,
10931    {
10932        use std::iter::Iterator;
10933        self.set_values = v.into_iter().map(|i| i.into()).collect();
10934        self
10935    }
10936
10937    /// Sets the value of [comment][crate::model::SingleColumnChange::comment].
10938    pub fn set_comment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10939        self.comment = v.into();
10940        self
10941    }
10942}
10943
10944impl wkt::message::Message for SingleColumnChange {
10945    fn typename() -> &'static str {
10946        "type.googleapis.com/google.cloud.clouddms.v1.SingleColumnChange"
10947    }
10948}
10949
10950/// Options to configure rule type MultiColumnDatatypeChange.
10951/// The rule is used to change the data type and associated properties of
10952/// multiple columns at once.
10953///
10954/// The rule filter field can refer to one or more entities.
10955///
10956/// The rule scope can be one of:Column.
10957///
10958/// This rule requires additional filters to be specified beyond the basic rule
10959/// filter field, which is the source data type, but the rule supports additional
10960/// filtering capabilities such as the minimum and maximum field length. All
10961/// additional filters which are specified are required to be met in order for
10962/// the rule to be applied (logical AND between the fields).
10963#[derive(Clone, Default, PartialEq)]
10964#[non_exhaustive]
10965pub struct MultiColumnDatatypeChange {
10966    /// Required. Filter on source data type.
10967    pub source_data_type_filter: std::string::String,
10968
10969    /// Required. New data type.
10970    pub new_data_type: std::string::String,
10971
10972    /// Optional. Column length - e.g. varchar (50) - if not specified and relevant
10973    /// uses the source column length.
10974    pub override_length: i64,
10975
10976    /// Optional. Column scale - when relevant - if not specified and relevant
10977    /// uses the source column scale.
10978    pub override_scale: i32,
10979
10980    /// Optional. Column precision - when relevant - if not specified and relevant
10981    /// uses the source column precision.
10982    pub override_precision: i32,
10983
10984    /// Optional. Column fractional seconds precision - used only for timestamp
10985    /// based datatypes - if not specified and relevant uses the source column
10986    /// fractional seconds precision.
10987    pub override_fractional_seconds_precision: i32,
10988
10989    /// Optional. Custom engine specific features.
10990    pub custom_features: std::option::Option<wkt::Struct>,
10991
10992    /// Filter on source column parameters.
10993    pub source_filter:
10994        std::option::Option<crate::model::multi_column_datatype_change::SourceFilter>,
10995
10996    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10997}
10998
10999impl MultiColumnDatatypeChange {
11000    pub fn new() -> Self {
11001        std::default::Default::default()
11002    }
11003
11004    /// Sets the value of [source_data_type_filter][crate::model::MultiColumnDatatypeChange::source_data_type_filter].
11005    pub fn set_source_data_type_filter<T: std::convert::Into<std::string::String>>(
11006        mut self,
11007        v: T,
11008    ) -> Self {
11009        self.source_data_type_filter = v.into();
11010        self
11011    }
11012
11013    /// Sets the value of [new_data_type][crate::model::MultiColumnDatatypeChange::new_data_type].
11014    pub fn set_new_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11015        self.new_data_type = v.into();
11016        self
11017    }
11018
11019    /// Sets the value of [override_length][crate::model::MultiColumnDatatypeChange::override_length].
11020    pub fn set_override_length<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11021        self.override_length = v.into();
11022        self
11023    }
11024
11025    /// Sets the value of [override_scale][crate::model::MultiColumnDatatypeChange::override_scale].
11026    pub fn set_override_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11027        self.override_scale = v.into();
11028        self
11029    }
11030
11031    /// Sets the value of [override_precision][crate::model::MultiColumnDatatypeChange::override_precision].
11032    pub fn set_override_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11033        self.override_precision = v.into();
11034        self
11035    }
11036
11037    /// Sets the value of [override_fractional_seconds_precision][crate::model::MultiColumnDatatypeChange::override_fractional_seconds_precision].
11038    pub fn set_override_fractional_seconds_precision<T: std::convert::Into<i32>>(
11039        mut self,
11040        v: T,
11041    ) -> Self {
11042        self.override_fractional_seconds_precision = v.into();
11043        self
11044    }
11045
11046    /// Sets the value of [custom_features][crate::model::MultiColumnDatatypeChange::custom_features].
11047    pub fn set_custom_features<T>(mut self, v: T) -> Self
11048    where
11049        T: std::convert::Into<wkt::Struct>,
11050    {
11051        self.custom_features = std::option::Option::Some(v.into());
11052        self
11053    }
11054
11055    /// Sets or clears the value of [custom_features][crate::model::MultiColumnDatatypeChange::custom_features].
11056    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
11057    where
11058        T: std::convert::Into<wkt::Struct>,
11059    {
11060        self.custom_features = v.map(|x| x.into());
11061        self
11062    }
11063
11064    /// Sets the value of [source_filter][crate::model::MultiColumnDatatypeChange::source_filter].
11065    ///
11066    /// Note that all the setters affecting `source_filter` are mutually
11067    /// exclusive.
11068    pub fn set_source_filter<
11069        T: std::convert::Into<
11070                std::option::Option<crate::model::multi_column_datatype_change::SourceFilter>,
11071            >,
11072    >(
11073        mut self,
11074        v: T,
11075    ) -> Self {
11076        self.source_filter = v.into();
11077        self
11078    }
11079
11080    /// The value of [source_filter][crate::model::MultiColumnDatatypeChange::source_filter]
11081    /// if it holds a `SourceTextFilter`, `None` if the field is not set or
11082    /// holds a different branch.
11083    pub fn source_text_filter(
11084        &self,
11085    ) -> std::option::Option<&std::boxed::Box<crate::model::SourceTextFilter>> {
11086        #[allow(unreachable_patterns)]
11087        self.source_filter.as_ref().and_then(|v| match v {
11088            crate::model::multi_column_datatype_change::SourceFilter::SourceTextFilter(v) => {
11089                std::option::Option::Some(v)
11090            }
11091            _ => std::option::Option::None,
11092        })
11093    }
11094
11095    /// Sets the value of [source_filter][crate::model::MultiColumnDatatypeChange::source_filter]
11096    /// to hold a `SourceTextFilter`.
11097    ///
11098    /// Note that all the setters affecting `source_filter` are
11099    /// mutually exclusive.
11100    pub fn set_source_text_filter<
11101        T: std::convert::Into<std::boxed::Box<crate::model::SourceTextFilter>>,
11102    >(
11103        mut self,
11104        v: T,
11105    ) -> Self {
11106        self.source_filter = std::option::Option::Some(
11107            crate::model::multi_column_datatype_change::SourceFilter::SourceTextFilter(v.into()),
11108        );
11109        self
11110    }
11111
11112    /// The value of [source_filter][crate::model::MultiColumnDatatypeChange::source_filter]
11113    /// if it holds a `SourceNumericFilter`, `None` if the field is not set or
11114    /// holds a different branch.
11115    pub fn source_numeric_filter(
11116        &self,
11117    ) -> std::option::Option<&std::boxed::Box<crate::model::SourceNumericFilter>> {
11118        #[allow(unreachable_patterns)]
11119        self.source_filter.as_ref().and_then(|v| match v {
11120            crate::model::multi_column_datatype_change::SourceFilter::SourceNumericFilter(v) => {
11121                std::option::Option::Some(v)
11122            }
11123            _ => std::option::Option::None,
11124        })
11125    }
11126
11127    /// Sets the value of [source_filter][crate::model::MultiColumnDatatypeChange::source_filter]
11128    /// to hold a `SourceNumericFilter`.
11129    ///
11130    /// Note that all the setters affecting `source_filter` are
11131    /// mutually exclusive.
11132    pub fn set_source_numeric_filter<
11133        T: std::convert::Into<std::boxed::Box<crate::model::SourceNumericFilter>>,
11134    >(
11135        mut self,
11136        v: T,
11137    ) -> Self {
11138        self.source_filter = std::option::Option::Some(
11139            crate::model::multi_column_datatype_change::SourceFilter::SourceNumericFilter(v.into()),
11140        );
11141        self
11142    }
11143}
11144
11145impl wkt::message::Message for MultiColumnDatatypeChange {
11146    fn typename() -> &'static str {
11147        "type.googleapis.com/google.cloud.clouddms.v1.MultiColumnDatatypeChange"
11148    }
11149}
11150
11151/// Defines additional types related to [MultiColumnDatatypeChange].
11152pub mod multi_column_datatype_change {
11153    #[allow(unused_imports)]
11154    use super::*;
11155
11156    /// Filter on source column parameters.
11157    #[derive(Clone, Debug, PartialEq)]
11158    #[non_exhaustive]
11159    pub enum SourceFilter {
11160        /// Optional. Filter for text-based data types like varchar.
11161        SourceTextFilter(std::boxed::Box<crate::model::SourceTextFilter>),
11162        /// Optional. Filter for fixed point number data types such as
11163        /// NUMERIC/NUMBER.
11164        SourceNumericFilter(std::boxed::Box<crate::model::SourceNumericFilter>),
11165    }
11166}
11167
11168/// Filter for text-based data types like varchar.
11169#[derive(Clone, Default, PartialEq)]
11170#[non_exhaustive]
11171pub struct SourceTextFilter {
11172    /// Optional. The filter will match columns with length greater than or equal
11173    /// to this number.
11174    pub source_min_length_filter: i64,
11175
11176    /// Optional. The filter will match columns with length smaller than or equal
11177    /// to this number.
11178    pub source_max_length_filter: i64,
11179
11180    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11181}
11182
11183impl SourceTextFilter {
11184    pub fn new() -> Self {
11185        std::default::Default::default()
11186    }
11187
11188    /// Sets the value of [source_min_length_filter][crate::model::SourceTextFilter::source_min_length_filter].
11189    pub fn set_source_min_length_filter<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11190        self.source_min_length_filter = v.into();
11191        self
11192    }
11193
11194    /// Sets the value of [source_max_length_filter][crate::model::SourceTextFilter::source_max_length_filter].
11195    pub fn set_source_max_length_filter<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11196        self.source_max_length_filter = v.into();
11197        self
11198    }
11199}
11200
11201impl wkt::message::Message for SourceTextFilter {
11202    fn typename() -> &'static str {
11203        "type.googleapis.com/google.cloud.clouddms.v1.SourceTextFilter"
11204    }
11205}
11206
11207/// Filter for fixed point number data types such as NUMERIC/NUMBER
11208#[derive(Clone, Default, PartialEq)]
11209#[non_exhaustive]
11210pub struct SourceNumericFilter {
11211    /// Optional. The filter will match columns with scale greater than or equal to
11212    /// this number.
11213    pub source_min_scale_filter: i32,
11214
11215    /// Optional. The filter will match columns with scale smaller than or equal to
11216    /// this number.
11217    pub source_max_scale_filter: i32,
11218
11219    /// Optional. The filter will match columns with precision greater than or
11220    /// equal to this number.
11221    pub source_min_precision_filter: i32,
11222
11223    /// Optional. The filter will match columns with precision smaller than or
11224    /// equal to this number.
11225    pub source_max_precision_filter: i32,
11226
11227    /// Required. Enum to set the option defining the datatypes numeric filter has
11228    /// to be applied to
11229    pub numeric_filter_option: crate::model::NumericFilterOption,
11230
11231    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11232}
11233
11234impl SourceNumericFilter {
11235    pub fn new() -> Self {
11236        std::default::Default::default()
11237    }
11238
11239    /// Sets the value of [source_min_scale_filter][crate::model::SourceNumericFilter::source_min_scale_filter].
11240    pub fn set_source_min_scale_filter<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11241        self.source_min_scale_filter = v.into();
11242        self
11243    }
11244
11245    /// Sets the value of [source_max_scale_filter][crate::model::SourceNumericFilter::source_max_scale_filter].
11246    pub fn set_source_max_scale_filter<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11247        self.source_max_scale_filter = v.into();
11248        self
11249    }
11250
11251    /// Sets the value of [source_min_precision_filter][crate::model::SourceNumericFilter::source_min_precision_filter].
11252    pub fn set_source_min_precision_filter<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11253        self.source_min_precision_filter = v.into();
11254        self
11255    }
11256
11257    /// Sets the value of [source_max_precision_filter][crate::model::SourceNumericFilter::source_max_precision_filter].
11258    pub fn set_source_max_precision_filter<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11259        self.source_max_precision_filter = v.into();
11260        self
11261    }
11262
11263    /// Sets the value of [numeric_filter_option][crate::model::SourceNumericFilter::numeric_filter_option].
11264    pub fn set_numeric_filter_option<T: std::convert::Into<crate::model::NumericFilterOption>>(
11265        mut self,
11266        v: T,
11267    ) -> Self {
11268        self.numeric_filter_option = v.into();
11269        self
11270    }
11271}
11272
11273impl wkt::message::Message for SourceNumericFilter {
11274    fn typename() -> &'static str {
11275        "type.googleapis.com/google.cloud.clouddms.v1.SourceNumericFilter"
11276    }
11277}
11278
11279/// Options to configure rule type ConditionalColumnSetValue.
11280/// The rule is used to transform the data which is being replicated/migrated.
11281///
11282/// The rule filter field can refer to one or more entities.
11283///
11284/// The rule scope can be one of: Column.
11285#[derive(Clone, Default, PartialEq)]
11286#[non_exhaustive]
11287pub struct ConditionalColumnSetValue {
11288    /// Required. Description of data transformation during migration.
11289    pub value_transformation: std::option::Option<crate::model::ValueTransformation>,
11290
11291    /// Optional. Custom engine specific features.
11292    pub custom_features: std::option::Option<wkt::Struct>,
11293
11294    pub source_filter:
11295        std::option::Option<crate::model::conditional_column_set_value::SourceFilter>,
11296
11297    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11298}
11299
11300impl ConditionalColumnSetValue {
11301    pub fn new() -> Self {
11302        std::default::Default::default()
11303    }
11304
11305    /// Sets the value of [value_transformation][crate::model::ConditionalColumnSetValue::value_transformation].
11306    pub fn set_value_transformation<T>(mut self, v: T) -> Self
11307    where
11308        T: std::convert::Into<crate::model::ValueTransformation>,
11309    {
11310        self.value_transformation = std::option::Option::Some(v.into());
11311        self
11312    }
11313
11314    /// Sets or clears the value of [value_transformation][crate::model::ConditionalColumnSetValue::value_transformation].
11315    pub fn set_or_clear_value_transformation<T>(mut self, v: std::option::Option<T>) -> Self
11316    where
11317        T: std::convert::Into<crate::model::ValueTransformation>,
11318    {
11319        self.value_transformation = v.map(|x| x.into());
11320        self
11321    }
11322
11323    /// Sets the value of [custom_features][crate::model::ConditionalColumnSetValue::custom_features].
11324    pub fn set_custom_features<T>(mut self, v: T) -> Self
11325    where
11326        T: std::convert::Into<wkt::Struct>,
11327    {
11328        self.custom_features = std::option::Option::Some(v.into());
11329        self
11330    }
11331
11332    /// Sets or clears the value of [custom_features][crate::model::ConditionalColumnSetValue::custom_features].
11333    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
11334    where
11335        T: std::convert::Into<wkt::Struct>,
11336    {
11337        self.custom_features = v.map(|x| x.into());
11338        self
11339    }
11340
11341    /// Sets the value of [source_filter][crate::model::ConditionalColumnSetValue::source_filter].
11342    ///
11343    /// Note that all the setters affecting `source_filter` are mutually
11344    /// exclusive.
11345    pub fn set_source_filter<
11346        T: std::convert::Into<
11347                std::option::Option<crate::model::conditional_column_set_value::SourceFilter>,
11348            >,
11349    >(
11350        mut self,
11351        v: T,
11352    ) -> Self {
11353        self.source_filter = v.into();
11354        self
11355    }
11356
11357    /// The value of [source_filter][crate::model::ConditionalColumnSetValue::source_filter]
11358    /// if it holds a `SourceTextFilter`, `None` if the field is not set or
11359    /// holds a different branch.
11360    pub fn source_text_filter(
11361        &self,
11362    ) -> std::option::Option<&std::boxed::Box<crate::model::SourceTextFilter>> {
11363        #[allow(unreachable_patterns)]
11364        self.source_filter.as_ref().and_then(|v| match v {
11365            crate::model::conditional_column_set_value::SourceFilter::SourceTextFilter(v) => {
11366                std::option::Option::Some(v)
11367            }
11368            _ => std::option::Option::None,
11369        })
11370    }
11371
11372    /// Sets the value of [source_filter][crate::model::ConditionalColumnSetValue::source_filter]
11373    /// to hold a `SourceTextFilter`.
11374    ///
11375    /// Note that all the setters affecting `source_filter` are
11376    /// mutually exclusive.
11377    pub fn set_source_text_filter<
11378        T: std::convert::Into<std::boxed::Box<crate::model::SourceTextFilter>>,
11379    >(
11380        mut self,
11381        v: T,
11382    ) -> Self {
11383        self.source_filter = std::option::Option::Some(
11384            crate::model::conditional_column_set_value::SourceFilter::SourceTextFilter(v.into()),
11385        );
11386        self
11387    }
11388
11389    /// The value of [source_filter][crate::model::ConditionalColumnSetValue::source_filter]
11390    /// if it holds a `SourceNumericFilter`, `None` if the field is not set or
11391    /// holds a different branch.
11392    pub fn source_numeric_filter(
11393        &self,
11394    ) -> std::option::Option<&std::boxed::Box<crate::model::SourceNumericFilter>> {
11395        #[allow(unreachable_patterns)]
11396        self.source_filter.as_ref().and_then(|v| match v {
11397            crate::model::conditional_column_set_value::SourceFilter::SourceNumericFilter(v) => {
11398                std::option::Option::Some(v)
11399            }
11400            _ => std::option::Option::None,
11401        })
11402    }
11403
11404    /// Sets the value of [source_filter][crate::model::ConditionalColumnSetValue::source_filter]
11405    /// to hold a `SourceNumericFilter`.
11406    ///
11407    /// Note that all the setters affecting `source_filter` are
11408    /// mutually exclusive.
11409    pub fn set_source_numeric_filter<
11410        T: std::convert::Into<std::boxed::Box<crate::model::SourceNumericFilter>>,
11411    >(
11412        mut self,
11413        v: T,
11414    ) -> Self {
11415        self.source_filter = std::option::Option::Some(
11416            crate::model::conditional_column_set_value::SourceFilter::SourceNumericFilter(v.into()),
11417        );
11418        self
11419    }
11420}
11421
11422impl wkt::message::Message for ConditionalColumnSetValue {
11423    fn typename() -> &'static str {
11424        "type.googleapis.com/google.cloud.clouddms.v1.ConditionalColumnSetValue"
11425    }
11426}
11427
11428/// Defines additional types related to [ConditionalColumnSetValue].
11429pub mod conditional_column_set_value {
11430    #[allow(unused_imports)]
11431    use super::*;
11432
11433    #[derive(Clone, Debug, PartialEq)]
11434    #[non_exhaustive]
11435    pub enum SourceFilter {
11436        /// Optional. Optional filter on source column length. Used for text based
11437        /// data types like varchar.
11438        SourceTextFilter(std::boxed::Box<crate::model::SourceTextFilter>),
11439        /// Optional. Optional filter on source column precision and scale. Used for
11440        /// fixed point numbers such as NUMERIC/NUMBER data types.
11441        SourceNumericFilter(std::boxed::Box<crate::model::SourceNumericFilter>),
11442    }
11443}
11444
11445/// Description of data transformation during migration as part of the
11446/// ConditionalColumnSetValue.
11447#[derive(Clone, Default, PartialEq)]
11448#[non_exhaustive]
11449pub struct ValueTransformation {
11450    pub filter: std::option::Option<crate::model::value_transformation::Filter>,
11451
11452    pub action: std::option::Option<crate::model::value_transformation::Action>,
11453
11454    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11455}
11456
11457impl ValueTransformation {
11458    pub fn new() -> Self {
11459        std::default::Default::default()
11460    }
11461
11462    /// Sets the value of [filter][crate::model::ValueTransformation::filter].
11463    ///
11464    /// Note that all the setters affecting `filter` are mutually
11465    /// exclusive.
11466    pub fn set_filter<
11467        T: std::convert::Into<std::option::Option<crate::model::value_transformation::Filter>>,
11468    >(
11469        mut self,
11470        v: T,
11471    ) -> Self {
11472        self.filter = v.into();
11473        self
11474    }
11475
11476    /// The value of [filter][crate::model::ValueTransformation::filter]
11477    /// if it holds a `IsNull`, `None` if the field is not set or
11478    /// holds a different branch.
11479    pub fn is_null(&self) -> std::option::Option<&std::boxed::Box<wkt::Empty>> {
11480        #[allow(unreachable_patterns)]
11481        self.filter.as_ref().and_then(|v| match v {
11482            crate::model::value_transformation::Filter::IsNull(v) => std::option::Option::Some(v),
11483            _ => std::option::Option::None,
11484        })
11485    }
11486
11487    /// Sets the value of [filter][crate::model::ValueTransformation::filter]
11488    /// to hold a `IsNull`.
11489    ///
11490    /// Note that all the setters affecting `filter` are
11491    /// mutually exclusive.
11492    pub fn set_is_null<T: std::convert::Into<std::boxed::Box<wkt::Empty>>>(mut self, v: T) -> Self {
11493        self.filter =
11494            std::option::Option::Some(crate::model::value_transformation::Filter::IsNull(v.into()));
11495        self
11496    }
11497
11498    /// The value of [filter][crate::model::ValueTransformation::filter]
11499    /// if it holds a `ValueList`, `None` if the field is not set or
11500    /// holds a different branch.
11501    pub fn value_list(
11502        &self,
11503    ) -> std::option::Option<&std::boxed::Box<crate::model::ValueListFilter>> {
11504        #[allow(unreachable_patterns)]
11505        self.filter.as_ref().and_then(|v| match v {
11506            crate::model::value_transformation::Filter::ValueList(v) => {
11507                std::option::Option::Some(v)
11508            }
11509            _ => std::option::Option::None,
11510        })
11511    }
11512
11513    /// Sets the value of [filter][crate::model::ValueTransformation::filter]
11514    /// to hold a `ValueList`.
11515    ///
11516    /// Note that all the setters affecting `filter` are
11517    /// mutually exclusive.
11518    pub fn set_value_list<T: std::convert::Into<std::boxed::Box<crate::model::ValueListFilter>>>(
11519        mut self,
11520        v: T,
11521    ) -> Self {
11522        self.filter = std::option::Option::Some(
11523            crate::model::value_transformation::Filter::ValueList(v.into()),
11524        );
11525        self
11526    }
11527
11528    /// The value of [filter][crate::model::ValueTransformation::filter]
11529    /// if it holds a `IntComparison`, `None` if the field is not set or
11530    /// holds a different branch.
11531    pub fn int_comparison(
11532        &self,
11533    ) -> std::option::Option<&std::boxed::Box<crate::model::IntComparisonFilter>> {
11534        #[allow(unreachable_patterns)]
11535        self.filter.as_ref().and_then(|v| match v {
11536            crate::model::value_transformation::Filter::IntComparison(v) => {
11537                std::option::Option::Some(v)
11538            }
11539            _ => std::option::Option::None,
11540        })
11541    }
11542
11543    /// Sets the value of [filter][crate::model::ValueTransformation::filter]
11544    /// to hold a `IntComparison`.
11545    ///
11546    /// Note that all the setters affecting `filter` are
11547    /// mutually exclusive.
11548    pub fn set_int_comparison<
11549        T: std::convert::Into<std::boxed::Box<crate::model::IntComparisonFilter>>,
11550    >(
11551        mut self,
11552        v: T,
11553    ) -> Self {
11554        self.filter = std::option::Option::Some(
11555            crate::model::value_transformation::Filter::IntComparison(v.into()),
11556        );
11557        self
11558    }
11559
11560    /// The value of [filter][crate::model::ValueTransformation::filter]
11561    /// if it holds a `DoubleComparison`, `None` if the field is not set or
11562    /// holds a different branch.
11563    pub fn double_comparison(
11564        &self,
11565    ) -> std::option::Option<&std::boxed::Box<crate::model::DoubleComparisonFilter>> {
11566        #[allow(unreachable_patterns)]
11567        self.filter.as_ref().and_then(|v| match v {
11568            crate::model::value_transformation::Filter::DoubleComparison(v) => {
11569                std::option::Option::Some(v)
11570            }
11571            _ => std::option::Option::None,
11572        })
11573    }
11574
11575    /// Sets the value of [filter][crate::model::ValueTransformation::filter]
11576    /// to hold a `DoubleComparison`.
11577    ///
11578    /// Note that all the setters affecting `filter` are
11579    /// mutually exclusive.
11580    pub fn set_double_comparison<
11581        T: std::convert::Into<std::boxed::Box<crate::model::DoubleComparisonFilter>>,
11582    >(
11583        mut self,
11584        v: T,
11585    ) -> Self {
11586        self.filter = std::option::Option::Some(
11587            crate::model::value_transformation::Filter::DoubleComparison(v.into()),
11588        );
11589        self
11590    }
11591
11592    /// Sets the value of [action][crate::model::ValueTransformation::action].
11593    ///
11594    /// Note that all the setters affecting `action` are mutually
11595    /// exclusive.
11596    pub fn set_action<
11597        T: std::convert::Into<std::option::Option<crate::model::value_transformation::Action>>,
11598    >(
11599        mut self,
11600        v: T,
11601    ) -> Self {
11602        self.action = v.into();
11603        self
11604    }
11605
11606    /// The value of [action][crate::model::ValueTransformation::action]
11607    /// if it holds a `AssignNull`, `None` if the field is not set or
11608    /// holds a different branch.
11609    pub fn assign_null(&self) -> std::option::Option<&std::boxed::Box<wkt::Empty>> {
11610        #[allow(unreachable_patterns)]
11611        self.action.as_ref().and_then(|v| match v {
11612            crate::model::value_transformation::Action::AssignNull(v) => {
11613                std::option::Option::Some(v)
11614            }
11615            _ => std::option::Option::None,
11616        })
11617    }
11618
11619    /// Sets the value of [action][crate::model::ValueTransformation::action]
11620    /// to hold a `AssignNull`.
11621    ///
11622    /// Note that all the setters affecting `action` are
11623    /// mutually exclusive.
11624    pub fn set_assign_null<T: std::convert::Into<std::boxed::Box<wkt::Empty>>>(
11625        mut self,
11626        v: T,
11627    ) -> Self {
11628        self.action = std::option::Option::Some(
11629            crate::model::value_transformation::Action::AssignNull(v.into()),
11630        );
11631        self
11632    }
11633
11634    /// The value of [action][crate::model::ValueTransformation::action]
11635    /// if it holds a `AssignSpecificValue`, `None` if the field is not set or
11636    /// holds a different branch.
11637    pub fn assign_specific_value(
11638        &self,
11639    ) -> std::option::Option<&std::boxed::Box<crate::model::AssignSpecificValue>> {
11640        #[allow(unreachable_patterns)]
11641        self.action.as_ref().and_then(|v| match v {
11642            crate::model::value_transformation::Action::AssignSpecificValue(v) => {
11643                std::option::Option::Some(v)
11644            }
11645            _ => std::option::Option::None,
11646        })
11647    }
11648
11649    /// Sets the value of [action][crate::model::ValueTransformation::action]
11650    /// to hold a `AssignSpecificValue`.
11651    ///
11652    /// Note that all the setters affecting `action` are
11653    /// mutually exclusive.
11654    pub fn set_assign_specific_value<
11655        T: std::convert::Into<std::boxed::Box<crate::model::AssignSpecificValue>>,
11656    >(
11657        mut self,
11658        v: T,
11659    ) -> Self {
11660        self.action = std::option::Option::Some(
11661            crate::model::value_transformation::Action::AssignSpecificValue(v.into()),
11662        );
11663        self
11664    }
11665
11666    /// The value of [action][crate::model::ValueTransformation::action]
11667    /// if it holds a `AssignMinValue`, `None` if the field is not set or
11668    /// holds a different branch.
11669    pub fn assign_min_value(&self) -> std::option::Option<&std::boxed::Box<wkt::Empty>> {
11670        #[allow(unreachable_patterns)]
11671        self.action.as_ref().and_then(|v| match v {
11672            crate::model::value_transformation::Action::AssignMinValue(v) => {
11673                std::option::Option::Some(v)
11674            }
11675            _ => std::option::Option::None,
11676        })
11677    }
11678
11679    /// Sets the value of [action][crate::model::ValueTransformation::action]
11680    /// to hold a `AssignMinValue`.
11681    ///
11682    /// Note that all the setters affecting `action` are
11683    /// mutually exclusive.
11684    pub fn set_assign_min_value<T: std::convert::Into<std::boxed::Box<wkt::Empty>>>(
11685        mut self,
11686        v: T,
11687    ) -> Self {
11688        self.action = std::option::Option::Some(
11689            crate::model::value_transformation::Action::AssignMinValue(v.into()),
11690        );
11691        self
11692    }
11693
11694    /// The value of [action][crate::model::ValueTransformation::action]
11695    /// if it holds a `AssignMaxValue`, `None` if the field is not set or
11696    /// holds a different branch.
11697    pub fn assign_max_value(&self) -> std::option::Option<&std::boxed::Box<wkt::Empty>> {
11698        #[allow(unreachable_patterns)]
11699        self.action.as_ref().and_then(|v| match v {
11700            crate::model::value_transformation::Action::AssignMaxValue(v) => {
11701                std::option::Option::Some(v)
11702            }
11703            _ => std::option::Option::None,
11704        })
11705    }
11706
11707    /// Sets the value of [action][crate::model::ValueTransformation::action]
11708    /// to hold a `AssignMaxValue`.
11709    ///
11710    /// Note that all the setters affecting `action` are
11711    /// mutually exclusive.
11712    pub fn set_assign_max_value<T: std::convert::Into<std::boxed::Box<wkt::Empty>>>(
11713        mut self,
11714        v: T,
11715    ) -> Self {
11716        self.action = std::option::Option::Some(
11717            crate::model::value_transformation::Action::AssignMaxValue(v.into()),
11718        );
11719        self
11720    }
11721
11722    /// The value of [action][crate::model::ValueTransformation::action]
11723    /// if it holds a `RoundScale`, `None` if the field is not set or
11724    /// holds a different branch.
11725    pub fn round_scale(&self) -> std::option::Option<&std::boxed::Box<crate::model::RoundToScale>> {
11726        #[allow(unreachable_patterns)]
11727        self.action.as_ref().and_then(|v| match v {
11728            crate::model::value_transformation::Action::RoundScale(v) => {
11729                std::option::Option::Some(v)
11730            }
11731            _ => std::option::Option::None,
11732        })
11733    }
11734
11735    /// Sets the value of [action][crate::model::ValueTransformation::action]
11736    /// to hold a `RoundScale`.
11737    ///
11738    /// Note that all the setters affecting `action` are
11739    /// mutually exclusive.
11740    pub fn set_round_scale<T: std::convert::Into<std::boxed::Box<crate::model::RoundToScale>>>(
11741        mut self,
11742        v: T,
11743    ) -> Self {
11744        self.action = std::option::Option::Some(
11745            crate::model::value_transformation::Action::RoundScale(v.into()),
11746        );
11747        self
11748    }
11749
11750    /// The value of [action][crate::model::ValueTransformation::action]
11751    /// if it holds a `ApplyHash`, `None` if the field is not set or
11752    /// holds a different branch.
11753    pub fn apply_hash(&self) -> std::option::Option<&std::boxed::Box<crate::model::ApplyHash>> {
11754        #[allow(unreachable_patterns)]
11755        self.action.as_ref().and_then(|v| match v {
11756            crate::model::value_transformation::Action::ApplyHash(v) => {
11757                std::option::Option::Some(v)
11758            }
11759            _ => std::option::Option::None,
11760        })
11761    }
11762
11763    /// Sets the value of [action][crate::model::ValueTransformation::action]
11764    /// to hold a `ApplyHash`.
11765    ///
11766    /// Note that all the setters affecting `action` are
11767    /// mutually exclusive.
11768    pub fn set_apply_hash<T: std::convert::Into<std::boxed::Box<crate::model::ApplyHash>>>(
11769        mut self,
11770        v: T,
11771    ) -> Self {
11772        self.action = std::option::Option::Some(
11773            crate::model::value_transformation::Action::ApplyHash(v.into()),
11774        );
11775        self
11776    }
11777}
11778
11779impl wkt::message::Message for ValueTransformation {
11780    fn typename() -> &'static str {
11781        "type.googleapis.com/google.cloud.clouddms.v1.ValueTransformation"
11782    }
11783}
11784
11785/// Defines additional types related to [ValueTransformation].
11786pub mod value_transformation {
11787    #[allow(unused_imports)]
11788    use super::*;
11789
11790    #[derive(Clone, Debug, PartialEq)]
11791    #[non_exhaustive]
11792    pub enum Filter {
11793        /// Optional. Value is null
11794        IsNull(std::boxed::Box<wkt::Empty>),
11795        /// Optional. Value is found in the specified list.
11796        ValueList(std::boxed::Box<crate::model::ValueListFilter>),
11797        /// Optional. Filter on relation between source value and compare value of
11798        /// type integer.
11799        IntComparison(std::boxed::Box<crate::model::IntComparisonFilter>),
11800        /// Optional. Filter on relation between source value and compare value of
11801        /// type double.
11802        DoubleComparison(std::boxed::Box<crate::model::DoubleComparisonFilter>),
11803    }
11804
11805    #[derive(Clone, Debug, PartialEq)]
11806    #[non_exhaustive]
11807    pub enum Action {
11808        /// Optional. Set to null
11809        AssignNull(std::boxed::Box<wkt::Empty>),
11810        /// Optional. Set to a specific value (value is converted to fit the target
11811        /// data type)
11812        AssignSpecificValue(std::boxed::Box<crate::model::AssignSpecificValue>),
11813        /// Optional. Set to min_value - if integer or numeric, will use
11814        /// int.minvalue, etc
11815        AssignMinValue(std::boxed::Box<wkt::Empty>),
11816        /// Optional. Set to max_value - if integer or numeric, will use
11817        /// int.maxvalue, etc
11818        AssignMaxValue(std::boxed::Box<wkt::Empty>),
11819        /// Optional. Allows the data to change scale
11820        RoundScale(std::boxed::Box<crate::model::RoundToScale>),
11821        /// Optional. Applies a hash function on the data
11822        ApplyHash(std::boxed::Box<crate::model::ApplyHash>),
11823    }
11824}
11825
11826/// Options to configure rule type ConvertROWIDToColumn.
11827/// The rule is used to add column rowid to destination tables based on an Oracle
11828/// rowid function/property.
11829///
11830/// The rule filter field can refer to one or more entities.
11831///
11832/// The rule scope can be one of: Table.
11833///
11834/// This rule requires additional filter to be specified beyond the basic rule
11835/// filter field, which is whether or not to work on tables which already have a
11836/// primary key defined.
11837#[derive(Clone, Default, PartialEq)]
11838#[non_exhaustive]
11839pub struct ConvertRowIdToColumn {
11840    /// Required. Only work on tables without primary key defined
11841    pub only_if_no_primary_key: bool,
11842
11843    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11844}
11845
11846impl ConvertRowIdToColumn {
11847    pub fn new() -> Self {
11848        std::default::Default::default()
11849    }
11850
11851    /// Sets the value of [only_if_no_primary_key][crate::model::ConvertRowIdToColumn::only_if_no_primary_key].
11852    pub fn set_only_if_no_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11853        self.only_if_no_primary_key = v.into();
11854        self
11855    }
11856}
11857
11858impl wkt::message::Message for ConvertRowIdToColumn {
11859    fn typename() -> &'static str {
11860        "type.googleapis.com/google.cloud.clouddms.v1.ConvertRowIdToColumn"
11861    }
11862}
11863
11864/// Options to configure rule type SetTablePrimaryKey.
11865/// The rule is used to specify the columns and name to configure/alter the
11866/// primary key of a table.
11867///
11868/// The rule filter field can refer to one entity.
11869///
11870/// The rule scope can be one of: Table.
11871#[derive(Clone, Default, PartialEq)]
11872#[non_exhaustive]
11873pub struct SetTablePrimaryKey {
11874    /// Required. List of column names for the primary key
11875    pub primary_key_columns: std::vec::Vec<std::string::String>,
11876
11877    /// Optional. Name for the primary key
11878    pub primary_key: std::string::String,
11879
11880    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11881}
11882
11883impl SetTablePrimaryKey {
11884    pub fn new() -> Self {
11885        std::default::Default::default()
11886    }
11887
11888    /// Sets the value of [primary_key_columns][crate::model::SetTablePrimaryKey::primary_key_columns].
11889    pub fn set_primary_key_columns<T, V>(mut self, v: T) -> Self
11890    where
11891        T: std::iter::IntoIterator<Item = V>,
11892        V: std::convert::Into<std::string::String>,
11893    {
11894        use std::iter::Iterator;
11895        self.primary_key_columns = v.into_iter().map(|i| i.into()).collect();
11896        self
11897    }
11898
11899    /// Sets the value of [primary_key][crate::model::SetTablePrimaryKey::primary_key].
11900    pub fn set_primary_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11901        self.primary_key = v.into();
11902        self
11903    }
11904}
11905
11906impl wkt::message::Message for SetTablePrimaryKey {
11907    fn typename() -> &'static str {
11908        "type.googleapis.com/google.cloud.clouddms.v1.SetTablePrimaryKey"
11909    }
11910}
11911
11912/// Options to configure rule type SinglePackageChange.
11913/// The rule is used to alter the sql code for a package entities.
11914///
11915/// The rule filter field can refer to one entity.
11916///
11917/// The rule scope can be: Package
11918#[derive(Clone, Default, PartialEq)]
11919#[non_exhaustive]
11920pub struct SinglePackageChange {
11921    /// Optional. Sql code for package description
11922    pub package_description: std::string::String,
11923
11924    /// Optional. Sql code for package body
11925    pub package_body: std::string::String,
11926
11927    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11928}
11929
11930impl SinglePackageChange {
11931    pub fn new() -> Self {
11932        std::default::Default::default()
11933    }
11934
11935    /// Sets the value of [package_description][crate::model::SinglePackageChange::package_description].
11936    pub fn set_package_description<T: std::convert::Into<std::string::String>>(
11937        mut self,
11938        v: T,
11939    ) -> Self {
11940        self.package_description = v.into();
11941        self
11942    }
11943
11944    /// Sets the value of [package_body][crate::model::SinglePackageChange::package_body].
11945    pub fn set_package_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11946        self.package_body = v.into();
11947        self
11948    }
11949}
11950
11951impl wkt::message::Message for SinglePackageChange {
11952    fn typename() -> &'static str {
11953        "type.googleapis.com/google.cloud.clouddms.v1.SinglePackageChange"
11954    }
11955}
11956
11957/// Options to configure rule type SourceSqlChange.
11958/// The rule is used to alter the sql code for database entities.
11959///
11960/// The rule filter field can refer to one entity.
11961///
11962/// The rule scope can be: StoredProcedure, Function, Trigger, View
11963#[derive(Clone, Default, PartialEq)]
11964#[non_exhaustive]
11965pub struct SourceSqlChange {
11966    /// Required. Sql code for source (stored procedure, function, trigger or view)
11967    pub sql_code: std::string::String,
11968
11969    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11970}
11971
11972impl SourceSqlChange {
11973    pub fn new() -> Self {
11974        std::default::Default::default()
11975    }
11976
11977    /// Sets the value of [sql_code][crate::model::SourceSqlChange::sql_code].
11978    pub fn set_sql_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11979        self.sql_code = v.into();
11980        self
11981    }
11982}
11983
11984impl wkt::message::Message for SourceSqlChange {
11985    fn typename() -> &'static str {
11986        "type.googleapis.com/google.cloud.clouddms.v1.SourceSqlChange"
11987    }
11988}
11989
11990/// Options to configure rule type FilterTableColumns.
11991/// The rule is used to filter the list of columns to include or exclude from a
11992/// table.
11993///
11994/// The rule filter field can refer to one entity.
11995///
11996/// The rule scope can be: Table
11997///
11998/// Only one of the two lists can be specified for the rule.
11999#[derive(Clone, Default, PartialEq)]
12000#[non_exhaustive]
12001pub struct FilterTableColumns {
12002    /// Optional. List of columns to be included for a particular table.
12003    pub include_columns: std::vec::Vec<std::string::String>,
12004
12005    /// Optional. List of columns to be excluded for a particular table.
12006    pub exclude_columns: std::vec::Vec<std::string::String>,
12007
12008    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12009}
12010
12011impl FilterTableColumns {
12012    pub fn new() -> Self {
12013        std::default::Default::default()
12014    }
12015
12016    /// Sets the value of [include_columns][crate::model::FilterTableColumns::include_columns].
12017    pub fn set_include_columns<T, V>(mut self, v: T) -> Self
12018    where
12019        T: std::iter::IntoIterator<Item = V>,
12020        V: std::convert::Into<std::string::String>,
12021    {
12022        use std::iter::Iterator;
12023        self.include_columns = v.into_iter().map(|i| i.into()).collect();
12024        self
12025    }
12026
12027    /// Sets the value of [exclude_columns][crate::model::FilterTableColumns::exclude_columns].
12028    pub fn set_exclude_columns<T, V>(mut self, v: T) -> Self
12029    where
12030        T: std::iter::IntoIterator<Item = V>,
12031        V: std::convert::Into<std::string::String>,
12032    {
12033        use std::iter::Iterator;
12034        self.exclude_columns = v.into_iter().map(|i| i.into()).collect();
12035        self
12036    }
12037}
12038
12039impl wkt::message::Message for FilterTableColumns {
12040    fn typename() -> &'static str {
12041        "type.googleapis.com/google.cloud.clouddms.v1.FilterTableColumns"
12042    }
12043}
12044
12045/// A list of values to filter by in ConditionalColumnSetValue
12046#[derive(Clone, Default, PartialEq)]
12047#[non_exhaustive]
12048pub struct ValueListFilter {
12049    /// Required. Indicates whether the filter matches rows with values that are
12050    /// present in the list or those with values not present in it.
12051    pub value_present_list: crate::model::ValuePresentInList,
12052
12053    /// Required. The list to be used to filter by
12054    pub values: std::vec::Vec<std::string::String>,
12055
12056    /// Required. Whether to ignore case when filtering by values. Defaults to
12057    /// false
12058    pub ignore_case: bool,
12059
12060    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12061}
12062
12063impl ValueListFilter {
12064    pub fn new() -> Self {
12065        std::default::Default::default()
12066    }
12067
12068    /// Sets the value of [value_present_list][crate::model::ValueListFilter::value_present_list].
12069    pub fn set_value_present_list<T: std::convert::Into<crate::model::ValuePresentInList>>(
12070        mut self,
12071        v: T,
12072    ) -> Self {
12073        self.value_present_list = v.into();
12074        self
12075    }
12076
12077    /// Sets the value of [values][crate::model::ValueListFilter::values].
12078    pub fn set_values<T, V>(mut self, v: T) -> Self
12079    where
12080        T: std::iter::IntoIterator<Item = V>,
12081        V: std::convert::Into<std::string::String>,
12082    {
12083        use std::iter::Iterator;
12084        self.values = v.into_iter().map(|i| i.into()).collect();
12085        self
12086    }
12087
12088    /// Sets the value of [ignore_case][crate::model::ValueListFilter::ignore_case].
12089    pub fn set_ignore_case<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12090        self.ignore_case = v.into();
12091        self
12092    }
12093}
12094
12095impl wkt::message::Message for ValueListFilter {
12096    fn typename() -> &'static str {
12097        "type.googleapis.com/google.cloud.clouddms.v1.ValueListFilter"
12098    }
12099}
12100
12101/// Filter based on relation between source value and compare value of type
12102/// integer in ConditionalColumnSetValue
12103#[derive(Clone, Default, PartialEq)]
12104#[non_exhaustive]
12105pub struct IntComparisonFilter {
12106    /// Required. Relation between source value and compare value
12107    pub value_comparison: crate::model::ValueComparison,
12108
12109    /// Required. Integer compare value to be used
12110    pub value: i64,
12111
12112    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12113}
12114
12115impl IntComparisonFilter {
12116    pub fn new() -> Self {
12117        std::default::Default::default()
12118    }
12119
12120    /// Sets the value of [value_comparison][crate::model::IntComparisonFilter::value_comparison].
12121    pub fn set_value_comparison<T: std::convert::Into<crate::model::ValueComparison>>(
12122        mut self,
12123        v: T,
12124    ) -> Self {
12125        self.value_comparison = v.into();
12126        self
12127    }
12128
12129    /// Sets the value of [value][crate::model::IntComparisonFilter::value].
12130    pub fn set_value<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12131        self.value = v.into();
12132        self
12133    }
12134}
12135
12136impl wkt::message::Message for IntComparisonFilter {
12137    fn typename() -> &'static str {
12138        "type.googleapis.com/google.cloud.clouddms.v1.IntComparisonFilter"
12139    }
12140}
12141
12142/// Filter based on relation between source
12143/// value and compare value of type double in ConditionalColumnSetValue
12144#[derive(Clone, Default, PartialEq)]
12145#[non_exhaustive]
12146pub struct DoubleComparisonFilter {
12147    /// Required. Relation between source value and compare value
12148    pub value_comparison: crate::model::ValueComparison,
12149
12150    /// Required. Double compare value to be used
12151    pub value: f64,
12152
12153    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12154}
12155
12156impl DoubleComparisonFilter {
12157    pub fn new() -> Self {
12158        std::default::Default::default()
12159    }
12160
12161    /// Sets the value of [value_comparison][crate::model::DoubleComparisonFilter::value_comparison].
12162    pub fn set_value_comparison<T: std::convert::Into<crate::model::ValueComparison>>(
12163        mut self,
12164        v: T,
12165    ) -> Self {
12166        self.value_comparison = v.into();
12167        self
12168    }
12169
12170    /// Sets the value of [value][crate::model::DoubleComparisonFilter::value].
12171    pub fn set_value<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
12172        self.value = v.into();
12173        self
12174    }
12175}
12176
12177impl wkt::message::Message for DoubleComparisonFilter {
12178    fn typename() -> &'static str {
12179        "type.googleapis.com/google.cloud.clouddms.v1.DoubleComparisonFilter"
12180    }
12181}
12182
12183/// Set to a specific value (value is converted to fit the target data type)
12184#[derive(Clone, Default, PartialEq)]
12185#[non_exhaustive]
12186pub struct AssignSpecificValue {
12187    /// Required. Specific value to be assigned
12188    pub value: std::string::String,
12189
12190    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12191}
12192
12193impl AssignSpecificValue {
12194    pub fn new() -> Self {
12195        std::default::Default::default()
12196    }
12197
12198    /// Sets the value of [value][crate::model::AssignSpecificValue::value].
12199    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12200        self.value = v.into();
12201        self
12202    }
12203}
12204
12205impl wkt::message::Message for AssignSpecificValue {
12206    fn typename() -> &'static str {
12207        "type.googleapis.com/google.cloud.clouddms.v1.AssignSpecificValue"
12208    }
12209}
12210
12211/// Apply a hash function on the value.
12212#[derive(Clone, Default, PartialEq)]
12213#[non_exhaustive]
12214pub struct ApplyHash {
12215    pub hash_function: std::option::Option<crate::model::apply_hash::HashFunction>,
12216
12217    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12218}
12219
12220impl ApplyHash {
12221    pub fn new() -> Self {
12222        std::default::Default::default()
12223    }
12224
12225    /// Sets the value of [hash_function][crate::model::ApplyHash::hash_function].
12226    ///
12227    /// Note that all the setters affecting `hash_function` are mutually
12228    /// exclusive.
12229    pub fn set_hash_function<
12230        T: std::convert::Into<std::option::Option<crate::model::apply_hash::HashFunction>>,
12231    >(
12232        mut self,
12233        v: T,
12234    ) -> Self {
12235        self.hash_function = v.into();
12236        self
12237    }
12238
12239    /// The value of [hash_function][crate::model::ApplyHash::hash_function]
12240    /// if it holds a `UuidFromBytes`, `None` if the field is not set or
12241    /// holds a different branch.
12242    pub fn uuid_from_bytes(&self) -> std::option::Option<&std::boxed::Box<wkt::Empty>> {
12243        #[allow(unreachable_patterns)]
12244        self.hash_function.as_ref().and_then(|v| match v {
12245            crate::model::apply_hash::HashFunction::UuidFromBytes(v) => {
12246                std::option::Option::Some(v)
12247            }
12248            _ => std::option::Option::None,
12249        })
12250    }
12251
12252    /// Sets the value of [hash_function][crate::model::ApplyHash::hash_function]
12253    /// to hold a `UuidFromBytes`.
12254    ///
12255    /// Note that all the setters affecting `hash_function` are
12256    /// mutually exclusive.
12257    pub fn set_uuid_from_bytes<T: std::convert::Into<std::boxed::Box<wkt::Empty>>>(
12258        mut self,
12259        v: T,
12260    ) -> Self {
12261        self.hash_function = std::option::Option::Some(
12262            crate::model::apply_hash::HashFunction::UuidFromBytes(v.into()),
12263        );
12264        self
12265    }
12266}
12267
12268impl wkt::message::Message for ApplyHash {
12269    fn typename() -> &'static str {
12270        "type.googleapis.com/google.cloud.clouddms.v1.ApplyHash"
12271    }
12272}
12273
12274/// Defines additional types related to [ApplyHash].
12275pub mod apply_hash {
12276    #[allow(unused_imports)]
12277    use super::*;
12278
12279    #[derive(Clone, Debug, PartialEq)]
12280    #[non_exhaustive]
12281    pub enum HashFunction {
12282        /// Optional. Generate UUID from the data's byte array
12283        UuidFromBytes(std::boxed::Box<wkt::Empty>),
12284    }
12285}
12286
12287/// This allows the data to change scale, for example if the source is 2 digits
12288/// after the decimal point, specify round to scale value = 2. If for example the
12289/// value needs to be converted to an integer, use round to scale value = 0.
12290#[derive(Clone, Default, PartialEq)]
12291#[non_exhaustive]
12292pub struct RoundToScale {
12293    /// Required. Scale value to be used
12294    pub scale: i32,
12295
12296    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12297}
12298
12299impl RoundToScale {
12300    pub fn new() -> Self {
12301        std::default::Default::default()
12302    }
12303
12304    /// Sets the value of [scale][crate::model::RoundToScale::scale].
12305    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12306        self.scale = v.into();
12307        self
12308    }
12309}
12310
12311impl wkt::message::Message for RoundToScale {
12312    fn typename() -> &'static str {
12313        "type.googleapis.com/google.cloud.clouddms.v1.RoundToScale"
12314    }
12315}
12316
12317/// The base entity type for all the database related entities.
12318/// The message contains the entity name, the name of its parent, the entity
12319/// type, and the specific details per entity type.
12320#[derive(Clone, Default, PartialEq)]
12321#[non_exhaustive]
12322pub struct DatabaseEntity {
12323    /// The short name (e.g. table name) of the entity.
12324    pub short_name: std::string::String,
12325
12326    /// The full name of the parent entity (e.g. schema name).
12327    pub parent_entity: std::string::String,
12328
12329    /// The type of tree the entity belongs to.
12330    pub tree: crate::model::database_entity::TreeType,
12331
12332    /// The type of the database entity (table, view, index, ...).
12333    pub entity_type: crate::model::DatabaseEntityType,
12334
12335    /// Details about entity mappings.
12336    /// For source tree entities, this holds the draft entities which were
12337    /// generated by the mapping rules.
12338    /// For draft tree entities, this holds the source entities which were
12339    /// converted to form the draft entity.
12340    /// Destination entities will have no mapping details.
12341    pub mappings: std::vec::Vec<crate::model::EntityMapping>,
12342
12343    /// Details about the entity DDL script. Multiple DDL scripts are provided for
12344    /// child entities such as a table entity will have one DDL for the table with
12345    /// additional DDLs for each index, constraint and such.
12346    pub entity_ddl: std::vec::Vec<crate::model::EntityDdl>,
12347
12348    /// Details about the various issues found for the entity.
12349    pub issues: std::vec::Vec<crate::model::EntityIssue>,
12350
12351    /// The specific body for each entity type.
12352    pub entity_body: std::option::Option<crate::model::database_entity::EntityBody>,
12353
12354    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12355}
12356
12357impl DatabaseEntity {
12358    pub fn new() -> Self {
12359        std::default::Default::default()
12360    }
12361
12362    /// Sets the value of [short_name][crate::model::DatabaseEntity::short_name].
12363    pub fn set_short_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12364        self.short_name = v.into();
12365        self
12366    }
12367
12368    /// Sets the value of [parent_entity][crate::model::DatabaseEntity::parent_entity].
12369    pub fn set_parent_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12370        self.parent_entity = v.into();
12371        self
12372    }
12373
12374    /// Sets the value of [tree][crate::model::DatabaseEntity::tree].
12375    pub fn set_tree<T: std::convert::Into<crate::model::database_entity::TreeType>>(
12376        mut self,
12377        v: T,
12378    ) -> Self {
12379        self.tree = v.into();
12380        self
12381    }
12382
12383    /// Sets the value of [entity_type][crate::model::DatabaseEntity::entity_type].
12384    pub fn set_entity_type<T: std::convert::Into<crate::model::DatabaseEntityType>>(
12385        mut self,
12386        v: T,
12387    ) -> Self {
12388        self.entity_type = v.into();
12389        self
12390    }
12391
12392    /// Sets the value of [mappings][crate::model::DatabaseEntity::mappings].
12393    pub fn set_mappings<T, V>(mut self, v: T) -> Self
12394    where
12395        T: std::iter::IntoIterator<Item = V>,
12396        V: std::convert::Into<crate::model::EntityMapping>,
12397    {
12398        use std::iter::Iterator;
12399        self.mappings = v.into_iter().map(|i| i.into()).collect();
12400        self
12401    }
12402
12403    /// Sets the value of [entity_ddl][crate::model::DatabaseEntity::entity_ddl].
12404    pub fn set_entity_ddl<T, V>(mut self, v: T) -> Self
12405    where
12406        T: std::iter::IntoIterator<Item = V>,
12407        V: std::convert::Into<crate::model::EntityDdl>,
12408    {
12409        use std::iter::Iterator;
12410        self.entity_ddl = v.into_iter().map(|i| i.into()).collect();
12411        self
12412    }
12413
12414    /// Sets the value of [issues][crate::model::DatabaseEntity::issues].
12415    pub fn set_issues<T, V>(mut self, v: T) -> Self
12416    where
12417        T: std::iter::IntoIterator<Item = V>,
12418        V: std::convert::Into<crate::model::EntityIssue>,
12419    {
12420        use std::iter::Iterator;
12421        self.issues = v.into_iter().map(|i| i.into()).collect();
12422        self
12423    }
12424
12425    /// Sets the value of [entity_body][crate::model::DatabaseEntity::entity_body].
12426    ///
12427    /// Note that all the setters affecting `entity_body` are mutually
12428    /// exclusive.
12429    pub fn set_entity_body<
12430        T: std::convert::Into<std::option::Option<crate::model::database_entity::EntityBody>>,
12431    >(
12432        mut self,
12433        v: T,
12434    ) -> Self {
12435        self.entity_body = v.into();
12436        self
12437    }
12438
12439    /// The value of [entity_body][crate::model::DatabaseEntity::entity_body]
12440    /// if it holds a `Database`, `None` if the field is not set or
12441    /// holds a different branch.
12442    pub fn database(
12443        &self,
12444    ) -> std::option::Option<&std::boxed::Box<crate::model::DatabaseInstanceEntity>> {
12445        #[allow(unreachable_patterns)]
12446        self.entity_body.as_ref().and_then(|v| match v {
12447            crate::model::database_entity::EntityBody::Database(v) => std::option::Option::Some(v),
12448            _ => std::option::Option::None,
12449        })
12450    }
12451
12452    /// Sets the value of [entity_body][crate::model::DatabaseEntity::entity_body]
12453    /// to hold a `Database`.
12454    ///
12455    /// Note that all the setters affecting `entity_body` are
12456    /// mutually exclusive.
12457    pub fn set_database<
12458        T: std::convert::Into<std::boxed::Box<crate::model::DatabaseInstanceEntity>>,
12459    >(
12460        mut self,
12461        v: T,
12462    ) -> Self {
12463        self.entity_body = std::option::Option::Some(
12464            crate::model::database_entity::EntityBody::Database(v.into()),
12465        );
12466        self
12467    }
12468
12469    /// The value of [entity_body][crate::model::DatabaseEntity::entity_body]
12470    /// if it holds a `Schema`, `None` if the field is not set or
12471    /// holds a different branch.
12472    pub fn schema(&self) -> std::option::Option<&std::boxed::Box<crate::model::SchemaEntity>> {
12473        #[allow(unreachable_patterns)]
12474        self.entity_body.as_ref().and_then(|v| match v {
12475            crate::model::database_entity::EntityBody::Schema(v) => std::option::Option::Some(v),
12476            _ => std::option::Option::None,
12477        })
12478    }
12479
12480    /// Sets the value of [entity_body][crate::model::DatabaseEntity::entity_body]
12481    /// to hold a `Schema`.
12482    ///
12483    /// Note that all the setters affecting `entity_body` are
12484    /// mutually exclusive.
12485    pub fn set_schema<T: std::convert::Into<std::boxed::Box<crate::model::SchemaEntity>>>(
12486        mut self,
12487        v: T,
12488    ) -> Self {
12489        self.entity_body =
12490            std::option::Option::Some(crate::model::database_entity::EntityBody::Schema(v.into()));
12491        self
12492    }
12493
12494    /// The value of [entity_body][crate::model::DatabaseEntity::entity_body]
12495    /// if it holds a `Table`, `None` if the field is not set or
12496    /// holds a different branch.
12497    pub fn table(&self) -> std::option::Option<&std::boxed::Box<crate::model::TableEntity>> {
12498        #[allow(unreachable_patterns)]
12499        self.entity_body.as_ref().and_then(|v| match v {
12500            crate::model::database_entity::EntityBody::Table(v) => std::option::Option::Some(v),
12501            _ => std::option::Option::None,
12502        })
12503    }
12504
12505    /// Sets the value of [entity_body][crate::model::DatabaseEntity::entity_body]
12506    /// to hold a `Table`.
12507    ///
12508    /// Note that all the setters affecting `entity_body` are
12509    /// mutually exclusive.
12510    pub fn set_table<T: std::convert::Into<std::boxed::Box<crate::model::TableEntity>>>(
12511        mut self,
12512        v: T,
12513    ) -> Self {
12514        self.entity_body =
12515            std::option::Option::Some(crate::model::database_entity::EntityBody::Table(v.into()));
12516        self
12517    }
12518
12519    /// The value of [entity_body][crate::model::DatabaseEntity::entity_body]
12520    /// if it holds a `View`, `None` if the field is not set or
12521    /// holds a different branch.
12522    pub fn view(&self) -> std::option::Option<&std::boxed::Box<crate::model::ViewEntity>> {
12523        #[allow(unreachable_patterns)]
12524        self.entity_body.as_ref().and_then(|v| match v {
12525            crate::model::database_entity::EntityBody::View(v) => std::option::Option::Some(v),
12526            _ => std::option::Option::None,
12527        })
12528    }
12529
12530    /// Sets the value of [entity_body][crate::model::DatabaseEntity::entity_body]
12531    /// to hold a `View`.
12532    ///
12533    /// Note that all the setters affecting `entity_body` are
12534    /// mutually exclusive.
12535    pub fn set_view<T: std::convert::Into<std::boxed::Box<crate::model::ViewEntity>>>(
12536        mut self,
12537        v: T,
12538    ) -> Self {
12539        self.entity_body =
12540            std::option::Option::Some(crate::model::database_entity::EntityBody::View(v.into()));
12541        self
12542    }
12543
12544    /// The value of [entity_body][crate::model::DatabaseEntity::entity_body]
12545    /// if it holds a `Sequence`, `None` if the field is not set or
12546    /// holds a different branch.
12547    pub fn sequence(&self) -> std::option::Option<&std::boxed::Box<crate::model::SequenceEntity>> {
12548        #[allow(unreachable_patterns)]
12549        self.entity_body.as_ref().and_then(|v| match v {
12550            crate::model::database_entity::EntityBody::Sequence(v) => std::option::Option::Some(v),
12551            _ => std::option::Option::None,
12552        })
12553    }
12554
12555    /// Sets the value of [entity_body][crate::model::DatabaseEntity::entity_body]
12556    /// to hold a `Sequence`.
12557    ///
12558    /// Note that all the setters affecting `entity_body` are
12559    /// mutually exclusive.
12560    pub fn set_sequence<T: std::convert::Into<std::boxed::Box<crate::model::SequenceEntity>>>(
12561        mut self,
12562        v: T,
12563    ) -> Self {
12564        self.entity_body = std::option::Option::Some(
12565            crate::model::database_entity::EntityBody::Sequence(v.into()),
12566        );
12567        self
12568    }
12569
12570    /// The value of [entity_body][crate::model::DatabaseEntity::entity_body]
12571    /// if it holds a `StoredProcedure`, `None` if the field is not set or
12572    /// holds a different branch.
12573    pub fn stored_procedure(
12574        &self,
12575    ) -> std::option::Option<&std::boxed::Box<crate::model::StoredProcedureEntity>> {
12576        #[allow(unreachable_patterns)]
12577        self.entity_body.as_ref().and_then(|v| match v {
12578            crate::model::database_entity::EntityBody::StoredProcedure(v) => {
12579                std::option::Option::Some(v)
12580            }
12581            _ => std::option::Option::None,
12582        })
12583    }
12584
12585    /// Sets the value of [entity_body][crate::model::DatabaseEntity::entity_body]
12586    /// to hold a `StoredProcedure`.
12587    ///
12588    /// Note that all the setters affecting `entity_body` are
12589    /// mutually exclusive.
12590    pub fn set_stored_procedure<
12591        T: std::convert::Into<std::boxed::Box<crate::model::StoredProcedureEntity>>,
12592    >(
12593        mut self,
12594        v: T,
12595    ) -> Self {
12596        self.entity_body = std::option::Option::Some(
12597            crate::model::database_entity::EntityBody::StoredProcedure(v.into()),
12598        );
12599        self
12600    }
12601
12602    /// The value of [entity_body][crate::model::DatabaseEntity::entity_body]
12603    /// if it holds a `DatabaseFunction`, `None` if the field is not set or
12604    /// holds a different branch.
12605    pub fn database_function(
12606        &self,
12607    ) -> std::option::Option<&std::boxed::Box<crate::model::FunctionEntity>> {
12608        #[allow(unreachable_patterns)]
12609        self.entity_body.as_ref().and_then(|v| match v {
12610            crate::model::database_entity::EntityBody::DatabaseFunction(v) => {
12611                std::option::Option::Some(v)
12612            }
12613            _ => std::option::Option::None,
12614        })
12615    }
12616
12617    /// Sets the value of [entity_body][crate::model::DatabaseEntity::entity_body]
12618    /// to hold a `DatabaseFunction`.
12619    ///
12620    /// Note that all the setters affecting `entity_body` are
12621    /// mutually exclusive.
12622    pub fn set_database_function<
12623        T: std::convert::Into<std::boxed::Box<crate::model::FunctionEntity>>,
12624    >(
12625        mut self,
12626        v: T,
12627    ) -> Self {
12628        self.entity_body = std::option::Option::Some(
12629            crate::model::database_entity::EntityBody::DatabaseFunction(v.into()),
12630        );
12631        self
12632    }
12633
12634    /// The value of [entity_body][crate::model::DatabaseEntity::entity_body]
12635    /// if it holds a `Synonym`, `None` if the field is not set or
12636    /// holds a different branch.
12637    pub fn synonym(&self) -> std::option::Option<&std::boxed::Box<crate::model::SynonymEntity>> {
12638        #[allow(unreachable_patterns)]
12639        self.entity_body.as_ref().and_then(|v| match v {
12640            crate::model::database_entity::EntityBody::Synonym(v) => std::option::Option::Some(v),
12641            _ => std::option::Option::None,
12642        })
12643    }
12644
12645    /// Sets the value of [entity_body][crate::model::DatabaseEntity::entity_body]
12646    /// to hold a `Synonym`.
12647    ///
12648    /// Note that all the setters affecting `entity_body` are
12649    /// mutually exclusive.
12650    pub fn set_synonym<T: std::convert::Into<std::boxed::Box<crate::model::SynonymEntity>>>(
12651        mut self,
12652        v: T,
12653    ) -> Self {
12654        self.entity_body =
12655            std::option::Option::Some(crate::model::database_entity::EntityBody::Synonym(v.into()));
12656        self
12657    }
12658
12659    /// The value of [entity_body][crate::model::DatabaseEntity::entity_body]
12660    /// if it holds a `DatabasePackage`, `None` if the field is not set or
12661    /// holds a different branch.
12662    pub fn database_package(
12663        &self,
12664    ) -> std::option::Option<&std::boxed::Box<crate::model::PackageEntity>> {
12665        #[allow(unreachable_patterns)]
12666        self.entity_body.as_ref().and_then(|v| match v {
12667            crate::model::database_entity::EntityBody::DatabasePackage(v) => {
12668                std::option::Option::Some(v)
12669            }
12670            _ => std::option::Option::None,
12671        })
12672    }
12673
12674    /// Sets the value of [entity_body][crate::model::DatabaseEntity::entity_body]
12675    /// to hold a `DatabasePackage`.
12676    ///
12677    /// Note that all the setters affecting `entity_body` are
12678    /// mutually exclusive.
12679    pub fn set_database_package<
12680        T: std::convert::Into<std::boxed::Box<crate::model::PackageEntity>>,
12681    >(
12682        mut self,
12683        v: T,
12684    ) -> Self {
12685        self.entity_body = std::option::Option::Some(
12686            crate::model::database_entity::EntityBody::DatabasePackage(v.into()),
12687        );
12688        self
12689    }
12690
12691    /// The value of [entity_body][crate::model::DatabaseEntity::entity_body]
12692    /// if it holds a `Udt`, `None` if the field is not set or
12693    /// holds a different branch.
12694    pub fn udt(&self) -> std::option::Option<&std::boxed::Box<crate::model::UDTEntity>> {
12695        #[allow(unreachable_patterns)]
12696        self.entity_body.as_ref().and_then(|v| match v {
12697            crate::model::database_entity::EntityBody::Udt(v) => std::option::Option::Some(v),
12698            _ => std::option::Option::None,
12699        })
12700    }
12701
12702    /// Sets the value of [entity_body][crate::model::DatabaseEntity::entity_body]
12703    /// to hold a `Udt`.
12704    ///
12705    /// Note that all the setters affecting `entity_body` are
12706    /// mutually exclusive.
12707    pub fn set_udt<T: std::convert::Into<std::boxed::Box<crate::model::UDTEntity>>>(
12708        mut self,
12709        v: T,
12710    ) -> Self {
12711        self.entity_body =
12712            std::option::Option::Some(crate::model::database_entity::EntityBody::Udt(v.into()));
12713        self
12714    }
12715
12716    /// The value of [entity_body][crate::model::DatabaseEntity::entity_body]
12717    /// if it holds a `MaterializedView`, `None` if the field is not set or
12718    /// holds a different branch.
12719    pub fn materialized_view(
12720        &self,
12721    ) -> std::option::Option<&std::boxed::Box<crate::model::MaterializedViewEntity>> {
12722        #[allow(unreachable_patterns)]
12723        self.entity_body.as_ref().and_then(|v| match v {
12724            crate::model::database_entity::EntityBody::MaterializedView(v) => {
12725                std::option::Option::Some(v)
12726            }
12727            _ => std::option::Option::None,
12728        })
12729    }
12730
12731    /// Sets the value of [entity_body][crate::model::DatabaseEntity::entity_body]
12732    /// to hold a `MaterializedView`.
12733    ///
12734    /// Note that all the setters affecting `entity_body` are
12735    /// mutually exclusive.
12736    pub fn set_materialized_view<
12737        T: std::convert::Into<std::boxed::Box<crate::model::MaterializedViewEntity>>,
12738    >(
12739        mut self,
12740        v: T,
12741    ) -> Self {
12742        self.entity_body = std::option::Option::Some(
12743            crate::model::database_entity::EntityBody::MaterializedView(v.into()),
12744        );
12745        self
12746    }
12747}
12748
12749impl wkt::message::Message for DatabaseEntity {
12750    fn typename() -> &'static str {
12751        "type.googleapis.com/google.cloud.clouddms.v1.DatabaseEntity"
12752    }
12753}
12754
12755/// Defines additional types related to [DatabaseEntity].
12756pub mod database_entity {
12757    #[allow(unused_imports)]
12758    use super::*;
12759
12760    /// The type of database entities tree.
12761    ///
12762    /// # Working with unknown values
12763    ///
12764    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12765    /// additional enum variants at any time. Adding new variants is not considered
12766    /// a breaking change. Applications should write their code in anticipation of:
12767    ///
12768    /// - New values appearing in future releases of the client library, **and**
12769    /// - New values received dynamically, without application changes.
12770    ///
12771    /// Please consult the [Working with enums] section in the user guide for some
12772    /// guidelines.
12773    ///
12774    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12775    #[derive(Clone, Debug, PartialEq)]
12776    #[non_exhaustive]
12777    pub enum TreeType {
12778        /// Tree type unspecified.
12779        Unspecified,
12780        /// Tree of entities loaded from a source database.
12781        Source,
12782        /// Tree of entities converted from the source tree using the mapping rules.
12783        Draft,
12784        /// Tree of entities observed on the destination database.
12785        Destination,
12786        /// If set, the enum was initialized with an unknown value.
12787        ///
12788        /// Applications can examine the value using [TreeType::value] or
12789        /// [TreeType::name].
12790        UnknownValue(tree_type::UnknownValue),
12791    }
12792
12793    #[doc(hidden)]
12794    pub mod tree_type {
12795        #[allow(unused_imports)]
12796        use super::*;
12797        #[derive(Clone, Debug, PartialEq)]
12798        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12799    }
12800
12801    impl TreeType {
12802        /// Gets the enum value.
12803        ///
12804        /// Returns `None` if the enum contains an unknown value deserialized from
12805        /// the string representation of enums.
12806        pub fn value(&self) -> std::option::Option<i32> {
12807            match self {
12808                Self::Unspecified => std::option::Option::Some(0),
12809                Self::Source => std::option::Option::Some(1),
12810                Self::Draft => std::option::Option::Some(2),
12811                Self::Destination => std::option::Option::Some(3),
12812                Self::UnknownValue(u) => u.0.value(),
12813            }
12814        }
12815
12816        /// Gets the enum value as a string.
12817        ///
12818        /// Returns `None` if the enum contains an unknown value deserialized from
12819        /// the integer representation of enums.
12820        pub fn name(&self) -> std::option::Option<&str> {
12821            match self {
12822                Self::Unspecified => std::option::Option::Some("TREE_TYPE_UNSPECIFIED"),
12823                Self::Source => std::option::Option::Some("SOURCE"),
12824                Self::Draft => std::option::Option::Some("DRAFT"),
12825                Self::Destination => std::option::Option::Some("DESTINATION"),
12826                Self::UnknownValue(u) => u.0.name(),
12827            }
12828        }
12829    }
12830
12831    impl std::default::Default for TreeType {
12832        fn default() -> Self {
12833            use std::convert::From;
12834            Self::from(0)
12835        }
12836    }
12837
12838    impl std::fmt::Display for TreeType {
12839        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12840            wkt::internal::display_enum(f, self.name(), self.value())
12841        }
12842    }
12843
12844    impl std::convert::From<i32> for TreeType {
12845        fn from(value: i32) -> Self {
12846            match value {
12847                0 => Self::Unspecified,
12848                1 => Self::Source,
12849                2 => Self::Draft,
12850                3 => Self::Destination,
12851                _ => Self::UnknownValue(tree_type::UnknownValue(
12852                    wkt::internal::UnknownEnumValue::Integer(value),
12853                )),
12854            }
12855        }
12856    }
12857
12858    impl std::convert::From<&str> for TreeType {
12859        fn from(value: &str) -> Self {
12860            use std::string::ToString;
12861            match value {
12862                "TREE_TYPE_UNSPECIFIED" => Self::Unspecified,
12863                "SOURCE" => Self::Source,
12864                "DRAFT" => Self::Draft,
12865                "DESTINATION" => Self::Destination,
12866                _ => Self::UnknownValue(tree_type::UnknownValue(
12867                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12868                )),
12869            }
12870        }
12871    }
12872
12873    impl serde::ser::Serialize for TreeType {
12874        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12875        where
12876            S: serde::Serializer,
12877        {
12878            match self {
12879                Self::Unspecified => serializer.serialize_i32(0),
12880                Self::Source => serializer.serialize_i32(1),
12881                Self::Draft => serializer.serialize_i32(2),
12882                Self::Destination => serializer.serialize_i32(3),
12883                Self::UnknownValue(u) => u.0.serialize(serializer),
12884            }
12885        }
12886    }
12887
12888    impl<'de> serde::de::Deserialize<'de> for TreeType {
12889        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12890        where
12891            D: serde::Deserializer<'de>,
12892        {
12893            deserializer.deserialize_any(wkt::internal::EnumVisitor::<TreeType>::new(
12894                ".google.cloud.clouddms.v1.DatabaseEntity.TreeType",
12895            ))
12896        }
12897    }
12898
12899    /// The specific body for each entity type.
12900    #[derive(Clone, Debug, PartialEq)]
12901    #[non_exhaustive]
12902    pub enum EntityBody {
12903        /// Database.
12904        Database(std::boxed::Box<crate::model::DatabaseInstanceEntity>),
12905        /// Schema.
12906        Schema(std::boxed::Box<crate::model::SchemaEntity>),
12907        /// Table.
12908        Table(std::boxed::Box<crate::model::TableEntity>),
12909        /// View.
12910        View(std::boxed::Box<crate::model::ViewEntity>),
12911        /// Sequence.
12912        Sequence(std::boxed::Box<crate::model::SequenceEntity>),
12913        /// Stored procedure.
12914        StoredProcedure(std::boxed::Box<crate::model::StoredProcedureEntity>),
12915        /// Function.
12916        DatabaseFunction(std::boxed::Box<crate::model::FunctionEntity>),
12917        /// Synonym.
12918        Synonym(std::boxed::Box<crate::model::SynonymEntity>),
12919        /// Package.
12920        DatabasePackage(std::boxed::Box<crate::model::PackageEntity>),
12921        /// UDT.
12922        Udt(std::boxed::Box<crate::model::UDTEntity>),
12923        /// Materialized view.
12924        MaterializedView(std::boxed::Box<crate::model::MaterializedViewEntity>),
12925    }
12926}
12927
12928/// DatabaseInstance acts as a parent entity to other database entities.
12929#[derive(Clone, Default, PartialEq)]
12930#[non_exhaustive]
12931pub struct DatabaseInstanceEntity {
12932    /// Custom engine specific features.
12933    pub custom_features: std::option::Option<wkt::Struct>,
12934
12935    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12936}
12937
12938impl DatabaseInstanceEntity {
12939    pub fn new() -> Self {
12940        std::default::Default::default()
12941    }
12942
12943    /// Sets the value of [custom_features][crate::model::DatabaseInstanceEntity::custom_features].
12944    pub fn set_custom_features<T>(mut self, v: T) -> Self
12945    where
12946        T: std::convert::Into<wkt::Struct>,
12947    {
12948        self.custom_features = std::option::Option::Some(v.into());
12949        self
12950    }
12951
12952    /// Sets or clears the value of [custom_features][crate::model::DatabaseInstanceEntity::custom_features].
12953    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
12954    where
12955        T: std::convert::Into<wkt::Struct>,
12956    {
12957        self.custom_features = v.map(|x| x.into());
12958        self
12959    }
12960}
12961
12962impl wkt::message::Message for DatabaseInstanceEntity {
12963    fn typename() -> &'static str {
12964        "type.googleapis.com/google.cloud.clouddms.v1.DatabaseInstanceEntity"
12965    }
12966}
12967
12968/// Schema typically has no parent entity, but can have a parent entity
12969/// DatabaseInstance (for database engines which support it).  For some database
12970/// engines, the terms  schema and user can be used interchangeably when they
12971/// refer to a namespace or a collection of other database entities. Can store
12972/// additional information which is schema specific.
12973#[derive(Clone, Default, PartialEq)]
12974#[non_exhaustive]
12975pub struct SchemaEntity {
12976    /// Custom engine specific features.
12977    pub custom_features: std::option::Option<wkt::Struct>,
12978
12979    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12980}
12981
12982impl SchemaEntity {
12983    pub fn new() -> Self {
12984        std::default::Default::default()
12985    }
12986
12987    /// Sets the value of [custom_features][crate::model::SchemaEntity::custom_features].
12988    pub fn set_custom_features<T>(mut self, v: T) -> Self
12989    where
12990        T: std::convert::Into<wkt::Struct>,
12991    {
12992        self.custom_features = std::option::Option::Some(v.into());
12993        self
12994    }
12995
12996    /// Sets or clears the value of [custom_features][crate::model::SchemaEntity::custom_features].
12997    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
12998    where
12999        T: std::convert::Into<wkt::Struct>,
13000    {
13001        self.custom_features = v.map(|x| x.into());
13002        self
13003    }
13004}
13005
13006impl wkt::message::Message for SchemaEntity {
13007    fn typename() -> &'static str {
13008        "type.googleapis.com/google.cloud.clouddms.v1.SchemaEntity"
13009    }
13010}
13011
13012/// Table's parent is a schema.
13013#[derive(Clone, Default, PartialEq)]
13014#[non_exhaustive]
13015pub struct TableEntity {
13016    /// Table columns.
13017    pub columns: std::vec::Vec<crate::model::ColumnEntity>,
13018
13019    /// Table constraints.
13020    pub constraints: std::vec::Vec<crate::model::ConstraintEntity>,
13021
13022    /// Table indices.
13023    pub indices: std::vec::Vec<crate::model::IndexEntity>,
13024
13025    /// Table triggers.
13026    pub triggers: std::vec::Vec<crate::model::TriggerEntity>,
13027
13028    /// Custom engine specific features.
13029    pub custom_features: std::option::Option<wkt::Struct>,
13030
13031    /// Comment associated with the table.
13032    pub comment: std::string::String,
13033
13034    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13035}
13036
13037impl TableEntity {
13038    pub fn new() -> Self {
13039        std::default::Default::default()
13040    }
13041
13042    /// Sets the value of [columns][crate::model::TableEntity::columns].
13043    pub fn set_columns<T, V>(mut self, v: T) -> Self
13044    where
13045        T: std::iter::IntoIterator<Item = V>,
13046        V: std::convert::Into<crate::model::ColumnEntity>,
13047    {
13048        use std::iter::Iterator;
13049        self.columns = v.into_iter().map(|i| i.into()).collect();
13050        self
13051    }
13052
13053    /// Sets the value of [constraints][crate::model::TableEntity::constraints].
13054    pub fn set_constraints<T, V>(mut self, v: T) -> Self
13055    where
13056        T: std::iter::IntoIterator<Item = V>,
13057        V: std::convert::Into<crate::model::ConstraintEntity>,
13058    {
13059        use std::iter::Iterator;
13060        self.constraints = v.into_iter().map(|i| i.into()).collect();
13061        self
13062    }
13063
13064    /// Sets the value of [indices][crate::model::TableEntity::indices].
13065    pub fn set_indices<T, V>(mut self, v: T) -> Self
13066    where
13067        T: std::iter::IntoIterator<Item = V>,
13068        V: std::convert::Into<crate::model::IndexEntity>,
13069    {
13070        use std::iter::Iterator;
13071        self.indices = v.into_iter().map(|i| i.into()).collect();
13072        self
13073    }
13074
13075    /// Sets the value of [triggers][crate::model::TableEntity::triggers].
13076    pub fn set_triggers<T, V>(mut self, v: T) -> Self
13077    where
13078        T: std::iter::IntoIterator<Item = V>,
13079        V: std::convert::Into<crate::model::TriggerEntity>,
13080    {
13081        use std::iter::Iterator;
13082        self.triggers = v.into_iter().map(|i| i.into()).collect();
13083        self
13084    }
13085
13086    /// Sets the value of [custom_features][crate::model::TableEntity::custom_features].
13087    pub fn set_custom_features<T>(mut self, v: T) -> Self
13088    where
13089        T: std::convert::Into<wkt::Struct>,
13090    {
13091        self.custom_features = std::option::Option::Some(v.into());
13092        self
13093    }
13094
13095    /// Sets or clears the value of [custom_features][crate::model::TableEntity::custom_features].
13096    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
13097    where
13098        T: std::convert::Into<wkt::Struct>,
13099    {
13100        self.custom_features = v.map(|x| x.into());
13101        self
13102    }
13103
13104    /// Sets the value of [comment][crate::model::TableEntity::comment].
13105    pub fn set_comment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13106        self.comment = v.into();
13107        self
13108    }
13109}
13110
13111impl wkt::message::Message for TableEntity {
13112    fn typename() -> &'static str {
13113        "type.googleapis.com/google.cloud.clouddms.v1.TableEntity"
13114    }
13115}
13116
13117/// Column is not used as an independent entity, it is retrieved as part of a
13118/// Table entity.
13119#[derive(Clone, Default, PartialEq)]
13120#[non_exhaustive]
13121pub struct ColumnEntity {
13122    /// Column name.
13123    pub name: std::string::String,
13124
13125    /// Column data type.
13126    pub data_type: std::string::String,
13127
13128    /// Charset override - instead of table level charset.
13129    pub charset: std::string::String,
13130
13131    /// Collation override - instead of table level collation.
13132    pub collation: std::string::String,
13133
13134    /// Column length - e.g. varchar (50).
13135    pub length: i64,
13136
13137    /// Column precision - when relevant.
13138    pub precision: i32,
13139
13140    /// Column scale - when relevant.
13141    pub scale: i32,
13142
13143    /// Column fractional second precision - used for timestamp based datatypes.
13144    pub fractional_seconds_precision: i32,
13145
13146    /// Is the column of array type.
13147    pub array: bool,
13148
13149    /// If the column is array, of which length.
13150    pub array_length: i32,
13151
13152    /// Is the column nullable.
13153    pub nullable: bool,
13154
13155    /// Is the column auto-generated/identity.
13156    pub auto_generated: bool,
13157
13158    /// Is the column a UDT.
13159    pub udt: bool,
13160
13161    /// Custom engine specific features.
13162    pub custom_features: std::option::Option<wkt::Struct>,
13163
13164    /// Specifies the list of values allowed in the column.
13165    /// Only used for set data type.
13166    pub set_values: std::vec::Vec<std::string::String>,
13167
13168    /// Comment associated with the column.
13169    pub comment: std::string::String,
13170
13171    /// Column order in the table.
13172    pub ordinal_position: i32,
13173
13174    /// Default value of the column.
13175    pub default_value: std::string::String,
13176
13177    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13178}
13179
13180impl ColumnEntity {
13181    pub fn new() -> Self {
13182        std::default::Default::default()
13183    }
13184
13185    /// Sets the value of [name][crate::model::ColumnEntity::name].
13186    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13187        self.name = v.into();
13188        self
13189    }
13190
13191    /// Sets the value of [data_type][crate::model::ColumnEntity::data_type].
13192    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13193        self.data_type = v.into();
13194        self
13195    }
13196
13197    /// Sets the value of [charset][crate::model::ColumnEntity::charset].
13198    pub fn set_charset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13199        self.charset = v.into();
13200        self
13201    }
13202
13203    /// Sets the value of [collation][crate::model::ColumnEntity::collation].
13204    pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13205        self.collation = v.into();
13206        self
13207    }
13208
13209    /// Sets the value of [length][crate::model::ColumnEntity::length].
13210    pub fn set_length<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13211        self.length = v.into();
13212        self
13213    }
13214
13215    /// Sets the value of [precision][crate::model::ColumnEntity::precision].
13216    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13217        self.precision = v.into();
13218        self
13219    }
13220
13221    /// Sets the value of [scale][crate::model::ColumnEntity::scale].
13222    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13223        self.scale = v.into();
13224        self
13225    }
13226
13227    /// Sets the value of [fractional_seconds_precision][crate::model::ColumnEntity::fractional_seconds_precision].
13228    pub fn set_fractional_seconds_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13229        self.fractional_seconds_precision = v.into();
13230        self
13231    }
13232
13233    /// Sets the value of [array][crate::model::ColumnEntity::array].
13234    pub fn set_array<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13235        self.array = v.into();
13236        self
13237    }
13238
13239    /// Sets the value of [array_length][crate::model::ColumnEntity::array_length].
13240    pub fn set_array_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13241        self.array_length = v.into();
13242        self
13243    }
13244
13245    /// Sets the value of [nullable][crate::model::ColumnEntity::nullable].
13246    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13247        self.nullable = v.into();
13248        self
13249    }
13250
13251    /// Sets the value of [auto_generated][crate::model::ColumnEntity::auto_generated].
13252    pub fn set_auto_generated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13253        self.auto_generated = v.into();
13254        self
13255    }
13256
13257    /// Sets the value of [udt][crate::model::ColumnEntity::udt].
13258    pub fn set_udt<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13259        self.udt = v.into();
13260        self
13261    }
13262
13263    /// Sets the value of [custom_features][crate::model::ColumnEntity::custom_features].
13264    pub fn set_custom_features<T>(mut self, v: T) -> Self
13265    where
13266        T: std::convert::Into<wkt::Struct>,
13267    {
13268        self.custom_features = std::option::Option::Some(v.into());
13269        self
13270    }
13271
13272    /// Sets or clears the value of [custom_features][crate::model::ColumnEntity::custom_features].
13273    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
13274    where
13275        T: std::convert::Into<wkt::Struct>,
13276    {
13277        self.custom_features = v.map(|x| x.into());
13278        self
13279    }
13280
13281    /// Sets the value of [set_values][crate::model::ColumnEntity::set_values].
13282    pub fn set_set_values<T, V>(mut self, v: T) -> Self
13283    where
13284        T: std::iter::IntoIterator<Item = V>,
13285        V: std::convert::Into<std::string::String>,
13286    {
13287        use std::iter::Iterator;
13288        self.set_values = v.into_iter().map(|i| i.into()).collect();
13289        self
13290    }
13291
13292    /// Sets the value of [comment][crate::model::ColumnEntity::comment].
13293    pub fn set_comment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13294        self.comment = v.into();
13295        self
13296    }
13297
13298    /// Sets the value of [ordinal_position][crate::model::ColumnEntity::ordinal_position].
13299    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13300        self.ordinal_position = v.into();
13301        self
13302    }
13303
13304    /// Sets the value of [default_value][crate::model::ColumnEntity::default_value].
13305    pub fn set_default_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13306        self.default_value = v.into();
13307        self
13308    }
13309}
13310
13311impl wkt::message::Message for ColumnEntity {
13312    fn typename() -> &'static str {
13313        "type.googleapis.com/google.cloud.clouddms.v1.ColumnEntity"
13314    }
13315}
13316
13317/// Constraint is not used as an independent entity, it is retrieved
13318/// as part of another entity such as Table or View.
13319#[derive(Clone, Default, PartialEq)]
13320#[non_exhaustive]
13321pub struct ConstraintEntity {
13322    /// The name of the table constraint.
13323    pub name: std::string::String,
13324
13325    /// Type of constraint, for example unique, primary key, foreign key (currently
13326    /// only primary key is supported).
13327    pub r#type: std::string::String,
13328
13329    /// Table columns used as part of the Constraint, for example primary key
13330    /// constraint should list the columns which constitutes the key.
13331    pub table_columns: std::vec::Vec<std::string::String>,
13332
13333    /// Custom engine specific features.
13334    pub custom_features: std::option::Option<wkt::Struct>,
13335
13336    /// Reference columns which may be associated with the constraint. For example,
13337    /// if the constraint is a FOREIGN_KEY, this represents the list of full names
13338    /// of referenced columns by the foreign key.
13339    pub reference_columns: std::vec::Vec<std::string::String>,
13340
13341    /// Reference table which may be associated with the constraint. For example,
13342    /// if the constraint is a FOREIGN_KEY, this represents the list of full name
13343    /// of the referenced table by the foreign key.
13344    pub reference_table: std::string::String,
13345
13346    /// Table which is associated with the constraint. In case the constraint
13347    /// is defined on a table, this field is left empty as this information is
13348    /// stored in parent_name. However, if constraint is defined on a view, this
13349    /// field stores the table name on which the view is defined.
13350    pub table_name: std::string::String,
13351
13352    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13353}
13354
13355impl ConstraintEntity {
13356    pub fn new() -> Self {
13357        std::default::Default::default()
13358    }
13359
13360    /// Sets the value of [name][crate::model::ConstraintEntity::name].
13361    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13362        self.name = v.into();
13363        self
13364    }
13365
13366    /// Sets the value of [r#type][crate::model::ConstraintEntity::type].
13367    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13368        self.r#type = v.into();
13369        self
13370    }
13371
13372    /// Sets the value of [table_columns][crate::model::ConstraintEntity::table_columns].
13373    pub fn set_table_columns<T, V>(mut self, v: T) -> Self
13374    where
13375        T: std::iter::IntoIterator<Item = V>,
13376        V: std::convert::Into<std::string::String>,
13377    {
13378        use std::iter::Iterator;
13379        self.table_columns = v.into_iter().map(|i| i.into()).collect();
13380        self
13381    }
13382
13383    /// Sets the value of [custom_features][crate::model::ConstraintEntity::custom_features].
13384    pub fn set_custom_features<T>(mut self, v: T) -> Self
13385    where
13386        T: std::convert::Into<wkt::Struct>,
13387    {
13388        self.custom_features = std::option::Option::Some(v.into());
13389        self
13390    }
13391
13392    /// Sets or clears the value of [custom_features][crate::model::ConstraintEntity::custom_features].
13393    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
13394    where
13395        T: std::convert::Into<wkt::Struct>,
13396    {
13397        self.custom_features = v.map(|x| x.into());
13398        self
13399    }
13400
13401    /// Sets the value of [reference_columns][crate::model::ConstraintEntity::reference_columns].
13402    pub fn set_reference_columns<T, V>(mut self, v: T) -> Self
13403    where
13404        T: std::iter::IntoIterator<Item = V>,
13405        V: std::convert::Into<std::string::String>,
13406    {
13407        use std::iter::Iterator;
13408        self.reference_columns = v.into_iter().map(|i| i.into()).collect();
13409        self
13410    }
13411
13412    /// Sets the value of [reference_table][crate::model::ConstraintEntity::reference_table].
13413    pub fn set_reference_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13414        self.reference_table = v.into();
13415        self
13416    }
13417
13418    /// Sets the value of [table_name][crate::model::ConstraintEntity::table_name].
13419    pub fn set_table_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13420        self.table_name = v.into();
13421        self
13422    }
13423}
13424
13425impl wkt::message::Message for ConstraintEntity {
13426    fn typename() -> &'static str {
13427        "type.googleapis.com/google.cloud.clouddms.v1.ConstraintEntity"
13428    }
13429}
13430
13431/// Index is not used as an independent entity, it is retrieved as part of a
13432/// Table entity.
13433#[derive(Clone, Default, PartialEq)]
13434#[non_exhaustive]
13435pub struct IndexEntity {
13436    /// The name of the index.
13437    pub name: std::string::String,
13438
13439    /// Type of index, for example B-TREE.
13440    pub r#type: std::string::String,
13441
13442    /// Table columns used as part of the Index, for example B-TREE index should
13443    /// list the columns which constitutes the index.
13444    pub table_columns: std::vec::Vec<std::string::String>,
13445
13446    /// Boolean value indicating whether the index is unique.
13447    pub unique: bool,
13448
13449    /// Custom engine specific features.
13450    pub custom_features: std::option::Option<wkt::Struct>,
13451
13452    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13453}
13454
13455impl IndexEntity {
13456    pub fn new() -> Self {
13457        std::default::Default::default()
13458    }
13459
13460    /// Sets the value of [name][crate::model::IndexEntity::name].
13461    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13462        self.name = v.into();
13463        self
13464    }
13465
13466    /// Sets the value of [r#type][crate::model::IndexEntity::type].
13467    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13468        self.r#type = v.into();
13469        self
13470    }
13471
13472    /// Sets the value of [table_columns][crate::model::IndexEntity::table_columns].
13473    pub fn set_table_columns<T, V>(mut self, v: T) -> Self
13474    where
13475        T: std::iter::IntoIterator<Item = V>,
13476        V: std::convert::Into<std::string::String>,
13477    {
13478        use std::iter::Iterator;
13479        self.table_columns = v.into_iter().map(|i| i.into()).collect();
13480        self
13481    }
13482
13483    /// Sets the value of [unique][crate::model::IndexEntity::unique].
13484    pub fn set_unique<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13485        self.unique = v.into();
13486        self
13487    }
13488
13489    /// Sets the value of [custom_features][crate::model::IndexEntity::custom_features].
13490    pub fn set_custom_features<T>(mut self, v: T) -> Self
13491    where
13492        T: std::convert::Into<wkt::Struct>,
13493    {
13494        self.custom_features = std::option::Option::Some(v.into());
13495        self
13496    }
13497
13498    /// Sets or clears the value of [custom_features][crate::model::IndexEntity::custom_features].
13499    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
13500    where
13501        T: std::convert::Into<wkt::Struct>,
13502    {
13503        self.custom_features = v.map(|x| x.into());
13504        self
13505    }
13506}
13507
13508impl wkt::message::Message for IndexEntity {
13509    fn typename() -> &'static str {
13510        "type.googleapis.com/google.cloud.clouddms.v1.IndexEntity"
13511    }
13512}
13513
13514/// Trigger is not used as an independent entity, it is retrieved as part of a
13515/// Table entity.
13516#[derive(Clone, Default, PartialEq)]
13517#[non_exhaustive]
13518pub struct TriggerEntity {
13519    /// The name of the trigger.
13520    pub name: std::string::String,
13521
13522    /// The DML, DDL, or database events that fire the trigger, for example
13523    /// INSERT, UPDATE.
13524    pub triggering_events: std::vec::Vec<std::string::String>,
13525
13526    /// Indicates when the trigger fires, for example BEFORE STATEMENT, AFTER EACH
13527    /// ROW.
13528    pub trigger_type: std::string::String,
13529
13530    /// The SQL code which creates the trigger.
13531    pub sql_code: std::string::String,
13532
13533    /// Custom engine specific features.
13534    pub custom_features: std::option::Option<wkt::Struct>,
13535
13536    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13537}
13538
13539impl TriggerEntity {
13540    pub fn new() -> Self {
13541        std::default::Default::default()
13542    }
13543
13544    /// Sets the value of [name][crate::model::TriggerEntity::name].
13545    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13546        self.name = v.into();
13547        self
13548    }
13549
13550    /// Sets the value of [triggering_events][crate::model::TriggerEntity::triggering_events].
13551    pub fn set_triggering_events<T, V>(mut self, v: T) -> Self
13552    where
13553        T: std::iter::IntoIterator<Item = V>,
13554        V: std::convert::Into<std::string::String>,
13555    {
13556        use std::iter::Iterator;
13557        self.triggering_events = v.into_iter().map(|i| i.into()).collect();
13558        self
13559    }
13560
13561    /// Sets the value of [trigger_type][crate::model::TriggerEntity::trigger_type].
13562    pub fn set_trigger_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13563        self.trigger_type = v.into();
13564        self
13565    }
13566
13567    /// Sets the value of [sql_code][crate::model::TriggerEntity::sql_code].
13568    pub fn set_sql_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13569        self.sql_code = v.into();
13570        self
13571    }
13572
13573    /// Sets the value of [custom_features][crate::model::TriggerEntity::custom_features].
13574    pub fn set_custom_features<T>(mut self, v: T) -> Self
13575    where
13576        T: std::convert::Into<wkt::Struct>,
13577    {
13578        self.custom_features = std::option::Option::Some(v.into());
13579        self
13580    }
13581
13582    /// Sets or clears the value of [custom_features][crate::model::TriggerEntity::custom_features].
13583    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
13584    where
13585        T: std::convert::Into<wkt::Struct>,
13586    {
13587        self.custom_features = v.map(|x| x.into());
13588        self
13589    }
13590}
13591
13592impl wkt::message::Message for TriggerEntity {
13593    fn typename() -> &'static str {
13594        "type.googleapis.com/google.cloud.clouddms.v1.TriggerEntity"
13595    }
13596}
13597
13598/// View's parent is a schema.
13599#[derive(Clone, Default, PartialEq)]
13600#[non_exhaustive]
13601pub struct ViewEntity {
13602    /// The SQL code which creates the view.
13603    pub sql_code: std::string::String,
13604
13605    /// Custom engine specific features.
13606    pub custom_features: std::option::Option<wkt::Struct>,
13607
13608    /// View constraints.
13609    pub constraints: std::vec::Vec<crate::model::ConstraintEntity>,
13610
13611    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13612}
13613
13614impl ViewEntity {
13615    pub fn new() -> Self {
13616        std::default::Default::default()
13617    }
13618
13619    /// Sets the value of [sql_code][crate::model::ViewEntity::sql_code].
13620    pub fn set_sql_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13621        self.sql_code = v.into();
13622        self
13623    }
13624
13625    /// Sets the value of [custom_features][crate::model::ViewEntity::custom_features].
13626    pub fn set_custom_features<T>(mut self, v: T) -> Self
13627    where
13628        T: std::convert::Into<wkt::Struct>,
13629    {
13630        self.custom_features = std::option::Option::Some(v.into());
13631        self
13632    }
13633
13634    /// Sets or clears the value of [custom_features][crate::model::ViewEntity::custom_features].
13635    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
13636    where
13637        T: std::convert::Into<wkt::Struct>,
13638    {
13639        self.custom_features = v.map(|x| x.into());
13640        self
13641    }
13642
13643    /// Sets the value of [constraints][crate::model::ViewEntity::constraints].
13644    pub fn set_constraints<T, V>(mut self, v: T) -> Self
13645    where
13646        T: std::iter::IntoIterator<Item = V>,
13647        V: std::convert::Into<crate::model::ConstraintEntity>,
13648    {
13649        use std::iter::Iterator;
13650        self.constraints = v.into_iter().map(|i| i.into()).collect();
13651        self
13652    }
13653}
13654
13655impl wkt::message::Message for ViewEntity {
13656    fn typename() -> &'static str {
13657        "type.googleapis.com/google.cloud.clouddms.v1.ViewEntity"
13658    }
13659}
13660
13661/// Sequence's parent is a schema.
13662#[derive(Clone, Default, PartialEq)]
13663#[non_exhaustive]
13664pub struct SequenceEntity {
13665    /// Increment value for the sequence.
13666    pub increment: i64,
13667
13668    /// Start number for the sequence represented as bytes to accommodate large.
13669    /// numbers
13670    pub start_value: ::bytes::Bytes,
13671
13672    /// Maximum number for the sequence represented as bytes to accommodate large.
13673    /// numbers
13674    pub max_value: ::bytes::Bytes,
13675
13676    /// Minimum number for the sequence represented as bytes to accommodate large.
13677    /// numbers
13678    pub min_value: ::bytes::Bytes,
13679
13680    /// Indicates whether the sequence value should cycle through.
13681    pub cycle: bool,
13682
13683    /// Indicates number of entries to cache / precreate.
13684    pub cache: i64,
13685
13686    /// Custom engine specific features.
13687    pub custom_features: std::option::Option<wkt::Struct>,
13688
13689    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13690}
13691
13692impl SequenceEntity {
13693    pub fn new() -> Self {
13694        std::default::Default::default()
13695    }
13696
13697    /// Sets the value of [increment][crate::model::SequenceEntity::increment].
13698    pub fn set_increment<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13699        self.increment = v.into();
13700        self
13701    }
13702
13703    /// Sets the value of [start_value][crate::model::SequenceEntity::start_value].
13704    pub fn set_start_value<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
13705        self.start_value = v.into();
13706        self
13707    }
13708
13709    /// Sets the value of [max_value][crate::model::SequenceEntity::max_value].
13710    pub fn set_max_value<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
13711        self.max_value = v.into();
13712        self
13713    }
13714
13715    /// Sets the value of [min_value][crate::model::SequenceEntity::min_value].
13716    pub fn set_min_value<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
13717        self.min_value = v.into();
13718        self
13719    }
13720
13721    /// Sets the value of [cycle][crate::model::SequenceEntity::cycle].
13722    pub fn set_cycle<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13723        self.cycle = v.into();
13724        self
13725    }
13726
13727    /// Sets the value of [cache][crate::model::SequenceEntity::cache].
13728    pub fn set_cache<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13729        self.cache = v.into();
13730        self
13731    }
13732
13733    /// Sets the value of [custom_features][crate::model::SequenceEntity::custom_features].
13734    pub fn set_custom_features<T>(mut self, v: T) -> Self
13735    where
13736        T: std::convert::Into<wkt::Struct>,
13737    {
13738        self.custom_features = std::option::Option::Some(v.into());
13739        self
13740    }
13741
13742    /// Sets or clears the value of [custom_features][crate::model::SequenceEntity::custom_features].
13743    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
13744    where
13745        T: std::convert::Into<wkt::Struct>,
13746    {
13747        self.custom_features = v.map(|x| x.into());
13748        self
13749    }
13750}
13751
13752impl wkt::message::Message for SequenceEntity {
13753    fn typename() -> &'static str {
13754        "type.googleapis.com/google.cloud.clouddms.v1.SequenceEntity"
13755    }
13756}
13757
13758/// Stored procedure's parent is a schema.
13759#[derive(Clone, Default, PartialEq)]
13760#[non_exhaustive]
13761pub struct StoredProcedureEntity {
13762    /// The SQL code which creates the stored procedure.
13763    pub sql_code: std::string::String,
13764
13765    /// Custom engine specific features.
13766    pub custom_features: std::option::Option<wkt::Struct>,
13767
13768    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13769}
13770
13771impl StoredProcedureEntity {
13772    pub fn new() -> Self {
13773        std::default::Default::default()
13774    }
13775
13776    /// Sets the value of [sql_code][crate::model::StoredProcedureEntity::sql_code].
13777    pub fn set_sql_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13778        self.sql_code = v.into();
13779        self
13780    }
13781
13782    /// Sets the value of [custom_features][crate::model::StoredProcedureEntity::custom_features].
13783    pub fn set_custom_features<T>(mut self, v: T) -> Self
13784    where
13785        T: std::convert::Into<wkt::Struct>,
13786    {
13787        self.custom_features = std::option::Option::Some(v.into());
13788        self
13789    }
13790
13791    /// Sets or clears the value of [custom_features][crate::model::StoredProcedureEntity::custom_features].
13792    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
13793    where
13794        T: std::convert::Into<wkt::Struct>,
13795    {
13796        self.custom_features = v.map(|x| x.into());
13797        self
13798    }
13799}
13800
13801impl wkt::message::Message for StoredProcedureEntity {
13802    fn typename() -> &'static str {
13803        "type.googleapis.com/google.cloud.clouddms.v1.StoredProcedureEntity"
13804    }
13805}
13806
13807/// Function's parent is a schema.
13808#[derive(Clone, Default, PartialEq)]
13809#[non_exhaustive]
13810pub struct FunctionEntity {
13811    /// The SQL code which creates the function.
13812    pub sql_code: std::string::String,
13813
13814    /// Custom engine specific features.
13815    pub custom_features: std::option::Option<wkt::Struct>,
13816
13817    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13818}
13819
13820impl FunctionEntity {
13821    pub fn new() -> Self {
13822        std::default::Default::default()
13823    }
13824
13825    /// Sets the value of [sql_code][crate::model::FunctionEntity::sql_code].
13826    pub fn set_sql_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13827        self.sql_code = v.into();
13828        self
13829    }
13830
13831    /// Sets the value of [custom_features][crate::model::FunctionEntity::custom_features].
13832    pub fn set_custom_features<T>(mut self, v: T) -> Self
13833    where
13834        T: std::convert::Into<wkt::Struct>,
13835    {
13836        self.custom_features = std::option::Option::Some(v.into());
13837        self
13838    }
13839
13840    /// Sets or clears the value of [custom_features][crate::model::FunctionEntity::custom_features].
13841    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
13842    where
13843        T: std::convert::Into<wkt::Struct>,
13844    {
13845        self.custom_features = v.map(|x| x.into());
13846        self
13847    }
13848}
13849
13850impl wkt::message::Message for FunctionEntity {
13851    fn typename() -> &'static str {
13852        "type.googleapis.com/google.cloud.clouddms.v1.FunctionEntity"
13853    }
13854}
13855
13856/// MaterializedView's parent is a schema.
13857#[derive(Clone, Default, PartialEq)]
13858#[non_exhaustive]
13859pub struct MaterializedViewEntity {
13860    /// The SQL code which creates the view.
13861    pub sql_code: std::string::String,
13862
13863    /// Custom engine specific features.
13864    pub custom_features: std::option::Option<wkt::Struct>,
13865
13866    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13867}
13868
13869impl MaterializedViewEntity {
13870    pub fn new() -> Self {
13871        std::default::Default::default()
13872    }
13873
13874    /// Sets the value of [sql_code][crate::model::MaterializedViewEntity::sql_code].
13875    pub fn set_sql_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13876        self.sql_code = v.into();
13877        self
13878    }
13879
13880    /// Sets the value of [custom_features][crate::model::MaterializedViewEntity::custom_features].
13881    pub fn set_custom_features<T>(mut self, v: T) -> Self
13882    where
13883        T: std::convert::Into<wkt::Struct>,
13884    {
13885        self.custom_features = std::option::Option::Some(v.into());
13886        self
13887    }
13888
13889    /// Sets or clears the value of [custom_features][crate::model::MaterializedViewEntity::custom_features].
13890    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
13891    where
13892        T: std::convert::Into<wkt::Struct>,
13893    {
13894        self.custom_features = v.map(|x| x.into());
13895        self
13896    }
13897}
13898
13899impl wkt::message::Message for MaterializedViewEntity {
13900    fn typename() -> &'static str {
13901        "type.googleapis.com/google.cloud.clouddms.v1.MaterializedViewEntity"
13902    }
13903}
13904
13905/// Synonym's parent is a schema.
13906#[derive(Clone, Default, PartialEq)]
13907#[non_exhaustive]
13908pub struct SynonymEntity {
13909    /// The name of the entity for which the synonym is being created (the source).
13910    pub source_entity: std::string::String,
13911
13912    /// The type of the entity for which the synonym is being created
13913    /// (usually a table or a sequence).
13914    pub source_type: crate::model::DatabaseEntityType,
13915
13916    /// Custom engine specific features.
13917    pub custom_features: std::option::Option<wkt::Struct>,
13918
13919    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13920}
13921
13922impl SynonymEntity {
13923    pub fn new() -> Self {
13924        std::default::Default::default()
13925    }
13926
13927    /// Sets the value of [source_entity][crate::model::SynonymEntity::source_entity].
13928    pub fn set_source_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13929        self.source_entity = v.into();
13930        self
13931    }
13932
13933    /// Sets the value of [source_type][crate::model::SynonymEntity::source_type].
13934    pub fn set_source_type<T: std::convert::Into<crate::model::DatabaseEntityType>>(
13935        mut self,
13936        v: T,
13937    ) -> Self {
13938        self.source_type = v.into();
13939        self
13940    }
13941
13942    /// Sets the value of [custom_features][crate::model::SynonymEntity::custom_features].
13943    pub fn set_custom_features<T>(mut self, v: T) -> Self
13944    where
13945        T: std::convert::Into<wkt::Struct>,
13946    {
13947        self.custom_features = std::option::Option::Some(v.into());
13948        self
13949    }
13950
13951    /// Sets or clears the value of [custom_features][crate::model::SynonymEntity::custom_features].
13952    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
13953    where
13954        T: std::convert::Into<wkt::Struct>,
13955    {
13956        self.custom_features = v.map(|x| x.into());
13957        self
13958    }
13959}
13960
13961impl wkt::message::Message for SynonymEntity {
13962    fn typename() -> &'static str {
13963        "type.googleapis.com/google.cloud.clouddms.v1.SynonymEntity"
13964    }
13965}
13966
13967/// Package's parent is a schema.
13968#[derive(Clone, Default, PartialEq)]
13969#[non_exhaustive]
13970pub struct PackageEntity {
13971    /// The SQL code which creates the package.
13972    pub package_sql_code: std::string::String,
13973
13974    /// The SQL code which creates the package body. If the package specification
13975    /// has cursors or subprograms, then the package body is mandatory.
13976    pub package_body: std::string::String,
13977
13978    /// Custom engine specific features.
13979    pub custom_features: std::option::Option<wkt::Struct>,
13980
13981    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13982}
13983
13984impl PackageEntity {
13985    pub fn new() -> Self {
13986        std::default::Default::default()
13987    }
13988
13989    /// Sets the value of [package_sql_code][crate::model::PackageEntity::package_sql_code].
13990    pub fn set_package_sql_code<T: std::convert::Into<std::string::String>>(
13991        mut self,
13992        v: T,
13993    ) -> Self {
13994        self.package_sql_code = v.into();
13995        self
13996    }
13997
13998    /// Sets the value of [package_body][crate::model::PackageEntity::package_body].
13999    pub fn set_package_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14000        self.package_body = v.into();
14001        self
14002    }
14003
14004    /// Sets the value of [custom_features][crate::model::PackageEntity::custom_features].
14005    pub fn set_custom_features<T>(mut self, v: T) -> Self
14006    where
14007        T: std::convert::Into<wkt::Struct>,
14008    {
14009        self.custom_features = std::option::Option::Some(v.into());
14010        self
14011    }
14012
14013    /// Sets or clears the value of [custom_features][crate::model::PackageEntity::custom_features].
14014    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
14015    where
14016        T: std::convert::Into<wkt::Struct>,
14017    {
14018        self.custom_features = v.map(|x| x.into());
14019        self
14020    }
14021}
14022
14023impl wkt::message::Message for PackageEntity {
14024    fn typename() -> &'static str {
14025        "type.googleapis.com/google.cloud.clouddms.v1.PackageEntity"
14026    }
14027}
14028
14029/// UDT's parent is a schema.
14030#[derive(Clone, Default, PartialEq)]
14031#[non_exhaustive]
14032pub struct UDTEntity {
14033    /// The SQL code which creates the udt.
14034    pub udt_sql_code: std::string::String,
14035
14036    /// The SQL code which creates the udt body.
14037    pub udt_body: std::string::String,
14038
14039    /// Custom engine specific features.
14040    pub custom_features: std::option::Option<wkt::Struct>,
14041
14042    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14043}
14044
14045impl UDTEntity {
14046    pub fn new() -> Self {
14047        std::default::Default::default()
14048    }
14049
14050    /// Sets the value of [udt_sql_code][crate::model::UDTEntity::udt_sql_code].
14051    pub fn set_udt_sql_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14052        self.udt_sql_code = v.into();
14053        self
14054    }
14055
14056    /// Sets the value of [udt_body][crate::model::UDTEntity::udt_body].
14057    pub fn set_udt_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14058        self.udt_body = v.into();
14059        self
14060    }
14061
14062    /// Sets the value of [custom_features][crate::model::UDTEntity::custom_features].
14063    pub fn set_custom_features<T>(mut self, v: T) -> Self
14064    where
14065        T: std::convert::Into<wkt::Struct>,
14066    {
14067        self.custom_features = std::option::Option::Some(v.into());
14068        self
14069    }
14070
14071    /// Sets or clears the value of [custom_features][crate::model::UDTEntity::custom_features].
14072    pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
14073    where
14074        T: std::convert::Into<wkt::Struct>,
14075    {
14076        self.custom_features = v.map(|x| x.into());
14077        self
14078    }
14079}
14080
14081impl wkt::message::Message for UDTEntity {
14082    fn typename() -> &'static str {
14083        "type.googleapis.com/google.cloud.clouddms.v1.UDTEntity"
14084    }
14085}
14086
14087/// Details of the mappings of a database entity.
14088#[derive(Clone, Default, PartialEq)]
14089#[non_exhaustive]
14090pub struct EntityMapping {
14091    /// Source entity full name.
14092    /// The source entity can also be a column, index or constraint using the
14093    /// same naming notation schema.table.column.
14094    pub source_entity: std::string::String,
14095
14096    /// Target entity full name.
14097    /// The draft entity can also include a column, index or constraint using the
14098    /// same naming notation schema.table.column.
14099    pub draft_entity: std::string::String,
14100
14101    /// Type of source entity.
14102    pub source_type: crate::model::DatabaseEntityType,
14103
14104    /// Type of draft entity.
14105    pub draft_type: crate::model::DatabaseEntityType,
14106
14107    /// Entity mapping log entries.
14108    /// Multiple rules can be effective and contribute changes to a converted
14109    /// entity, such as a rule can handle the entity name, another rule can handle
14110    /// an entity type. In addition, rules which did not change the entity are also
14111    /// logged along with the reason preventing them to do so.
14112    pub mapping_log: std::vec::Vec<crate::model::EntityMappingLogEntry>,
14113
14114    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14115}
14116
14117impl EntityMapping {
14118    pub fn new() -> Self {
14119        std::default::Default::default()
14120    }
14121
14122    /// Sets the value of [source_entity][crate::model::EntityMapping::source_entity].
14123    pub fn set_source_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14124        self.source_entity = v.into();
14125        self
14126    }
14127
14128    /// Sets the value of [draft_entity][crate::model::EntityMapping::draft_entity].
14129    pub fn set_draft_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14130        self.draft_entity = v.into();
14131        self
14132    }
14133
14134    /// Sets the value of [source_type][crate::model::EntityMapping::source_type].
14135    pub fn set_source_type<T: std::convert::Into<crate::model::DatabaseEntityType>>(
14136        mut self,
14137        v: T,
14138    ) -> Self {
14139        self.source_type = v.into();
14140        self
14141    }
14142
14143    /// Sets the value of [draft_type][crate::model::EntityMapping::draft_type].
14144    pub fn set_draft_type<T: std::convert::Into<crate::model::DatabaseEntityType>>(
14145        mut self,
14146        v: T,
14147    ) -> Self {
14148        self.draft_type = v.into();
14149        self
14150    }
14151
14152    /// Sets the value of [mapping_log][crate::model::EntityMapping::mapping_log].
14153    pub fn set_mapping_log<T, V>(mut self, v: T) -> Self
14154    where
14155        T: std::iter::IntoIterator<Item = V>,
14156        V: std::convert::Into<crate::model::EntityMappingLogEntry>,
14157    {
14158        use std::iter::Iterator;
14159        self.mapping_log = v.into_iter().map(|i| i.into()).collect();
14160        self
14161    }
14162}
14163
14164impl wkt::message::Message for EntityMapping {
14165    fn typename() -> &'static str {
14166        "type.googleapis.com/google.cloud.clouddms.v1.EntityMapping"
14167    }
14168}
14169
14170/// A single record of a rule which was used for a mapping.
14171#[derive(Clone, Default, PartialEq)]
14172#[non_exhaustive]
14173pub struct EntityMappingLogEntry {
14174    /// Which rule caused this log entry.
14175    pub rule_id: std::string::String,
14176
14177    /// Rule revision ID.
14178    pub rule_revision_id: std::string::String,
14179
14180    /// Comment.
14181    pub mapping_comment: std::string::String,
14182
14183    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14184}
14185
14186impl EntityMappingLogEntry {
14187    pub fn new() -> Self {
14188        std::default::Default::default()
14189    }
14190
14191    /// Sets the value of [rule_id][crate::model::EntityMappingLogEntry::rule_id].
14192    pub fn set_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14193        self.rule_id = v.into();
14194        self
14195    }
14196
14197    /// Sets the value of [rule_revision_id][crate::model::EntityMappingLogEntry::rule_revision_id].
14198    pub fn set_rule_revision_id<T: std::convert::Into<std::string::String>>(
14199        mut self,
14200        v: T,
14201    ) -> Self {
14202        self.rule_revision_id = v.into();
14203        self
14204    }
14205
14206    /// Sets the value of [mapping_comment][crate::model::EntityMappingLogEntry::mapping_comment].
14207    pub fn set_mapping_comment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14208        self.mapping_comment = v.into();
14209        self
14210    }
14211}
14212
14213impl wkt::message::Message for EntityMappingLogEntry {
14214    fn typename() -> &'static str {
14215        "type.googleapis.com/google.cloud.clouddms.v1.EntityMappingLogEntry"
14216    }
14217}
14218
14219/// A single DDL statement for a specific entity
14220#[derive(Clone, Default, PartialEq)]
14221#[non_exhaustive]
14222pub struct EntityDdl {
14223    /// Type of DDL (Create, Alter).
14224    pub ddl_type: std::string::String,
14225
14226    /// The name of the database entity the ddl refers to.
14227    pub entity: std::string::String,
14228
14229    /// The actual ddl code.
14230    pub ddl: std::string::String,
14231
14232    /// The entity type (if the DDL is for a sub entity).
14233    pub entity_type: crate::model::DatabaseEntityType,
14234
14235    /// EntityIssues found for this ddl.
14236    pub issue_id: std::vec::Vec<std::string::String>,
14237
14238    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14239}
14240
14241impl EntityDdl {
14242    pub fn new() -> Self {
14243        std::default::Default::default()
14244    }
14245
14246    /// Sets the value of [ddl_type][crate::model::EntityDdl::ddl_type].
14247    pub fn set_ddl_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14248        self.ddl_type = v.into();
14249        self
14250    }
14251
14252    /// Sets the value of [entity][crate::model::EntityDdl::entity].
14253    pub fn set_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14254        self.entity = v.into();
14255        self
14256    }
14257
14258    /// Sets the value of [ddl][crate::model::EntityDdl::ddl].
14259    pub fn set_ddl<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14260        self.ddl = v.into();
14261        self
14262    }
14263
14264    /// Sets the value of [entity_type][crate::model::EntityDdl::entity_type].
14265    pub fn set_entity_type<T: std::convert::Into<crate::model::DatabaseEntityType>>(
14266        mut self,
14267        v: T,
14268    ) -> Self {
14269        self.entity_type = v.into();
14270        self
14271    }
14272
14273    /// Sets the value of [issue_id][crate::model::EntityDdl::issue_id].
14274    pub fn set_issue_id<T, V>(mut self, v: T) -> Self
14275    where
14276        T: std::iter::IntoIterator<Item = V>,
14277        V: std::convert::Into<std::string::String>,
14278    {
14279        use std::iter::Iterator;
14280        self.issue_id = v.into_iter().map(|i| i.into()).collect();
14281        self
14282    }
14283}
14284
14285impl wkt::message::Message for EntityDdl {
14286    fn typename() -> &'static str {
14287        "type.googleapis.com/google.cloud.clouddms.v1.EntityDdl"
14288    }
14289}
14290
14291/// Issue related to the entity.
14292#[derive(Clone, Default, PartialEq)]
14293#[non_exhaustive]
14294pub struct EntityIssue {
14295    /// Unique Issue ID.
14296    pub id: std::string::String,
14297
14298    /// The type of the issue.
14299    pub r#type: crate::model::entity_issue::IssueType,
14300
14301    /// Severity of the issue
14302    pub severity: crate::model::entity_issue::IssueSeverity,
14303
14304    /// Issue detailed message
14305    pub message: std::string::String,
14306
14307    /// Error/Warning code
14308    pub code: std::string::String,
14309
14310    /// The ddl which caused the issue, if relevant.
14311    pub ddl: std::option::Option<std::string::String>,
14312
14313    /// The position of the issue found, if relevant.
14314    pub position: std::option::Option<crate::model::entity_issue::Position>,
14315
14316    /// The entity type (if the DDL is for a sub entity).
14317    pub entity_type: crate::model::DatabaseEntityType,
14318
14319    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14320}
14321
14322impl EntityIssue {
14323    pub fn new() -> Self {
14324        std::default::Default::default()
14325    }
14326
14327    /// Sets the value of [id][crate::model::EntityIssue::id].
14328    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14329        self.id = v.into();
14330        self
14331    }
14332
14333    /// Sets the value of [r#type][crate::model::EntityIssue::type].
14334    pub fn set_type<T: std::convert::Into<crate::model::entity_issue::IssueType>>(
14335        mut self,
14336        v: T,
14337    ) -> Self {
14338        self.r#type = v.into();
14339        self
14340    }
14341
14342    /// Sets the value of [severity][crate::model::EntityIssue::severity].
14343    pub fn set_severity<T: std::convert::Into<crate::model::entity_issue::IssueSeverity>>(
14344        mut self,
14345        v: T,
14346    ) -> Self {
14347        self.severity = v.into();
14348        self
14349    }
14350
14351    /// Sets the value of [message][crate::model::EntityIssue::message].
14352    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14353        self.message = v.into();
14354        self
14355    }
14356
14357    /// Sets the value of [code][crate::model::EntityIssue::code].
14358    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14359        self.code = v.into();
14360        self
14361    }
14362
14363    /// Sets the value of [ddl][crate::model::EntityIssue::ddl].
14364    pub fn set_ddl<T>(mut self, v: T) -> Self
14365    where
14366        T: std::convert::Into<std::string::String>,
14367    {
14368        self.ddl = std::option::Option::Some(v.into());
14369        self
14370    }
14371
14372    /// Sets or clears the value of [ddl][crate::model::EntityIssue::ddl].
14373    pub fn set_or_clear_ddl<T>(mut self, v: std::option::Option<T>) -> Self
14374    where
14375        T: std::convert::Into<std::string::String>,
14376    {
14377        self.ddl = v.map(|x| x.into());
14378        self
14379    }
14380
14381    /// Sets the value of [position][crate::model::EntityIssue::position].
14382    pub fn set_position<T>(mut self, v: T) -> Self
14383    where
14384        T: std::convert::Into<crate::model::entity_issue::Position>,
14385    {
14386        self.position = std::option::Option::Some(v.into());
14387        self
14388    }
14389
14390    /// Sets or clears the value of [position][crate::model::EntityIssue::position].
14391    pub fn set_or_clear_position<T>(mut self, v: std::option::Option<T>) -> Self
14392    where
14393        T: std::convert::Into<crate::model::entity_issue::Position>,
14394    {
14395        self.position = v.map(|x| x.into());
14396        self
14397    }
14398
14399    /// Sets the value of [entity_type][crate::model::EntityIssue::entity_type].
14400    pub fn set_entity_type<T: std::convert::Into<crate::model::DatabaseEntityType>>(
14401        mut self,
14402        v: T,
14403    ) -> Self {
14404        self.entity_type = v.into();
14405        self
14406    }
14407}
14408
14409impl wkt::message::Message for EntityIssue {
14410    fn typename() -> &'static str {
14411        "type.googleapis.com/google.cloud.clouddms.v1.EntityIssue"
14412    }
14413}
14414
14415/// Defines additional types related to [EntityIssue].
14416pub mod entity_issue {
14417    #[allow(unused_imports)]
14418    use super::*;
14419
14420    /// Issue position.
14421    #[derive(Clone, Default, PartialEq)]
14422    #[non_exhaustive]
14423    pub struct Position {
14424        /// Issue line number
14425        pub line: i32,
14426
14427        /// Issue column number
14428        pub column: i32,
14429
14430        /// Issue offset
14431        pub offset: i32,
14432
14433        /// Issue length
14434        pub length: i32,
14435
14436        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14437    }
14438
14439    impl Position {
14440        pub fn new() -> Self {
14441            std::default::Default::default()
14442        }
14443
14444        /// Sets the value of [line][crate::model::entity_issue::Position::line].
14445        pub fn set_line<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14446            self.line = v.into();
14447            self
14448        }
14449
14450        /// Sets the value of [column][crate::model::entity_issue::Position::column].
14451        pub fn set_column<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14452            self.column = v.into();
14453            self
14454        }
14455
14456        /// Sets the value of [offset][crate::model::entity_issue::Position::offset].
14457        pub fn set_offset<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14458            self.offset = v.into();
14459            self
14460        }
14461
14462        /// Sets the value of [length][crate::model::entity_issue::Position::length].
14463        pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14464            self.length = v.into();
14465            self
14466        }
14467    }
14468
14469    impl wkt::message::Message for Position {
14470        fn typename() -> &'static str {
14471            "type.googleapis.com/google.cloud.clouddms.v1.EntityIssue.Position"
14472        }
14473    }
14474
14475    /// Type of issue.
14476    ///
14477    /// # Working with unknown values
14478    ///
14479    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14480    /// additional enum variants at any time. Adding new variants is not considered
14481    /// a breaking change. Applications should write their code in anticipation of:
14482    ///
14483    /// - New values appearing in future releases of the client library, **and**
14484    /// - New values received dynamically, without application changes.
14485    ///
14486    /// Please consult the [Working with enums] section in the user guide for some
14487    /// guidelines.
14488    ///
14489    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14490    #[derive(Clone, Debug, PartialEq)]
14491    #[non_exhaustive]
14492    pub enum IssueType {
14493        /// Unspecified issue type.
14494        Unspecified,
14495        /// Issue originated from the DDL
14496        Ddl,
14497        /// Issue originated during the apply process
14498        Apply,
14499        /// Issue originated during the convert process
14500        Convert,
14501        /// If set, the enum was initialized with an unknown value.
14502        ///
14503        /// Applications can examine the value using [IssueType::value] or
14504        /// [IssueType::name].
14505        UnknownValue(issue_type::UnknownValue),
14506    }
14507
14508    #[doc(hidden)]
14509    pub mod issue_type {
14510        #[allow(unused_imports)]
14511        use super::*;
14512        #[derive(Clone, Debug, PartialEq)]
14513        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14514    }
14515
14516    impl IssueType {
14517        /// Gets the enum value.
14518        ///
14519        /// Returns `None` if the enum contains an unknown value deserialized from
14520        /// the string representation of enums.
14521        pub fn value(&self) -> std::option::Option<i32> {
14522            match self {
14523                Self::Unspecified => std::option::Option::Some(0),
14524                Self::Ddl => std::option::Option::Some(1),
14525                Self::Apply => std::option::Option::Some(2),
14526                Self::Convert => std::option::Option::Some(3),
14527                Self::UnknownValue(u) => u.0.value(),
14528            }
14529        }
14530
14531        /// Gets the enum value as a string.
14532        ///
14533        /// Returns `None` if the enum contains an unknown value deserialized from
14534        /// the integer representation of enums.
14535        pub fn name(&self) -> std::option::Option<&str> {
14536            match self {
14537                Self::Unspecified => std::option::Option::Some("ISSUE_TYPE_UNSPECIFIED"),
14538                Self::Ddl => std::option::Option::Some("ISSUE_TYPE_DDL"),
14539                Self::Apply => std::option::Option::Some("ISSUE_TYPE_APPLY"),
14540                Self::Convert => std::option::Option::Some("ISSUE_TYPE_CONVERT"),
14541                Self::UnknownValue(u) => u.0.name(),
14542            }
14543        }
14544    }
14545
14546    impl std::default::Default for IssueType {
14547        fn default() -> Self {
14548            use std::convert::From;
14549            Self::from(0)
14550        }
14551    }
14552
14553    impl std::fmt::Display for IssueType {
14554        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14555            wkt::internal::display_enum(f, self.name(), self.value())
14556        }
14557    }
14558
14559    impl std::convert::From<i32> for IssueType {
14560        fn from(value: i32) -> Self {
14561            match value {
14562                0 => Self::Unspecified,
14563                1 => Self::Ddl,
14564                2 => Self::Apply,
14565                3 => Self::Convert,
14566                _ => Self::UnknownValue(issue_type::UnknownValue(
14567                    wkt::internal::UnknownEnumValue::Integer(value),
14568                )),
14569            }
14570        }
14571    }
14572
14573    impl std::convert::From<&str> for IssueType {
14574        fn from(value: &str) -> Self {
14575            use std::string::ToString;
14576            match value {
14577                "ISSUE_TYPE_UNSPECIFIED" => Self::Unspecified,
14578                "ISSUE_TYPE_DDL" => Self::Ddl,
14579                "ISSUE_TYPE_APPLY" => Self::Apply,
14580                "ISSUE_TYPE_CONVERT" => Self::Convert,
14581                _ => Self::UnknownValue(issue_type::UnknownValue(
14582                    wkt::internal::UnknownEnumValue::String(value.to_string()),
14583                )),
14584            }
14585        }
14586    }
14587
14588    impl serde::ser::Serialize for IssueType {
14589        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14590        where
14591            S: serde::Serializer,
14592        {
14593            match self {
14594                Self::Unspecified => serializer.serialize_i32(0),
14595                Self::Ddl => serializer.serialize_i32(1),
14596                Self::Apply => serializer.serialize_i32(2),
14597                Self::Convert => serializer.serialize_i32(3),
14598                Self::UnknownValue(u) => u.0.serialize(serializer),
14599            }
14600        }
14601    }
14602
14603    impl<'de> serde::de::Deserialize<'de> for IssueType {
14604        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14605        where
14606            D: serde::Deserializer<'de>,
14607        {
14608            deserializer.deserialize_any(wkt::internal::EnumVisitor::<IssueType>::new(
14609                ".google.cloud.clouddms.v1.EntityIssue.IssueType",
14610            ))
14611        }
14612    }
14613
14614    /// Severity of issue.
14615    ///
14616    /// # Working with unknown values
14617    ///
14618    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14619    /// additional enum variants at any time. Adding new variants is not considered
14620    /// a breaking change. Applications should write their code in anticipation of:
14621    ///
14622    /// - New values appearing in future releases of the client library, **and**
14623    /// - New values received dynamically, without application changes.
14624    ///
14625    /// Please consult the [Working with enums] section in the user guide for some
14626    /// guidelines.
14627    ///
14628    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14629    #[derive(Clone, Debug, PartialEq)]
14630    #[non_exhaustive]
14631    pub enum IssueSeverity {
14632        /// Unspecified issue severity
14633        Unspecified,
14634        /// Info
14635        Info,
14636        /// Warning
14637        Warning,
14638        /// Error
14639        Error,
14640        /// If set, the enum was initialized with an unknown value.
14641        ///
14642        /// Applications can examine the value using [IssueSeverity::value] or
14643        /// [IssueSeverity::name].
14644        UnknownValue(issue_severity::UnknownValue),
14645    }
14646
14647    #[doc(hidden)]
14648    pub mod issue_severity {
14649        #[allow(unused_imports)]
14650        use super::*;
14651        #[derive(Clone, Debug, PartialEq)]
14652        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14653    }
14654
14655    impl IssueSeverity {
14656        /// Gets the enum value.
14657        ///
14658        /// Returns `None` if the enum contains an unknown value deserialized from
14659        /// the string representation of enums.
14660        pub fn value(&self) -> std::option::Option<i32> {
14661            match self {
14662                Self::Unspecified => std::option::Option::Some(0),
14663                Self::Info => std::option::Option::Some(1),
14664                Self::Warning => std::option::Option::Some(2),
14665                Self::Error => std::option::Option::Some(3),
14666                Self::UnknownValue(u) => u.0.value(),
14667            }
14668        }
14669
14670        /// Gets the enum value as a string.
14671        ///
14672        /// Returns `None` if the enum contains an unknown value deserialized from
14673        /// the integer representation of enums.
14674        pub fn name(&self) -> std::option::Option<&str> {
14675            match self {
14676                Self::Unspecified => std::option::Option::Some("ISSUE_SEVERITY_UNSPECIFIED"),
14677                Self::Info => std::option::Option::Some("ISSUE_SEVERITY_INFO"),
14678                Self::Warning => std::option::Option::Some("ISSUE_SEVERITY_WARNING"),
14679                Self::Error => std::option::Option::Some("ISSUE_SEVERITY_ERROR"),
14680                Self::UnknownValue(u) => u.0.name(),
14681            }
14682        }
14683    }
14684
14685    impl std::default::Default for IssueSeverity {
14686        fn default() -> Self {
14687            use std::convert::From;
14688            Self::from(0)
14689        }
14690    }
14691
14692    impl std::fmt::Display for IssueSeverity {
14693        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14694            wkt::internal::display_enum(f, self.name(), self.value())
14695        }
14696    }
14697
14698    impl std::convert::From<i32> for IssueSeverity {
14699        fn from(value: i32) -> Self {
14700            match value {
14701                0 => Self::Unspecified,
14702                1 => Self::Info,
14703                2 => Self::Warning,
14704                3 => Self::Error,
14705                _ => Self::UnknownValue(issue_severity::UnknownValue(
14706                    wkt::internal::UnknownEnumValue::Integer(value),
14707                )),
14708            }
14709        }
14710    }
14711
14712    impl std::convert::From<&str> for IssueSeverity {
14713        fn from(value: &str) -> Self {
14714            use std::string::ToString;
14715            match value {
14716                "ISSUE_SEVERITY_UNSPECIFIED" => Self::Unspecified,
14717                "ISSUE_SEVERITY_INFO" => Self::Info,
14718                "ISSUE_SEVERITY_WARNING" => Self::Warning,
14719                "ISSUE_SEVERITY_ERROR" => Self::Error,
14720                _ => Self::UnknownValue(issue_severity::UnknownValue(
14721                    wkt::internal::UnknownEnumValue::String(value.to_string()),
14722                )),
14723            }
14724        }
14725    }
14726
14727    impl serde::ser::Serialize for IssueSeverity {
14728        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14729        where
14730            S: serde::Serializer,
14731        {
14732            match self {
14733                Self::Unspecified => serializer.serialize_i32(0),
14734                Self::Info => serializer.serialize_i32(1),
14735                Self::Warning => serializer.serialize_i32(2),
14736                Self::Error => serializer.serialize_i32(3),
14737                Self::UnknownValue(u) => u.0.serialize(serializer),
14738            }
14739        }
14740    }
14741
14742    impl<'de> serde::de::Deserialize<'de> for IssueSeverity {
14743        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14744        where
14745            D: serde::Deserializer<'de>,
14746        {
14747            deserializer.deserialize_any(wkt::internal::EnumVisitor::<IssueSeverity>::new(
14748                ".google.cloud.clouddms.v1.EntityIssue.IssueSeverity",
14749            ))
14750        }
14751    }
14752}
14753
14754/// AIP-157 Partial Response view for Database Entity.
14755///
14756/// # Working with unknown values
14757///
14758/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14759/// additional enum variants at any time. Adding new variants is not considered
14760/// a breaking change. Applications should write their code in anticipation of:
14761///
14762/// - New values appearing in future releases of the client library, **and**
14763/// - New values received dynamically, without application changes.
14764///
14765/// Please consult the [Working with enums] section in the user guide for some
14766/// guidelines.
14767///
14768/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14769#[derive(Clone, Debug, PartialEq)]
14770#[non_exhaustive]
14771pub enum DatabaseEntityView {
14772    /// Unspecified view. Defaults to basic view.
14773    Unspecified,
14774    /// Default view. Does not return DDLs or Issues.
14775    Basic,
14776    /// Return full entity details including mappings, ddl and issues.
14777    Full,
14778    /// Top-most (Database, Schema) nodes which are returned contains summary
14779    /// details for their decendents such as the number of entities per type and
14780    /// issues rollups. When this view is used, only a single page of result is
14781    /// returned and the page_size property of the request is ignored. The
14782    /// returned page will only include the top-most node types.
14783    RootSummary,
14784    /// If set, the enum was initialized with an unknown value.
14785    ///
14786    /// Applications can examine the value using [DatabaseEntityView::value] or
14787    /// [DatabaseEntityView::name].
14788    UnknownValue(database_entity_view::UnknownValue),
14789}
14790
14791#[doc(hidden)]
14792pub mod database_entity_view {
14793    #[allow(unused_imports)]
14794    use super::*;
14795    #[derive(Clone, Debug, PartialEq)]
14796    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14797}
14798
14799impl DatabaseEntityView {
14800    /// Gets the enum value.
14801    ///
14802    /// Returns `None` if the enum contains an unknown value deserialized from
14803    /// the string representation of enums.
14804    pub fn value(&self) -> std::option::Option<i32> {
14805        match self {
14806            Self::Unspecified => std::option::Option::Some(0),
14807            Self::Basic => std::option::Option::Some(1),
14808            Self::Full => std::option::Option::Some(2),
14809            Self::RootSummary => std::option::Option::Some(3),
14810            Self::UnknownValue(u) => u.0.value(),
14811        }
14812    }
14813
14814    /// Gets the enum value as a string.
14815    ///
14816    /// Returns `None` if the enum contains an unknown value deserialized from
14817    /// the integer representation of enums.
14818    pub fn name(&self) -> std::option::Option<&str> {
14819        match self {
14820            Self::Unspecified => std::option::Option::Some("DATABASE_ENTITY_VIEW_UNSPECIFIED"),
14821            Self::Basic => std::option::Option::Some("DATABASE_ENTITY_VIEW_BASIC"),
14822            Self::Full => std::option::Option::Some("DATABASE_ENTITY_VIEW_FULL"),
14823            Self::RootSummary => std::option::Option::Some("DATABASE_ENTITY_VIEW_ROOT_SUMMARY"),
14824            Self::UnknownValue(u) => u.0.name(),
14825        }
14826    }
14827}
14828
14829impl std::default::Default for DatabaseEntityView {
14830    fn default() -> Self {
14831        use std::convert::From;
14832        Self::from(0)
14833    }
14834}
14835
14836impl std::fmt::Display for DatabaseEntityView {
14837    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14838        wkt::internal::display_enum(f, self.name(), self.value())
14839    }
14840}
14841
14842impl std::convert::From<i32> for DatabaseEntityView {
14843    fn from(value: i32) -> Self {
14844        match value {
14845            0 => Self::Unspecified,
14846            1 => Self::Basic,
14847            2 => Self::Full,
14848            3 => Self::RootSummary,
14849            _ => Self::UnknownValue(database_entity_view::UnknownValue(
14850                wkt::internal::UnknownEnumValue::Integer(value),
14851            )),
14852        }
14853    }
14854}
14855
14856impl std::convert::From<&str> for DatabaseEntityView {
14857    fn from(value: &str) -> Self {
14858        use std::string::ToString;
14859        match value {
14860            "DATABASE_ENTITY_VIEW_UNSPECIFIED" => Self::Unspecified,
14861            "DATABASE_ENTITY_VIEW_BASIC" => Self::Basic,
14862            "DATABASE_ENTITY_VIEW_FULL" => Self::Full,
14863            "DATABASE_ENTITY_VIEW_ROOT_SUMMARY" => Self::RootSummary,
14864            _ => Self::UnknownValue(database_entity_view::UnknownValue(
14865                wkt::internal::UnknownEnumValue::String(value.to_string()),
14866            )),
14867        }
14868    }
14869}
14870
14871impl serde::ser::Serialize for DatabaseEntityView {
14872    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14873    where
14874        S: serde::Serializer,
14875    {
14876        match self {
14877            Self::Unspecified => serializer.serialize_i32(0),
14878            Self::Basic => serializer.serialize_i32(1),
14879            Self::Full => serializer.serialize_i32(2),
14880            Self::RootSummary => serializer.serialize_i32(3),
14881            Self::UnknownValue(u) => u.0.serialize(serializer),
14882        }
14883    }
14884}
14885
14886impl<'de> serde::de::Deserialize<'de> for DatabaseEntityView {
14887    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14888    where
14889        D: serde::Deserializer<'de>,
14890    {
14891        deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseEntityView>::new(
14892            ".google.cloud.clouddms.v1.DatabaseEntityView",
14893        ))
14894    }
14895}
14896
14897///
14898/// # Working with unknown values
14899///
14900/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14901/// additional enum variants at any time. Adding new variants is not considered
14902/// a breaking change. Applications should write their code in anticipation of:
14903///
14904/// - New values appearing in future releases of the client library, **and**
14905/// - New values received dynamically, without application changes.
14906///
14907/// Please consult the [Working with enums] section in the user guide for some
14908/// guidelines.
14909///
14910/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14911#[derive(Clone, Debug, PartialEq)]
14912#[non_exhaustive]
14913pub enum NetworkArchitecture {
14914    Unspecified,
14915    /// Instance is in Cloud SQL's old producer network architecture.
14916    OldCsqlProducer,
14917    /// Instance is in Cloud SQL's new producer network architecture.
14918    NewCsqlProducer,
14919    /// If set, the enum was initialized with an unknown value.
14920    ///
14921    /// Applications can examine the value using [NetworkArchitecture::value] or
14922    /// [NetworkArchitecture::name].
14923    UnknownValue(network_architecture::UnknownValue),
14924}
14925
14926#[doc(hidden)]
14927pub mod network_architecture {
14928    #[allow(unused_imports)]
14929    use super::*;
14930    #[derive(Clone, Debug, PartialEq)]
14931    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14932}
14933
14934impl NetworkArchitecture {
14935    /// Gets the enum value.
14936    ///
14937    /// Returns `None` if the enum contains an unknown value deserialized from
14938    /// the string representation of enums.
14939    pub fn value(&self) -> std::option::Option<i32> {
14940        match self {
14941            Self::Unspecified => std::option::Option::Some(0),
14942            Self::OldCsqlProducer => std::option::Option::Some(1),
14943            Self::NewCsqlProducer => std::option::Option::Some(2),
14944            Self::UnknownValue(u) => u.0.value(),
14945        }
14946    }
14947
14948    /// Gets the enum value as a string.
14949    ///
14950    /// Returns `None` if the enum contains an unknown value deserialized from
14951    /// the integer representation of enums.
14952    pub fn name(&self) -> std::option::Option<&str> {
14953        match self {
14954            Self::Unspecified => std::option::Option::Some("NETWORK_ARCHITECTURE_UNSPECIFIED"),
14955            Self::OldCsqlProducer => {
14956                std::option::Option::Some("NETWORK_ARCHITECTURE_OLD_CSQL_PRODUCER")
14957            }
14958            Self::NewCsqlProducer => {
14959                std::option::Option::Some("NETWORK_ARCHITECTURE_NEW_CSQL_PRODUCER")
14960            }
14961            Self::UnknownValue(u) => u.0.name(),
14962        }
14963    }
14964}
14965
14966impl std::default::Default for NetworkArchitecture {
14967    fn default() -> Self {
14968        use std::convert::From;
14969        Self::from(0)
14970    }
14971}
14972
14973impl std::fmt::Display for NetworkArchitecture {
14974    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14975        wkt::internal::display_enum(f, self.name(), self.value())
14976    }
14977}
14978
14979impl std::convert::From<i32> for NetworkArchitecture {
14980    fn from(value: i32) -> Self {
14981        match value {
14982            0 => Self::Unspecified,
14983            1 => Self::OldCsqlProducer,
14984            2 => Self::NewCsqlProducer,
14985            _ => Self::UnknownValue(network_architecture::UnknownValue(
14986                wkt::internal::UnknownEnumValue::Integer(value),
14987            )),
14988        }
14989    }
14990}
14991
14992impl std::convert::From<&str> for NetworkArchitecture {
14993    fn from(value: &str) -> Self {
14994        use std::string::ToString;
14995        match value {
14996            "NETWORK_ARCHITECTURE_UNSPECIFIED" => Self::Unspecified,
14997            "NETWORK_ARCHITECTURE_OLD_CSQL_PRODUCER" => Self::OldCsqlProducer,
14998            "NETWORK_ARCHITECTURE_NEW_CSQL_PRODUCER" => Self::NewCsqlProducer,
14999            _ => Self::UnknownValue(network_architecture::UnknownValue(
15000                wkt::internal::UnknownEnumValue::String(value.to_string()),
15001            )),
15002        }
15003    }
15004}
15005
15006impl serde::ser::Serialize for NetworkArchitecture {
15007    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15008    where
15009        S: serde::Serializer,
15010    {
15011        match self {
15012            Self::Unspecified => serializer.serialize_i32(0),
15013            Self::OldCsqlProducer => serializer.serialize_i32(1),
15014            Self::NewCsqlProducer => serializer.serialize_i32(2),
15015            Self::UnknownValue(u) => u.0.serialize(serializer),
15016        }
15017    }
15018}
15019
15020impl<'de> serde::de::Deserialize<'de> for NetworkArchitecture {
15021    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15022    where
15023        D: serde::Deserializer<'de>,
15024    {
15025        deserializer.deserialize_any(wkt::internal::EnumVisitor::<NetworkArchitecture>::new(
15026            ".google.cloud.clouddms.v1.NetworkArchitecture",
15027        ))
15028    }
15029}
15030
15031/// The database engine types.
15032///
15033/// # Working with unknown values
15034///
15035/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15036/// additional enum variants at any time. Adding new variants is not considered
15037/// a breaking change. Applications should write their code in anticipation of:
15038///
15039/// - New values appearing in future releases of the client library, **and**
15040/// - New values received dynamically, without application changes.
15041///
15042/// Please consult the [Working with enums] section in the user guide for some
15043/// guidelines.
15044///
15045/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15046#[derive(Clone, Debug, PartialEq)]
15047#[non_exhaustive]
15048pub enum DatabaseEngine {
15049    /// The source database engine of the migration job is unknown.
15050    Unspecified,
15051    /// The source engine is MySQL.
15052    Mysql,
15053    /// The source engine is PostgreSQL.
15054    Postgresql,
15055    /// The source engine is Oracle.
15056    Oracle,
15057    /// If set, the enum was initialized with an unknown value.
15058    ///
15059    /// Applications can examine the value using [DatabaseEngine::value] or
15060    /// [DatabaseEngine::name].
15061    UnknownValue(database_engine::UnknownValue),
15062}
15063
15064#[doc(hidden)]
15065pub mod database_engine {
15066    #[allow(unused_imports)]
15067    use super::*;
15068    #[derive(Clone, Debug, PartialEq)]
15069    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15070}
15071
15072impl DatabaseEngine {
15073    /// Gets the enum value.
15074    ///
15075    /// Returns `None` if the enum contains an unknown value deserialized from
15076    /// the string representation of enums.
15077    pub fn value(&self) -> std::option::Option<i32> {
15078        match self {
15079            Self::Unspecified => std::option::Option::Some(0),
15080            Self::Mysql => std::option::Option::Some(1),
15081            Self::Postgresql => std::option::Option::Some(2),
15082            Self::Oracle => std::option::Option::Some(4),
15083            Self::UnknownValue(u) => u.0.value(),
15084        }
15085    }
15086
15087    /// Gets the enum value as a string.
15088    ///
15089    /// Returns `None` if the enum contains an unknown value deserialized from
15090    /// the integer representation of enums.
15091    pub fn name(&self) -> std::option::Option<&str> {
15092        match self {
15093            Self::Unspecified => std::option::Option::Some("DATABASE_ENGINE_UNSPECIFIED"),
15094            Self::Mysql => std::option::Option::Some("MYSQL"),
15095            Self::Postgresql => std::option::Option::Some("POSTGRESQL"),
15096            Self::Oracle => std::option::Option::Some("ORACLE"),
15097            Self::UnknownValue(u) => u.0.name(),
15098        }
15099    }
15100}
15101
15102impl std::default::Default for DatabaseEngine {
15103    fn default() -> Self {
15104        use std::convert::From;
15105        Self::from(0)
15106    }
15107}
15108
15109impl std::fmt::Display for DatabaseEngine {
15110    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15111        wkt::internal::display_enum(f, self.name(), self.value())
15112    }
15113}
15114
15115impl std::convert::From<i32> for DatabaseEngine {
15116    fn from(value: i32) -> Self {
15117        match value {
15118            0 => Self::Unspecified,
15119            1 => Self::Mysql,
15120            2 => Self::Postgresql,
15121            4 => Self::Oracle,
15122            _ => Self::UnknownValue(database_engine::UnknownValue(
15123                wkt::internal::UnknownEnumValue::Integer(value),
15124            )),
15125        }
15126    }
15127}
15128
15129impl std::convert::From<&str> for DatabaseEngine {
15130    fn from(value: &str) -> Self {
15131        use std::string::ToString;
15132        match value {
15133            "DATABASE_ENGINE_UNSPECIFIED" => Self::Unspecified,
15134            "MYSQL" => Self::Mysql,
15135            "POSTGRESQL" => Self::Postgresql,
15136            "ORACLE" => Self::Oracle,
15137            _ => Self::UnknownValue(database_engine::UnknownValue(
15138                wkt::internal::UnknownEnumValue::String(value.to_string()),
15139            )),
15140        }
15141    }
15142}
15143
15144impl serde::ser::Serialize for DatabaseEngine {
15145    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15146    where
15147        S: serde::Serializer,
15148    {
15149        match self {
15150            Self::Unspecified => serializer.serialize_i32(0),
15151            Self::Mysql => serializer.serialize_i32(1),
15152            Self::Postgresql => serializer.serialize_i32(2),
15153            Self::Oracle => serializer.serialize_i32(4),
15154            Self::UnknownValue(u) => u.0.serialize(serializer),
15155        }
15156    }
15157}
15158
15159impl<'de> serde::de::Deserialize<'de> for DatabaseEngine {
15160    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15161    where
15162        D: serde::Deserializer<'de>,
15163    {
15164        deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseEngine>::new(
15165            ".google.cloud.clouddms.v1.DatabaseEngine",
15166        ))
15167    }
15168}
15169
15170/// The database providers.
15171///
15172/// # Working with unknown values
15173///
15174/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15175/// additional enum variants at any time. Adding new variants is not considered
15176/// a breaking change. Applications should write their code in anticipation of:
15177///
15178/// - New values appearing in future releases of the client library, **and**
15179/// - New values received dynamically, without application changes.
15180///
15181/// Please consult the [Working with enums] section in the user guide for some
15182/// guidelines.
15183///
15184/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15185#[derive(Clone, Debug, PartialEq)]
15186#[non_exhaustive]
15187pub enum DatabaseProvider {
15188    /// The database provider is unknown.
15189    Unspecified,
15190    /// CloudSQL runs the database.
15191    Cloudsql,
15192    /// RDS runs the database.
15193    Rds,
15194    /// Amazon Aurora.
15195    Aurora,
15196    /// AlloyDB.
15197    Alloydb,
15198    /// If set, the enum was initialized with an unknown value.
15199    ///
15200    /// Applications can examine the value using [DatabaseProvider::value] or
15201    /// [DatabaseProvider::name].
15202    UnknownValue(database_provider::UnknownValue),
15203}
15204
15205#[doc(hidden)]
15206pub mod database_provider {
15207    #[allow(unused_imports)]
15208    use super::*;
15209    #[derive(Clone, Debug, PartialEq)]
15210    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15211}
15212
15213impl DatabaseProvider {
15214    /// Gets the enum value.
15215    ///
15216    /// Returns `None` if the enum contains an unknown value deserialized from
15217    /// the string representation of enums.
15218    pub fn value(&self) -> std::option::Option<i32> {
15219        match self {
15220            Self::Unspecified => std::option::Option::Some(0),
15221            Self::Cloudsql => std::option::Option::Some(1),
15222            Self::Rds => std::option::Option::Some(2),
15223            Self::Aurora => std::option::Option::Some(3),
15224            Self::Alloydb => std::option::Option::Some(4),
15225            Self::UnknownValue(u) => u.0.value(),
15226        }
15227    }
15228
15229    /// Gets the enum value as a string.
15230    ///
15231    /// Returns `None` if the enum contains an unknown value deserialized from
15232    /// the integer representation of enums.
15233    pub fn name(&self) -> std::option::Option<&str> {
15234        match self {
15235            Self::Unspecified => std::option::Option::Some("DATABASE_PROVIDER_UNSPECIFIED"),
15236            Self::Cloudsql => std::option::Option::Some("CLOUDSQL"),
15237            Self::Rds => std::option::Option::Some("RDS"),
15238            Self::Aurora => std::option::Option::Some("AURORA"),
15239            Self::Alloydb => std::option::Option::Some("ALLOYDB"),
15240            Self::UnknownValue(u) => u.0.name(),
15241        }
15242    }
15243}
15244
15245impl std::default::Default for DatabaseProvider {
15246    fn default() -> Self {
15247        use std::convert::From;
15248        Self::from(0)
15249    }
15250}
15251
15252impl std::fmt::Display for DatabaseProvider {
15253    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15254        wkt::internal::display_enum(f, self.name(), self.value())
15255    }
15256}
15257
15258impl std::convert::From<i32> for DatabaseProvider {
15259    fn from(value: i32) -> Self {
15260        match value {
15261            0 => Self::Unspecified,
15262            1 => Self::Cloudsql,
15263            2 => Self::Rds,
15264            3 => Self::Aurora,
15265            4 => Self::Alloydb,
15266            _ => Self::UnknownValue(database_provider::UnknownValue(
15267                wkt::internal::UnknownEnumValue::Integer(value),
15268            )),
15269        }
15270    }
15271}
15272
15273impl std::convert::From<&str> for DatabaseProvider {
15274    fn from(value: &str) -> Self {
15275        use std::string::ToString;
15276        match value {
15277            "DATABASE_PROVIDER_UNSPECIFIED" => Self::Unspecified,
15278            "CLOUDSQL" => Self::Cloudsql,
15279            "RDS" => Self::Rds,
15280            "AURORA" => Self::Aurora,
15281            "ALLOYDB" => Self::Alloydb,
15282            _ => Self::UnknownValue(database_provider::UnknownValue(
15283                wkt::internal::UnknownEnumValue::String(value.to_string()),
15284            )),
15285        }
15286    }
15287}
15288
15289impl serde::ser::Serialize for DatabaseProvider {
15290    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15291    where
15292        S: serde::Serializer,
15293    {
15294        match self {
15295            Self::Unspecified => serializer.serialize_i32(0),
15296            Self::Cloudsql => serializer.serialize_i32(1),
15297            Self::Rds => serializer.serialize_i32(2),
15298            Self::Aurora => serializer.serialize_i32(3),
15299            Self::Alloydb => serializer.serialize_i32(4),
15300            Self::UnknownValue(u) => u.0.serialize(serializer),
15301        }
15302    }
15303}
15304
15305impl<'de> serde::de::Deserialize<'de> for DatabaseProvider {
15306    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15307    where
15308        D: serde::Deserializer<'de>,
15309    {
15310        deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseProvider>::new(
15311            ".google.cloud.clouddms.v1.DatabaseProvider",
15312        ))
15313    }
15314}
15315
15316/// Enum used by ValueListFilter to indicate whether the source value is in the
15317/// supplied list
15318///
15319/// # Working with unknown values
15320///
15321/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15322/// additional enum variants at any time. Adding new variants is not considered
15323/// a breaking change. Applications should write their code in anticipation of:
15324///
15325/// - New values appearing in future releases of the client library, **and**
15326/// - New values received dynamically, without application changes.
15327///
15328/// Please consult the [Working with enums] section in the user guide for some
15329/// guidelines.
15330///
15331/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15332#[derive(Clone, Debug, PartialEq)]
15333#[non_exhaustive]
15334pub enum ValuePresentInList {
15335    /// Value present in list unspecified
15336    Unspecified,
15337    /// If the source value is in the supplied list at value_list
15338    IfValueList,
15339    /// If the source value is not in the supplied list at value_list
15340    IfValueNotList,
15341    /// If set, the enum was initialized with an unknown value.
15342    ///
15343    /// Applications can examine the value using [ValuePresentInList::value] or
15344    /// [ValuePresentInList::name].
15345    UnknownValue(value_present_in_list::UnknownValue),
15346}
15347
15348#[doc(hidden)]
15349pub mod value_present_in_list {
15350    #[allow(unused_imports)]
15351    use super::*;
15352    #[derive(Clone, Debug, PartialEq)]
15353    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15354}
15355
15356impl ValuePresentInList {
15357    /// Gets the enum value.
15358    ///
15359    /// Returns `None` if the enum contains an unknown value deserialized from
15360    /// the string representation of enums.
15361    pub fn value(&self) -> std::option::Option<i32> {
15362        match self {
15363            Self::Unspecified => std::option::Option::Some(0),
15364            Self::IfValueList => std::option::Option::Some(1),
15365            Self::IfValueNotList => std::option::Option::Some(2),
15366            Self::UnknownValue(u) => u.0.value(),
15367        }
15368    }
15369
15370    /// Gets the enum value as a string.
15371    ///
15372    /// Returns `None` if the enum contains an unknown value deserialized from
15373    /// the integer representation of enums.
15374    pub fn name(&self) -> std::option::Option<&str> {
15375        match self {
15376            Self::Unspecified => std::option::Option::Some("VALUE_PRESENT_IN_LIST_UNSPECIFIED"),
15377            Self::IfValueList => std::option::Option::Some("VALUE_PRESENT_IN_LIST_IF_VALUE_LIST"),
15378            Self::IfValueNotList => {
15379                std::option::Option::Some("VALUE_PRESENT_IN_LIST_IF_VALUE_NOT_LIST")
15380            }
15381            Self::UnknownValue(u) => u.0.name(),
15382        }
15383    }
15384}
15385
15386impl std::default::Default for ValuePresentInList {
15387    fn default() -> Self {
15388        use std::convert::From;
15389        Self::from(0)
15390    }
15391}
15392
15393impl std::fmt::Display for ValuePresentInList {
15394    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15395        wkt::internal::display_enum(f, self.name(), self.value())
15396    }
15397}
15398
15399impl std::convert::From<i32> for ValuePresentInList {
15400    fn from(value: i32) -> Self {
15401        match value {
15402            0 => Self::Unspecified,
15403            1 => Self::IfValueList,
15404            2 => Self::IfValueNotList,
15405            _ => Self::UnknownValue(value_present_in_list::UnknownValue(
15406                wkt::internal::UnknownEnumValue::Integer(value),
15407            )),
15408        }
15409    }
15410}
15411
15412impl std::convert::From<&str> for ValuePresentInList {
15413    fn from(value: &str) -> Self {
15414        use std::string::ToString;
15415        match value {
15416            "VALUE_PRESENT_IN_LIST_UNSPECIFIED" => Self::Unspecified,
15417            "VALUE_PRESENT_IN_LIST_IF_VALUE_LIST" => Self::IfValueList,
15418            "VALUE_PRESENT_IN_LIST_IF_VALUE_NOT_LIST" => Self::IfValueNotList,
15419            _ => Self::UnknownValue(value_present_in_list::UnknownValue(
15420                wkt::internal::UnknownEnumValue::String(value.to_string()),
15421            )),
15422        }
15423    }
15424}
15425
15426impl serde::ser::Serialize for ValuePresentInList {
15427    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15428    where
15429        S: serde::Serializer,
15430    {
15431        match self {
15432            Self::Unspecified => serializer.serialize_i32(0),
15433            Self::IfValueList => serializer.serialize_i32(1),
15434            Self::IfValueNotList => serializer.serialize_i32(2),
15435            Self::UnknownValue(u) => u.0.serialize(serializer),
15436        }
15437    }
15438}
15439
15440impl<'de> serde::de::Deserialize<'de> for ValuePresentInList {
15441    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15442    where
15443        D: serde::Deserializer<'de>,
15444    {
15445        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ValuePresentInList>::new(
15446            ".google.cloud.clouddms.v1.ValuePresentInList",
15447        ))
15448    }
15449}
15450
15451/// The type of database entities supported,
15452///
15453/// # Working with unknown values
15454///
15455/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15456/// additional enum variants at any time. Adding new variants is not considered
15457/// a breaking change. Applications should write their code in anticipation of:
15458///
15459/// - New values appearing in future releases of the client library, **and**
15460/// - New values received dynamically, without application changes.
15461///
15462/// Please consult the [Working with enums] section in the user guide for some
15463/// guidelines.
15464///
15465/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15466#[derive(Clone, Debug, PartialEq)]
15467#[non_exhaustive]
15468pub enum DatabaseEntityType {
15469    /// Unspecified database entity type.
15470    Unspecified,
15471    /// Schema.
15472    Schema,
15473    /// Table.
15474    Table,
15475    /// Column.
15476    Column,
15477    /// Constraint.
15478    Constraint,
15479    /// Index.
15480    Index,
15481    /// Trigger.
15482    Trigger,
15483    /// View.
15484    View,
15485    /// Sequence.
15486    Sequence,
15487    /// Stored Procedure.
15488    StoredProcedure,
15489    /// Function.
15490    Function,
15491    /// Synonym.
15492    Synonym,
15493    /// Package.
15494    DatabasePackage,
15495    /// UDT.
15496    Udt,
15497    /// Materialized View.
15498    MaterializedView,
15499    /// Database.
15500    Database,
15501    /// If set, the enum was initialized with an unknown value.
15502    ///
15503    /// Applications can examine the value using [DatabaseEntityType::value] or
15504    /// [DatabaseEntityType::name].
15505    UnknownValue(database_entity_type::UnknownValue),
15506}
15507
15508#[doc(hidden)]
15509pub mod database_entity_type {
15510    #[allow(unused_imports)]
15511    use super::*;
15512    #[derive(Clone, Debug, PartialEq)]
15513    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15514}
15515
15516impl DatabaseEntityType {
15517    /// Gets the enum value.
15518    ///
15519    /// Returns `None` if the enum contains an unknown value deserialized from
15520    /// the string representation of enums.
15521    pub fn value(&self) -> std::option::Option<i32> {
15522        match self {
15523            Self::Unspecified => std::option::Option::Some(0),
15524            Self::Schema => std::option::Option::Some(1),
15525            Self::Table => std::option::Option::Some(2),
15526            Self::Column => std::option::Option::Some(3),
15527            Self::Constraint => std::option::Option::Some(4),
15528            Self::Index => std::option::Option::Some(5),
15529            Self::Trigger => std::option::Option::Some(6),
15530            Self::View => std::option::Option::Some(7),
15531            Self::Sequence => std::option::Option::Some(8),
15532            Self::StoredProcedure => std::option::Option::Some(9),
15533            Self::Function => std::option::Option::Some(10),
15534            Self::Synonym => std::option::Option::Some(11),
15535            Self::DatabasePackage => std::option::Option::Some(12),
15536            Self::Udt => std::option::Option::Some(13),
15537            Self::MaterializedView => std::option::Option::Some(14),
15538            Self::Database => std::option::Option::Some(15),
15539            Self::UnknownValue(u) => u.0.value(),
15540        }
15541    }
15542
15543    /// Gets the enum value as a string.
15544    ///
15545    /// Returns `None` if the enum contains an unknown value deserialized from
15546    /// the integer representation of enums.
15547    pub fn name(&self) -> std::option::Option<&str> {
15548        match self {
15549            Self::Unspecified => std::option::Option::Some("DATABASE_ENTITY_TYPE_UNSPECIFIED"),
15550            Self::Schema => std::option::Option::Some("DATABASE_ENTITY_TYPE_SCHEMA"),
15551            Self::Table => std::option::Option::Some("DATABASE_ENTITY_TYPE_TABLE"),
15552            Self::Column => std::option::Option::Some("DATABASE_ENTITY_TYPE_COLUMN"),
15553            Self::Constraint => std::option::Option::Some("DATABASE_ENTITY_TYPE_CONSTRAINT"),
15554            Self::Index => std::option::Option::Some("DATABASE_ENTITY_TYPE_INDEX"),
15555            Self::Trigger => std::option::Option::Some("DATABASE_ENTITY_TYPE_TRIGGER"),
15556            Self::View => std::option::Option::Some("DATABASE_ENTITY_TYPE_VIEW"),
15557            Self::Sequence => std::option::Option::Some("DATABASE_ENTITY_TYPE_SEQUENCE"),
15558            Self::StoredProcedure => {
15559                std::option::Option::Some("DATABASE_ENTITY_TYPE_STORED_PROCEDURE")
15560            }
15561            Self::Function => std::option::Option::Some("DATABASE_ENTITY_TYPE_FUNCTION"),
15562            Self::Synonym => std::option::Option::Some("DATABASE_ENTITY_TYPE_SYNONYM"),
15563            Self::DatabasePackage => {
15564                std::option::Option::Some("DATABASE_ENTITY_TYPE_DATABASE_PACKAGE")
15565            }
15566            Self::Udt => std::option::Option::Some("DATABASE_ENTITY_TYPE_UDT"),
15567            Self::MaterializedView => {
15568                std::option::Option::Some("DATABASE_ENTITY_TYPE_MATERIALIZED_VIEW")
15569            }
15570            Self::Database => std::option::Option::Some("DATABASE_ENTITY_TYPE_DATABASE"),
15571            Self::UnknownValue(u) => u.0.name(),
15572        }
15573    }
15574}
15575
15576impl std::default::Default for DatabaseEntityType {
15577    fn default() -> Self {
15578        use std::convert::From;
15579        Self::from(0)
15580    }
15581}
15582
15583impl std::fmt::Display for DatabaseEntityType {
15584    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15585        wkt::internal::display_enum(f, self.name(), self.value())
15586    }
15587}
15588
15589impl std::convert::From<i32> for DatabaseEntityType {
15590    fn from(value: i32) -> Self {
15591        match value {
15592            0 => Self::Unspecified,
15593            1 => Self::Schema,
15594            2 => Self::Table,
15595            3 => Self::Column,
15596            4 => Self::Constraint,
15597            5 => Self::Index,
15598            6 => Self::Trigger,
15599            7 => Self::View,
15600            8 => Self::Sequence,
15601            9 => Self::StoredProcedure,
15602            10 => Self::Function,
15603            11 => Self::Synonym,
15604            12 => Self::DatabasePackage,
15605            13 => Self::Udt,
15606            14 => Self::MaterializedView,
15607            15 => Self::Database,
15608            _ => Self::UnknownValue(database_entity_type::UnknownValue(
15609                wkt::internal::UnknownEnumValue::Integer(value),
15610            )),
15611        }
15612    }
15613}
15614
15615impl std::convert::From<&str> for DatabaseEntityType {
15616    fn from(value: &str) -> Self {
15617        use std::string::ToString;
15618        match value {
15619            "DATABASE_ENTITY_TYPE_UNSPECIFIED" => Self::Unspecified,
15620            "DATABASE_ENTITY_TYPE_SCHEMA" => Self::Schema,
15621            "DATABASE_ENTITY_TYPE_TABLE" => Self::Table,
15622            "DATABASE_ENTITY_TYPE_COLUMN" => Self::Column,
15623            "DATABASE_ENTITY_TYPE_CONSTRAINT" => Self::Constraint,
15624            "DATABASE_ENTITY_TYPE_INDEX" => Self::Index,
15625            "DATABASE_ENTITY_TYPE_TRIGGER" => Self::Trigger,
15626            "DATABASE_ENTITY_TYPE_VIEW" => Self::View,
15627            "DATABASE_ENTITY_TYPE_SEQUENCE" => Self::Sequence,
15628            "DATABASE_ENTITY_TYPE_STORED_PROCEDURE" => Self::StoredProcedure,
15629            "DATABASE_ENTITY_TYPE_FUNCTION" => Self::Function,
15630            "DATABASE_ENTITY_TYPE_SYNONYM" => Self::Synonym,
15631            "DATABASE_ENTITY_TYPE_DATABASE_PACKAGE" => Self::DatabasePackage,
15632            "DATABASE_ENTITY_TYPE_UDT" => Self::Udt,
15633            "DATABASE_ENTITY_TYPE_MATERIALIZED_VIEW" => Self::MaterializedView,
15634            "DATABASE_ENTITY_TYPE_DATABASE" => Self::Database,
15635            _ => Self::UnknownValue(database_entity_type::UnknownValue(
15636                wkt::internal::UnknownEnumValue::String(value.to_string()),
15637            )),
15638        }
15639    }
15640}
15641
15642impl serde::ser::Serialize for DatabaseEntityType {
15643    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15644    where
15645        S: serde::Serializer,
15646    {
15647        match self {
15648            Self::Unspecified => serializer.serialize_i32(0),
15649            Self::Schema => serializer.serialize_i32(1),
15650            Self::Table => serializer.serialize_i32(2),
15651            Self::Column => serializer.serialize_i32(3),
15652            Self::Constraint => serializer.serialize_i32(4),
15653            Self::Index => serializer.serialize_i32(5),
15654            Self::Trigger => serializer.serialize_i32(6),
15655            Self::View => serializer.serialize_i32(7),
15656            Self::Sequence => serializer.serialize_i32(8),
15657            Self::StoredProcedure => serializer.serialize_i32(9),
15658            Self::Function => serializer.serialize_i32(10),
15659            Self::Synonym => serializer.serialize_i32(11),
15660            Self::DatabasePackage => serializer.serialize_i32(12),
15661            Self::Udt => serializer.serialize_i32(13),
15662            Self::MaterializedView => serializer.serialize_i32(14),
15663            Self::Database => serializer.serialize_i32(15),
15664            Self::UnknownValue(u) => u.0.serialize(serializer),
15665        }
15666    }
15667}
15668
15669impl<'de> serde::de::Deserialize<'de> for DatabaseEntityType {
15670    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15671    where
15672        D: serde::Deserializer<'de>,
15673    {
15674        deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseEntityType>::new(
15675            ".google.cloud.clouddms.v1.DatabaseEntityType",
15676        ))
15677    }
15678}
15679
15680/// Entity Name Transformation Types
15681///
15682/// # Working with unknown values
15683///
15684/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15685/// additional enum variants at any time. Adding new variants is not considered
15686/// a breaking change. Applications should write their code in anticipation of:
15687///
15688/// - New values appearing in future releases of the client library, **and**
15689/// - New values received dynamically, without application changes.
15690///
15691/// Please consult the [Working with enums] section in the user guide for some
15692/// guidelines.
15693///
15694/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15695#[derive(Clone, Debug, PartialEq)]
15696#[non_exhaustive]
15697pub enum EntityNameTransformation {
15698    /// Entity name transformation unspecified.
15699    Unspecified,
15700    /// No transformation.
15701    NoTransformation,
15702    /// Transform to lower case.
15703    LowerCase,
15704    /// Transform to upper case.
15705    UpperCase,
15706    /// Transform to capitalized case.
15707    CapitalizedCase,
15708    /// If set, the enum was initialized with an unknown value.
15709    ///
15710    /// Applications can examine the value using [EntityNameTransformation::value] or
15711    /// [EntityNameTransformation::name].
15712    UnknownValue(entity_name_transformation::UnknownValue),
15713}
15714
15715#[doc(hidden)]
15716pub mod entity_name_transformation {
15717    #[allow(unused_imports)]
15718    use super::*;
15719    #[derive(Clone, Debug, PartialEq)]
15720    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15721}
15722
15723impl EntityNameTransformation {
15724    /// Gets the enum value.
15725    ///
15726    /// Returns `None` if the enum contains an unknown value deserialized from
15727    /// the string representation of enums.
15728    pub fn value(&self) -> std::option::Option<i32> {
15729        match self {
15730            Self::Unspecified => std::option::Option::Some(0),
15731            Self::NoTransformation => std::option::Option::Some(1),
15732            Self::LowerCase => std::option::Option::Some(2),
15733            Self::UpperCase => std::option::Option::Some(3),
15734            Self::CapitalizedCase => std::option::Option::Some(4),
15735            Self::UnknownValue(u) => u.0.value(),
15736        }
15737    }
15738
15739    /// Gets the enum value as a string.
15740    ///
15741    /// Returns `None` if the enum contains an unknown value deserialized from
15742    /// the integer representation of enums.
15743    pub fn name(&self) -> std::option::Option<&str> {
15744        match self {
15745            Self::Unspecified => {
15746                std::option::Option::Some("ENTITY_NAME_TRANSFORMATION_UNSPECIFIED")
15747            }
15748            Self::NoTransformation => {
15749                std::option::Option::Some("ENTITY_NAME_TRANSFORMATION_NO_TRANSFORMATION")
15750            }
15751            Self::LowerCase => std::option::Option::Some("ENTITY_NAME_TRANSFORMATION_LOWER_CASE"),
15752            Self::UpperCase => std::option::Option::Some("ENTITY_NAME_TRANSFORMATION_UPPER_CASE"),
15753            Self::CapitalizedCase => {
15754                std::option::Option::Some("ENTITY_NAME_TRANSFORMATION_CAPITALIZED_CASE")
15755            }
15756            Self::UnknownValue(u) => u.0.name(),
15757        }
15758    }
15759}
15760
15761impl std::default::Default for EntityNameTransformation {
15762    fn default() -> Self {
15763        use std::convert::From;
15764        Self::from(0)
15765    }
15766}
15767
15768impl std::fmt::Display for EntityNameTransformation {
15769    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15770        wkt::internal::display_enum(f, self.name(), self.value())
15771    }
15772}
15773
15774impl std::convert::From<i32> for EntityNameTransformation {
15775    fn from(value: i32) -> Self {
15776        match value {
15777            0 => Self::Unspecified,
15778            1 => Self::NoTransformation,
15779            2 => Self::LowerCase,
15780            3 => Self::UpperCase,
15781            4 => Self::CapitalizedCase,
15782            _ => Self::UnknownValue(entity_name_transformation::UnknownValue(
15783                wkt::internal::UnknownEnumValue::Integer(value),
15784            )),
15785        }
15786    }
15787}
15788
15789impl std::convert::From<&str> for EntityNameTransformation {
15790    fn from(value: &str) -> Self {
15791        use std::string::ToString;
15792        match value {
15793            "ENTITY_NAME_TRANSFORMATION_UNSPECIFIED" => Self::Unspecified,
15794            "ENTITY_NAME_TRANSFORMATION_NO_TRANSFORMATION" => Self::NoTransformation,
15795            "ENTITY_NAME_TRANSFORMATION_LOWER_CASE" => Self::LowerCase,
15796            "ENTITY_NAME_TRANSFORMATION_UPPER_CASE" => Self::UpperCase,
15797            "ENTITY_NAME_TRANSFORMATION_CAPITALIZED_CASE" => Self::CapitalizedCase,
15798            _ => Self::UnknownValue(entity_name_transformation::UnknownValue(
15799                wkt::internal::UnknownEnumValue::String(value.to_string()),
15800            )),
15801        }
15802    }
15803}
15804
15805impl serde::ser::Serialize for EntityNameTransformation {
15806    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15807    where
15808        S: serde::Serializer,
15809    {
15810        match self {
15811            Self::Unspecified => serializer.serialize_i32(0),
15812            Self::NoTransformation => serializer.serialize_i32(1),
15813            Self::LowerCase => serializer.serialize_i32(2),
15814            Self::UpperCase => serializer.serialize_i32(3),
15815            Self::CapitalizedCase => serializer.serialize_i32(4),
15816            Self::UnknownValue(u) => u.0.serialize(serializer),
15817        }
15818    }
15819}
15820
15821impl<'de> serde::de::Deserialize<'de> for EntityNameTransformation {
15822    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15823    where
15824        D: serde::Deserializer<'de>,
15825    {
15826        deserializer.deserialize_any(wkt::internal::EnumVisitor::<EntityNameTransformation>::new(
15827            ".google.cloud.clouddms.v1.EntityNameTransformation",
15828        ))
15829    }
15830}
15831
15832/// The types of jobs that can be executed in the background.
15833///
15834/// # Working with unknown values
15835///
15836/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15837/// additional enum variants at any time. Adding new variants is not considered
15838/// a breaking change. Applications should write their code in anticipation of:
15839///
15840/// - New values appearing in future releases of the client library, **and**
15841/// - New values received dynamically, without application changes.
15842///
15843/// Please consult the [Working with enums] section in the user guide for some
15844/// guidelines.
15845///
15846/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15847#[derive(Clone, Debug, PartialEq)]
15848#[non_exhaustive]
15849pub enum BackgroundJobType {
15850    /// Unspecified background job type.
15851    Unspecified,
15852    /// Job to seed from the source database.
15853    SourceSeed,
15854    /// Job to convert the source database into a draft of the destination
15855    /// database.
15856    Convert,
15857    /// Job to apply the draft tree onto the destination.
15858    ApplyDestination,
15859    /// Job to import and convert mapping rules from an external source such as an
15860    /// ora2pg config file.
15861    ImportRulesFile,
15862    /// If set, the enum was initialized with an unknown value.
15863    ///
15864    /// Applications can examine the value using [BackgroundJobType::value] or
15865    /// [BackgroundJobType::name].
15866    UnknownValue(background_job_type::UnknownValue),
15867}
15868
15869#[doc(hidden)]
15870pub mod background_job_type {
15871    #[allow(unused_imports)]
15872    use super::*;
15873    #[derive(Clone, Debug, PartialEq)]
15874    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15875}
15876
15877impl BackgroundJobType {
15878    /// Gets the enum value.
15879    ///
15880    /// Returns `None` if the enum contains an unknown value deserialized from
15881    /// the string representation of enums.
15882    pub fn value(&self) -> std::option::Option<i32> {
15883        match self {
15884            Self::Unspecified => std::option::Option::Some(0),
15885            Self::SourceSeed => std::option::Option::Some(1),
15886            Self::Convert => std::option::Option::Some(2),
15887            Self::ApplyDestination => std::option::Option::Some(3),
15888            Self::ImportRulesFile => std::option::Option::Some(5),
15889            Self::UnknownValue(u) => u.0.value(),
15890        }
15891    }
15892
15893    /// Gets the enum value as a string.
15894    ///
15895    /// Returns `None` if the enum contains an unknown value deserialized from
15896    /// the integer representation of enums.
15897    pub fn name(&self) -> std::option::Option<&str> {
15898        match self {
15899            Self::Unspecified => std::option::Option::Some("BACKGROUND_JOB_TYPE_UNSPECIFIED"),
15900            Self::SourceSeed => std::option::Option::Some("BACKGROUND_JOB_TYPE_SOURCE_SEED"),
15901            Self::Convert => std::option::Option::Some("BACKGROUND_JOB_TYPE_CONVERT"),
15902            Self::ApplyDestination => {
15903                std::option::Option::Some("BACKGROUND_JOB_TYPE_APPLY_DESTINATION")
15904            }
15905            Self::ImportRulesFile => {
15906                std::option::Option::Some("BACKGROUND_JOB_TYPE_IMPORT_RULES_FILE")
15907            }
15908            Self::UnknownValue(u) => u.0.name(),
15909        }
15910    }
15911}
15912
15913impl std::default::Default for BackgroundJobType {
15914    fn default() -> Self {
15915        use std::convert::From;
15916        Self::from(0)
15917    }
15918}
15919
15920impl std::fmt::Display for BackgroundJobType {
15921    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15922        wkt::internal::display_enum(f, self.name(), self.value())
15923    }
15924}
15925
15926impl std::convert::From<i32> for BackgroundJobType {
15927    fn from(value: i32) -> Self {
15928        match value {
15929            0 => Self::Unspecified,
15930            1 => Self::SourceSeed,
15931            2 => Self::Convert,
15932            3 => Self::ApplyDestination,
15933            5 => Self::ImportRulesFile,
15934            _ => Self::UnknownValue(background_job_type::UnknownValue(
15935                wkt::internal::UnknownEnumValue::Integer(value),
15936            )),
15937        }
15938    }
15939}
15940
15941impl std::convert::From<&str> for BackgroundJobType {
15942    fn from(value: &str) -> Self {
15943        use std::string::ToString;
15944        match value {
15945            "BACKGROUND_JOB_TYPE_UNSPECIFIED" => Self::Unspecified,
15946            "BACKGROUND_JOB_TYPE_SOURCE_SEED" => Self::SourceSeed,
15947            "BACKGROUND_JOB_TYPE_CONVERT" => Self::Convert,
15948            "BACKGROUND_JOB_TYPE_APPLY_DESTINATION" => Self::ApplyDestination,
15949            "BACKGROUND_JOB_TYPE_IMPORT_RULES_FILE" => Self::ImportRulesFile,
15950            _ => Self::UnknownValue(background_job_type::UnknownValue(
15951                wkt::internal::UnknownEnumValue::String(value.to_string()),
15952            )),
15953        }
15954    }
15955}
15956
15957impl serde::ser::Serialize for BackgroundJobType {
15958    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15959    where
15960        S: serde::Serializer,
15961    {
15962        match self {
15963            Self::Unspecified => serializer.serialize_i32(0),
15964            Self::SourceSeed => serializer.serialize_i32(1),
15965            Self::Convert => serializer.serialize_i32(2),
15966            Self::ApplyDestination => serializer.serialize_i32(3),
15967            Self::ImportRulesFile => serializer.serialize_i32(5),
15968            Self::UnknownValue(u) => u.0.serialize(serializer),
15969        }
15970    }
15971}
15972
15973impl<'de> serde::de::Deserialize<'de> for BackgroundJobType {
15974    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15975    where
15976        D: serde::Deserializer<'de>,
15977    {
15978        deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackgroundJobType>::new(
15979            ".google.cloud.clouddms.v1.BackgroundJobType",
15980        ))
15981    }
15982}
15983
15984/// The format for the import rules file.
15985///
15986/// # Working with unknown values
15987///
15988/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15989/// additional enum variants at any time. Adding new variants is not considered
15990/// a breaking change. Applications should write their code in anticipation of:
15991///
15992/// - New values appearing in future releases of the client library, **and**
15993/// - New values received dynamically, without application changes.
15994///
15995/// Please consult the [Working with enums] section in the user guide for some
15996/// guidelines.
15997///
15998/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15999#[derive(Clone, Debug, PartialEq)]
16000#[non_exhaustive]
16001pub enum ImportRulesFileFormat {
16002    /// Unspecified rules format.
16003    Unspecified,
16004    /// HarbourBridge session file.
16005    HarbourBridgeSessionFile,
16006    /// Ora2Pg configuration file.
16007    OratopgConfigFile,
16008    /// If set, the enum was initialized with an unknown value.
16009    ///
16010    /// Applications can examine the value using [ImportRulesFileFormat::value] or
16011    /// [ImportRulesFileFormat::name].
16012    UnknownValue(import_rules_file_format::UnknownValue),
16013}
16014
16015#[doc(hidden)]
16016pub mod import_rules_file_format {
16017    #[allow(unused_imports)]
16018    use super::*;
16019    #[derive(Clone, Debug, PartialEq)]
16020    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16021}
16022
16023impl ImportRulesFileFormat {
16024    /// Gets the enum value.
16025    ///
16026    /// Returns `None` if the enum contains an unknown value deserialized from
16027    /// the string representation of enums.
16028    pub fn value(&self) -> std::option::Option<i32> {
16029        match self {
16030            Self::Unspecified => std::option::Option::Some(0),
16031            Self::HarbourBridgeSessionFile => std::option::Option::Some(1),
16032            Self::OratopgConfigFile => std::option::Option::Some(2),
16033            Self::UnknownValue(u) => u.0.value(),
16034        }
16035    }
16036
16037    /// Gets the enum value as a string.
16038    ///
16039    /// Returns `None` if the enum contains an unknown value deserialized from
16040    /// the integer representation of enums.
16041    pub fn name(&self) -> std::option::Option<&str> {
16042        match self {
16043            Self::Unspecified => std::option::Option::Some("IMPORT_RULES_FILE_FORMAT_UNSPECIFIED"),
16044            Self::HarbourBridgeSessionFile => {
16045                std::option::Option::Some("IMPORT_RULES_FILE_FORMAT_HARBOUR_BRIDGE_SESSION_FILE")
16046            }
16047            Self::OratopgConfigFile => {
16048                std::option::Option::Some("IMPORT_RULES_FILE_FORMAT_ORATOPG_CONFIG_FILE")
16049            }
16050            Self::UnknownValue(u) => u.0.name(),
16051        }
16052    }
16053}
16054
16055impl std::default::Default for ImportRulesFileFormat {
16056    fn default() -> Self {
16057        use std::convert::From;
16058        Self::from(0)
16059    }
16060}
16061
16062impl std::fmt::Display for ImportRulesFileFormat {
16063    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16064        wkt::internal::display_enum(f, self.name(), self.value())
16065    }
16066}
16067
16068impl std::convert::From<i32> for ImportRulesFileFormat {
16069    fn from(value: i32) -> Self {
16070        match value {
16071            0 => Self::Unspecified,
16072            1 => Self::HarbourBridgeSessionFile,
16073            2 => Self::OratopgConfigFile,
16074            _ => Self::UnknownValue(import_rules_file_format::UnknownValue(
16075                wkt::internal::UnknownEnumValue::Integer(value),
16076            )),
16077        }
16078    }
16079}
16080
16081impl std::convert::From<&str> for ImportRulesFileFormat {
16082    fn from(value: &str) -> Self {
16083        use std::string::ToString;
16084        match value {
16085            "IMPORT_RULES_FILE_FORMAT_UNSPECIFIED" => Self::Unspecified,
16086            "IMPORT_RULES_FILE_FORMAT_HARBOUR_BRIDGE_SESSION_FILE" => {
16087                Self::HarbourBridgeSessionFile
16088            }
16089            "IMPORT_RULES_FILE_FORMAT_ORATOPG_CONFIG_FILE" => Self::OratopgConfigFile,
16090            _ => Self::UnknownValue(import_rules_file_format::UnknownValue(
16091                wkt::internal::UnknownEnumValue::String(value.to_string()),
16092            )),
16093        }
16094    }
16095}
16096
16097impl serde::ser::Serialize for ImportRulesFileFormat {
16098    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16099    where
16100        S: serde::Serializer,
16101    {
16102        match self {
16103            Self::Unspecified => serializer.serialize_i32(0),
16104            Self::HarbourBridgeSessionFile => serializer.serialize_i32(1),
16105            Self::OratopgConfigFile => serializer.serialize_i32(2),
16106            Self::UnknownValue(u) => u.0.serialize(serializer),
16107        }
16108    }
16109}
16110
16111impl<'de> serde::de::Deserialize<'de> for ImportRulesFileFormat {
16112    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16113    where
16114        D: serde::Deserializer<'de>,
16115    {
16116        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ImportRulesFileFormat>::new(
16117            ".google.cloud.clouddms.v1.ImportRulesFileFormat",
16118        ))
16119    }
16120}
16121
16122/// Enum used by IntComparisonFilter and DoubleComparisonFilter to indicate the
16123/// relation between source value and compare value.
16124///
16125/// # Working with unknown values
16126///
16127/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16128/// additional enum variants at any time. Adding new variants is not considered
16129/// a breaking change. Applications should write their code in anticipation of:
16130///
16131/// - New values appearing in future releases of the client library, **and**
16132/// - New values received dynamically, without application changes.
16133///
16134/// Please consult the [Working with enums] section in the user guide for some
16135/// guidelines.
16136///
16137/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16138#[derive(Clone, Debug, PartialEq)]
16139#[non_exhaustive]
16140pub enum ValueComparison {
16141    /// Value comparison unspecified.
16142    Unspecified,
16143    /// Value is smaller than the Compare value.
16144    IfValueSmallerThan,
16145    /// Value is smaller or equal than the Compare value.
16146    IfValueSmallerEqualThan,
16147    /// Value is larger than the Compare value.
16148    IfValueLargerThan,
16149    /// Value is larger or equal than the Compare value.
16150    IfValueLargerEqualThan,
16151    /// If set, the enum was initialized with an unknown value.
16152    ///
16153    /// Applications can examine the value using [ValueComparison::value] or
16154    /// [ValueComparison::name].
16155    UnknownValue(value_comparison::UnknownValue),
16156}
16157
16158#[doc(hidden)]
16159pub mod value_comparison {
16160    #[allow(unused_imports)]
16161    use super::*;
16162    #[derive(Clone, Debug, PartialEq)]
16163    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16164}
16165
16166impl ValueComparison {
16167    /// Gets the enum value.
16168    ///
16169    /// Returns `None` if the enum contains an unknown value deserialized from
16170    /// the string representation of enums.
16171    pub fn value(&self) -> std::option::Option<i32> {
16172        match self {
16173            Self::Unspecified => std::option::Option::Some(0),
16174            Self::IfValueSmallerThan => std::option::Option::Some(1),
16175            Self::IfValueSmallerEqualThan => std::option::Option::Some(2),
16176            Self::IfValueLargerThan => std::option::Option::Some(3),
16177            Self::IfValueLargerEqualThan => std::option::Option::Some(4),
16178            Self::UnknownValue(u) => u.0.value(),
16179        }
16180    }
16181
16182    /// Gets the enum value as a string.
16183    ///
16184    /// Returns `None` if the enum contains an unknown value deserialized from
16185    /// the integer representation of enums.
16186    pub fn name(&self) -> std::option::Option<&str> {
16187        match self {
16188            Self::Unspecified => std::option::Option::Some("VALUE_COMPARISON_UNSPECIFIED"),
16189            Self::IfValueSmallerThan => {
16190                std::option::Option::Some("VALUE_COMPARISON_IF_VALUE_SMALLER_THAN")
16191            }
16192            Self::IfValueSmallerEqualThan => {
16193                std::option::Option::Some("VALUE_COMPARISON_IF_VALUE_SMALLER_EQUAL_THAN")
16194            }
16195            Self::IfValueLargerThan => {
16196                std::option::Option::Some("VALUE_COMPARISON_IF_VALUE_LARGER_THAN")
16197            }
16198            Self::IfValueLargerEqualThan => {
16199                std::option::Option::Some("VALUE_COMPARISON_IF_VALUE_LARGER_EQUAL_THAN")
16200            }
16201            Self::UnknownValue(u) => u.0.name(),
16202        }
16203    }
16204}
16205
16206impl std::default::Default for ValueComparison {
16207    fn default() -> Self {
16208        use std::convert::From;
16209        Self::from(0)
16210    }
16211}
16212
16213impl std::fmt::Display for ValueComparison {
16214    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16215        wkt::internal::display_enum(f, self.name(), self.value())
16216    }
16217}
16218
16219impl std::convert::From<i32> for ValueComparison {
16220    fn from(value: i32) -> Self {
16221        match value {
16222            0 => Self::Unspecified,
16223            1 => Self::IfValueSmallerThan,
16224            2 => Self::IfValueSmallerEqualThan,
16225            3 => Self::IfValueLargerThan,
16226            4 => Self::IfValueLargerEqualThan,
16227            _ => Self::UnknownValue(value_comparison::UnknownValue(
16228                wkt::internal::UnknownEnumValue::Integer(value),
16229            )),
16230        }
16231    }
16232}
16233
16234impl std::convert::From<&str> for ValueComparison {
16235    fn from(value: &str) -> Self {
16236        use std::string::ToString;
16237        match value {
16238            "VALUE_COMPARISON_UNSPECIFIED" => Self::Unspecified,
16239            "VALUE_COMPARISON_IF_VALUE_SMALLER_THAN" => Self::IfValueSmallerThan,
16240            "VALUE_COMPARISON_IF_VALUE_SMALLER_EQUAL_THAN" => Self::IfValueSmallerEqualThan,
16241            "VALUE_COMPARISON_IF_VALUE_LARGER_THAN" => Self::IfValueLargerThan,
16242            "VALUE_COMPARISON_IF_VALUE_LARGER_EQUAL_THAN" => Self::IfValueLargerEqualThan,
16243            _ => Self::UnknownValue(value_comparison::UnknownValue(
16244                wkt::internal::UnknownEnumValue::String(value.to_string()),
16245            )),
16246        }
16247    }
16248}
16249
16250impl serde::ser::Serialize for ValueComparison {
16251    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16252    where
16253        S: serde::Serializer,
16254    {
16255        match self {
16256            Self::Unspecified => serializer.serialize_i32(0),
16257            Self::IfValueSmallerThan => serializer.serialize_i32(1),
16258            Self::IfValueSmallerEqualThan => serializer.serialize_i32(2),
16259            Self::IfValueLargerThan => serializer.serialize_i32(3),
16260            Self::IfValueLargerEqualThan => serializer.serialize_i32(4),
16261            Self::UnknownValue(u) => u.0.serialize(serializer),
16262        }
16263    }
16264}
16265
16266impl<'de> serde::de::Deserialize<'de> for ValueComparison {
16267    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16268    where
16269        D: serde::Deserializer<'de>,
16270    {
16271        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ValueComparison>::new(
16272            ".google.cloud.clouddms.v1.ValueComparison",
16273        ))
16274    }
16275}
16276
16277/// Specifies the columns on which numeric filter needs to be applied.
16278///
16279/// # Working with unknown values
16280///
16281/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16282/// additional enum variants at any time. Adding new variants is not considered
16283/// a breaking change. Applications should write their code in anticipation of:
16284///
16285/// - New values appearing in future releases of the client library, **and**
16286/// - New values received dynamically, without application changes.
16287///
16288/// Please consult the [Working with enums] section in the user guide for some
16289/// guidelines.
16290///
16291/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16292#[derive(Clone, Debug, PartialEq)]
16293#[non_exhaustive]
16294pub enum NumericFilterOption {
16295    /// Numeric filter option unspecified
16296    Unspecified,
16297    /// Numeric filter option that matches all numeric columns.
16298    All,
16299    /// Numeric filter option that matches columns having numeric datatypes with
16300    /// specified precision and scale within the limited range of filter.
16301    Limit,
16302    /// Numeric filter option that matches only the numeric columns with no
16303    /// precision and scale specified.
16304    Limitless,
16305    /// If set, the enum was initialized with an unknown value.
16306    ///
16307    /// Applications can examine the value using [NumericFilterOption::value] or
16308    /// [NumericFilterOption::name].
16309    UnknownValue(numeric_filter_option::UnknownValue),
16310}
16311
16312#[doc(hidden)]
16313pub mod numeric_filter_option {
16314    #[allow(unused_imports)]
16315    use super::*;
16316    #[derive(Clone, Debug, PartialEq)]
16317    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16318}
16319
16320impl NumericFilterOption {
16321    /// Gets the enum value.
16322    ///
16323    /// Returns `None` if the enum contains an unknown value deserialized from
16324    /// the string representation of enums.
16325    pub fn value(&self) -> std::option::Option<i32> {
16326        match self {
16327            Self::Unspecified => std::option::Option::Some(0),
16328            Self::All => std::option::Option::Some(1),
16329            Self::Limit => std::option::Option::Some(2),
16330            Self::Limitless => std::option::Option::Some(3),
16331            Self::UnknownValue(u) => u.0.value(),
16332        }
16333    }
16334
16335    /// Gets the enum value as a string.
16336    ///
16337    /// Returns `None` if the enum contains an unknown value deserialized from
16338    /// the integer representation of enums.
16339    pub fn name(&self) -> std::option::Option<&str> {
16340        match self {
16341            Self::Unspecified => std::option::Option::Some("NUMERIC_FILTER_OPTION_UNSPECIFIED"),
16342            Self::All => std::option::Option::Some("NUMERIC_FILTER_OPTION_ALL"),
16343            Self::Limit => std::option::Option::Some("NUMERIC_FILTER_OPTION_LIMIT"),
16344            Self::Limitless => std::option::Option::Some("NUMERIC_FILTER_OPTION_LIMITLESS"),
16345            Self::UnknownValue(u) => u.0.name(),
16346        }
16347    }
16348}
16349
16350impl std::default::Default for NumericFilterOption {
16351    fn default() -> Self {
16352        use std::convert::From;
16353        Self::from(0)
16354    }
16355}
16356
16357impl std::fmt::Display for NumericFilterOption {
16358    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16359        wkt::internal::display_enum(f, self.name(), self.value())
16360    }
16361}
16362
16363impl std::convert::From<i32> for NumericFilterOption {
16364    fn from(value: i32) -> Self {
16365        match value {
16366            0 => Self::Unspecified,
16367            1 => Self::All,
16368            2 => Self::Limit,
16369            3 => Self::Limitless,
16370            _ => Self::UnknownValue(numeric_filter_option::UnknownValue(
16371                wkt::internal::UnknownEnumValue::Integer(value),
16372            )),
16373        }
16374    }
16375}
16376
16377impl std::convert::From<&str> for NumericFilterOption {
16378    fn from(value: &str) -> Self {
16379        use std::string::ToString;
16380        match value {
16381            "NUMERIC_FILTER_OPTION_UNSPECIFIED" => Self::Unspecified,
16382            "NUMERIC_FILTER_OPTION_ALL" => Self::All,
16383            "NUMERIC_FILTER_OPTION_LIMIT" => Self::Limit,
16384            "NUMERIC_FILTER_OPTION_LIMITLESS" => Self::Limitless,
16385            _ => Self::UnknownValue(numeric_filter_option::UnknownValue(
16386                wkt::internal::UnknownEnumValue::String(value.to_string()),
16387            )),
16388        }
16389    }
16390}
16391
16392impl serde::ser::Serialize for NumericFilterOption {
16393    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16394    where
16395        S: serde::Serializer,
16396    {
16397        match self {
16398            Self::Unspecified => serializer.serialize_i32(0),
16399            Self::All => serializer.serialize_i32(1),
16400            Self::Limit => serializer.serialize_i32(2),
16401            Self::Limitless => serializer.serialize_i32(3),
16402            Self::UnknownValue(u) => u.0.serialize(serializer),
16403        }
16404    }
16405}
16406
16407impl<'de> serde::de::Deserialize<'de> for NumericFilterOption {
16408    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16409    where
16410        D: serde::Deserializer<'de>,
16411    {
16412        deserializer.deserialize_any(wkt::internal::EnumVisitor::<NumericFilterOption>::new(
16413            ".google.cloud.clouddms.v1.NumericFilterOption",
16414        ))
16415    }
16416}