google_cloud_sql_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 lazy_static;
25extern crate reqwest;
26extern crate serde;
27extern crate serde_json;
28extern crate serde_with;
29extern crate std;
30extern crate tracing;
31extern crate wkt;
32
33mod debug;
34mod deserialize;
35mod serialize;
36
37/// Backup runs delete request.
38#[derive(Clone, Default, PartialEq)]
39#[non_exhaustive]
40pub struct SqlBackupRunsDeleteRequest {
41    /// The ID of the backup run to delete. To find a backup run ID, use the
42    /// [list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/backupRuns/list)
43    /// method.
44    pub id: i64,
45
46    /// Cloud SQL instance ID. This does not include the project ID.
47    pub instance: std::string::String,
48
49    /// Project ID of the project that contains the instance.
50    pub project: std::string::String,
51
52    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
53}
54
55impl SqlBackupRunsDeleteRequest {
56    pub fn new() -> Self {
57        std::default::Default::default()
58    }
59
60    /// Sets the value of [id][crate::model::SqlBackupRunsDeleteRequest::id].
61    pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
62        self.id = v.into();
63        self
64    }
65
66    /// Sets the value of [instance][crate::model::SqlBackupRunsDeleteRequest::instance].
67    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
68        self.instance = v.into();
69        self
70    }
71
72    /// Sets the value of [project][crate::model::SqlBackupRunsDeleteRequest::project].
73    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
74        self.project = v.into();
75        self
76    }
77}
78
79impl wkt::message::Message for SqlBackupRunsDeleteRequest {
80    fn typename() -> &'static str {
81        "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsDeleteRequest"
82    }
83}
84
85/// Backup runs get request.
86#[derive(Clone, Default, PartialEq)]
87#[non_exhaustive]
88pub struct SqlBackupRunsGetRequest {
89    /// The ID of this backup run.
90    pub id: i64,
91
92    /// Cloud SQL instance ID. This does not include the project ID.
93    pub instance: std::string::String,
94
95    /// Project ID of the project that contains the instance.
96    pub project: std::string::String,
97
98    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
99}
100
101impl SqlBackupRunsGetRequest {
102    pub fn new() -> Self {
103        std::default::Default::default()
104    }
105
106    /// Sets the value of [id][crate::model::SqlBackupRunsGetRequest::id].
107    pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
108        self.id = v.into();
109        self
110    }
111
112    /// Sets the value of [instance][crate::model::SqlBackupRunsGetRequest::instance].
113    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
114        self.instance = v.into();
115        self
116    }
117
118    /// Sets the value of [project][crate::model::SqlBackupRunsGetRequest::project].
119    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
120        self.project = v.into();
121        self
122    }
123}
124
125impl wkt::message::Message for SqlBackupRunsGetRequest {
126    fn typename() -> &'static str {
127        "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsGetRequest"
128    }
129}
130
131/// Backup runs insert request.
132#[derive(Clone, Default, PartialEq)]
133#[non_exhaustive]
134pub struct SqlBackupRunsInsertRequest {
135    /// Cloud SQL instance ID. This does not include the project ID.
136    pub instance: std::string::String,
137
138    /// Project ID of the project that contains the instance.
139    pub project: std::string::String,
140
141    pub body: std::option::Option<crate::model::BackupRun>,
142
143    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
144}
145
146impl SqlBackupRunsInsertRequest {
147    pub fn new() -> Self {
148        std::default::Default::default()
149    }
150
151    /// Sets the value of [instance][crate::model::SqlBackupRunsInsertRequest::instance].
152    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
153        self.instance = v.into();
154        self
155    }
156
157    /// Sets the value of [project][crate::model::SqlBackupRunsInsertRequest::project].
158    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
159        self.project = v.into();
160        self
161    }
162
163    /// Sets the value of [body][crate::model::SqlBackupRunsInsertRequest::body].
164    pub fn set_body<T>(mut self, v: T) -> Self
165    where
166        T: std::convert::Into<crate::model::BackupRun>,
167    {
168        self.body = std::option::Option::Some(v.into());
169        self
170    }
171
172    /// Sets or clears the value of [body][crate::model::SqlBackupRunsInsertRequest::body].
173    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
174    where
175        T: std::convert::Into<crate::model::BackupRun>,
176    {
177        self.body = v.map(|x| x.into());
178        self
179    }
180}
181
182impl wkt::message::Message for SqlBackupRunsInsertRequest {
183    fn typename() -> &'static str {
184        "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsInsertRequest"
185    }
186}
187
188/// Backup runs list request.
189#[derive(Clone, Default, PartialEq)]
190#[non_exhaustive]
191pub struct SqlBackupRunsListRequest {
192    /// Cloud SQL instance ID, or "-" for all instances. This does not include
193    /// the project ID.
194    pub instance: std::string::String,
195
196    /// Maximum number of backup runs per response.
197    pub max_results: i32,
198
199    /// A previously-returned page token representing part of the larger set of
200    /// results to view.
201    pub page_token: std::string::String,
202
203    /// Project ID of the project that contains the instance.
204    pub project: std::string::String,
205
206    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
207}
208
209impl SqlBackupRunsListRequest {
210    pub fn new() -> Self {
211        std::default::Default::default()
212    }
213
214    /// Sets the value of [instance][crate::model::SqlBackupRunsListRequest::instance].
215    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
216        self.instance = v.into();
217        self
218    }
219
220    /// Sets the value of [max_results][crate::model::SqlBackupRunsListRequest::max_results].
221    pub fn set_max_results<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
222        self.max_results = v.into();
223        self
224    }
225
226    /// Sets the value of [page_token][crate::model::SqlBackupRunsListRequest::page_token].
227    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
228        self.page_token = v.into();
229        self
230    }
231
232    /// Sets the value of [project][crate::model::SqlBackupRunsListRequest::project].
233    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
234        self.project = v.into();
235        self
236    }
237}
238
239impl wkt::message::Message for SqlBackupRunsListRequest {
240    fn typename() -> &'static str {
241        "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsListRequest"
242    }
243}
244
245/// A BackupRun resource.
246#[derive(Clone, Default, PartialEq)]
247#[non_exhaustive]
248pub struct BackupRun {
249    /// This is always `sql#backupRun`.
250    pub kind: std::string::String,
251
252    /// The status of this run.
253    pub status: crate::model::SqlBackupRunStatus,
254
255    /// The time the run was enqueued in UTC timezone in
256    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
257    /// `2012-11-15T16:19:00.094Z`.
258    pub enqueued_time: std::option::Option<wkt::Timestamp>,
259
260    /// The identifier for this backup run. Unique only for a specific Cloud SQL
261    /// instance.
262    pub id: i64,
263
264    /// The time the backup operation actually started in UTC timezone in
265    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
266    /// `2012-11-15T16:19:00.094Z`.
267    pub start_time: std::option::Option<wkt::Timestamp>,
268
269    /// The time the backup operation completed in UTC timezone in
270    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
271    /// `2012-11-15T16:19:00.094Z`.
272    pub end_time: std::option::Option<wkt::Timestamp>,
273
274    /// Information about why the backup operation failed. This is only present if
275    /// the run has the FAILED status.
276    pub error: std::option::Option<crate::model::OperationError>,
277
278    /// The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL".
279    /// This field defaults to "ON_DEMAND" and is ignored, when specified for
280    /// insert requests.
281    pub r#type: crate::model::SqlBackupRunType,
282
283    /// The description of this run, only applicable to on-demand backups.
284    pub description: std::string::String,
285
286    /// The start time of the backup window during which this the backup was
287    /// attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
288    /// example `2012-11-15T16:19:00.094Z`.
289    pub window_start_time: std::option::Option<wkt::Timestamp>,
290
291    /// Name of the database instance.
292    pub instance: std::string::String,
293
294    /// The URI of this resource.
295    pub self_link: std::string::String,
296
297    /// Location of the backups.
298    pub location: std::string::String,
299
300    /// Encryption configuration specific to a backup.
301    pub disk_encryption_configuration:
302        std::option::Option<crate::model::DiskEncryptionConfiguration>,
303
304    /// Encryption status specific to a backup.
305    pub disk_encryption_status: std::option::Option<crate::model::DiskEncryptionStatus>,
306
307    /// Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
308    pub backup_kind: crate::model::SqlBackupKind,
309
310    /// Backup time zone to prevent restores to an instance with
311    /// a different time zone. Now relevant only for SQL Server.
312    pub time_zone: std::string::String,
313
314    /// Output only. The maximum chargeable bytes for the backup.
315    pub max_chargeable_bytes: std::option::Option<i64>,
316
317    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
318}
319
320impl BackupRun {
321    pub fn new() -> Self {
322        std::default::Default::default()
323    }
324
325    /// Sets the value of [kind][crate::model::BackupRun::kind].
326    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
327        self.kind = v.into();
328        self
329    }
330
331    /// Sets the value of [status][crate::model::BackupRun::status].
332    pub fn set_status<T: std::convert::Into<crate::model::SqlBackupRunStatus>>(
333        mut self,
334        v: T,
335    ) -> Self {
336        self.status = v.into();
337        self
338    }
339
340    /// Sets the value of [enqueued_time][crate::model::BackupRun::enqueued_time].
341    pub fn set_enqueued_time<T>(mut self, v: T) -> Self
342    where
343        T: std::convert::Into<wkt::Timestamp>,
344    {
345        self.enqueued_time = std::option::Option::Some(v.into());
346        self
347    }
348
349    /// Sets or clears the value of [enqueued_time][crate::model::BackupRun::enqueued_time].
350    pub fn set_or_clear_enqueued_time<T>(mut self, v: std::option::Option<T>) -> Self
351    where
352        T: std::convert::Into<wkt::Timestamp>,
353    {
354        self.enqueued_time = v.map(|x| x.into());
355        self
356    }
357
358    /// Sets the value of [id][crate::model::BackupRun::id].
359    pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
360        self.id = v.into();
361        self
362    }
363
364    /// Sets the value of [start_time][crate::model::BackupRun::start_time].
365    pub fn set_start_time<T>(mut self, v: T) -> Self
366    where
367        T: std::convert::Into<wkt::Timestamp>,
368    {
369        self.start_time = std::option::Option::Some(v.into());
370        self
371    }
372
373    /// Sets or clears the value of [start_time][crate::model::BackupRun::start_time].
374    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
375    where
376        T: std::convert::Into<wkt::Timestamp>,
377    {
378        self.start_time = v.map(|x| x.into());
379        self
380    }
381
382    /// Sets the value of [end_time][crate::model::BackupRun::end_time].
383    pub fn set_end_time<T>(mut self, v: T) -> Self
384    where
385        T: std::convert::Into<wkt::Timestamp>,
386    {
387        self.end_time = std::option::Option::Some(v.into());
388        self
389    }
390
391    /// Sets or clears the value of [end_time][crate::model::BackupRun::end_time].
392    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
393    where
394        T: std::convert::Into<wkt::Timestamp>,
395    {
396        self.end_time = v.map(|x| x.into());
397        self
398    }
399
400    /// Sets the value of [error][crate::model::BackupRun::error].
401    pub fn set_error<T>(mut self, v: T) -> Self
402    where
403        T: std::convert::Into<crate::model::OperationError>,
404    {
405        self.error = std::option::Option::Some(v.into());
406        self
407    }
408
409    /// Sets or clears the value of [error][crate::model::BackupRun::error].
410    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
411    where
412        T: std::convert::Into<crate::model::OperationError>,
413    {
414        self.error = v.map(|x| x.into());
415        self
416    }
417
418    /// Sets the value of [r#type][crate::model::BackupRun::type].
419    pub fn set_type<T: std::convert::Into<crate::model::SqlBackupRunType>>(mut self, v: T) -> Self {
420        self.r#type = v.into();
421        self
422    }
423
424    /// Sets the value of [description][crate::model::BackupRun::description].
425    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
426        self.description = v.into();
427        self
428    }
429
430    /// Sets the value of [window_start_time][crate::model::BackupRun::window_start_time].
431    pub fn set_window_start_time<T>(mut self, v: T) -> Self
432    where
433        T: std::convert::Into<wkt::Timestamp>,
434    {
435        self.window_start_time = std::option::Option::Some(v.into());
436        self
437    }
438
439    /// Sets or clears the value of [window_start_time][crate::model::BackupRun::window_start_time].
440    pub fn set_or_clear_window_start_time<T>(mut self, v: std::option::Option<T>) -> Self
441    where
442        T: std::convert::Into<wkt::Timestamp>,
443    {
444        self.window_start_time = v.map(|x| x.into());
445        self
446    }
447
448    /// Sets the value of [instance][crate::model::BackupRun::instance].
449    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
450        self.instance = v.into();
451        self
452    }
453
454    /// Sets the value of [self_link][crate::model::BackupRun::self_link].
455    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
456        self.self_link = v.into();
457        self
458    }
459
460    /// Sets the value of [location][crate::model::BackupRun::location].
461    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
462        self.location = v.into();
463        self
464    }
465
466    /// Sets the value of [disk_encryption_configuration][crate::model::BackupRun::disk_encryption_configuration].
467    pub fn set_disk_encryption_configuration<T>(mut self, v: T) -> Self
468    where
469        T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
470    {
471        self.disk_encryption_configuration = std::option::Option::Some(v.into());
472        self
473    }
474
475    /// Sets or clears the value of [disk_encryption_configuration][crate::model::BackupRun::disk_encryption_configuration].
476    pub fn set_or_clear_disk_encryption_configuration<T>(
477        mut self,
478        v: std::option::Option<T>,
479    ) -> Self
480    where
481        T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
482    {
483        self.disk_encryption_configuration = v.map(|x| x.into());
484        self
485    }
486
487    /// Sets the value of [disk_encryption_status][crate::model::BackupRun::disk_encryption_status].
488    pub fn set_disk_encryption_status<T>(mut self, v: T) -> Self
489    where
490        T: std::convert::Into<crate::model::DiskEncryptionStatus>,
491    {
492        self.disk_encryption_status = std::option::Option::Some(v.into());
493        self
494    }
495
496    /// Sets or clears the value of [disk_encryption_status][crate::model::BackupRun::disk_encryption_status].
497    pub fn set_or_clear_disk_encryption_status<T>(mut self, v: std::option::Option<T>) -> Self
498    where
499        T: std::convert::Into<crate::model::DiskEncryptionStatus>,
500    {
501        self.disk_encryption_status = v.map(|x| x.into());
502        self
503    }
504
505    /// Sets the value of [backup_kind][crate::model::BackupRun::backup_kind].
506    pub fn set_backup_kind<T: std::convert::Into<crate::model::SqlBackupKind>>(
507        mut self,
508        v: T,
509    ) -> Self {
510        self.backup_kind = v.into();
511        self
512    }
513
514    /// Sets the value of [time_zone][crate::model::BackupRun::time_zone].
515    pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
516        self.time_zone = v.into();
517        self
518    }
519
520    /// Sets the value of [max_chargeable_bytes][crate::model::BackupRun::max_chargeable_bytes].
521    pub fn set_max_chargeable_bytes<T>(mut self, v: T) -> Self
522    where
523        T: std::convert::Into<i64>,
524    {
525        self.max_chargeable_bytes = std::option::Option::Some(v.into());
526        self
527    }
528
529    /// Sets or clears the value of [max_chargeable_bytes][crate::model::BackupRun::max_chargeable_bytes].
530    pub fn set_or_clear_max_chargeable_bytes<T>(mut self, v: std::option::Option<T>) -> Self
531    where
532        T: std::convert::Into<i64>,
533    {
534        self.max_chargeable_bytes = v.map(|x| x.into());
535        self
536    }
537}
538
539impl wkt::message::Message for BackupRun {
540    fn typename() -> &'static str {
541        "type.googleapis.com/google.cloud.sql.v1.BackupRun"
542    }
543}
544
545/// Backup run list results.
546#[derive(Clone, Default, PartialEq)]
547#[non_exhaustive]
548pub struct BackupRunsListResponse {
549    /// This is always `sql#backupRunsList`.
550    pub kind: std::string::String,
551
552    /// A list of backup runs in reverse chronological order of the enqueued time.
553    pub items: std::vec::Vec<crate::model::BackupRun>,
554
555    /// The continuation token, used to page through large result sets. Provide
556    /// this value in a subsequent request to return the next page of results.
557    pub next_page_token: std::string::String,
558
559    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
560}
561
562impl BackupRunsListResponse {
563    pub fn new() -> Self {
564        std::default::Default::default()
565    }
566
567    /// Sets the value of [kind][crate::model::BackupRunsListResponse::kind].
568    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
569        self.kind = v.into();
570        self
571    }
572
573    /// Sets the value of [items][crate::model::BackupRunsListResponse::items].
574    pub fn set_items<T, V>(mut self, v: T) -> Self
575    where
576        T: std::iter::IntoIterator<Item = V>,
577        V: std::convert::Into<crate::model::BackupRun>,
578    {
579        use std::iter::Iterator;
580        self.items = v.into_iter().map(|i| i.into()).collect();
581        self
582    }
583
584    /// Sets the value of [next_page_token][crate::model::BackupRunsListResponse::next_page_token].
585    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
586        self.next_page_token = v.into();
587        self
588    }
589}
590
591impl wkt::message::Message for BackupRunsListResponse {
592    fn typename() -> &'static str {
593        "type.googleapis.com/google.cloud.sql.v1.BackupRunsListResponse"
594    }
595}
596
597#[doc(hidden)]
598impl gax::paginator::internal::PageableResponse for BackupRunsListResponse {
599    type PageItem = crate::model::BackupRun;
600
601    fn items(self) -> std::vec::Vec<Self::PageItem> {
602        self.items
603    }
604
605    fn next_page_token(&self) -> std::string::String {
606        use std::clone::Clone;
607        self.next_page_token.clone()
608    }
609}
610
611/// Connect settings retrieval request.
612#[derive(Clone, Default, PartialEq)]
613#[non_exhaustive]
614pub struct GetConnectSettingsRequest {
615    /// Cloud SQL instance ID. This does not include the project ID.
616    pub instance: std::string::String,
617
618    /// Project ID of the project that contains the instance.
619    pub project: std::string::String,
620
621    /// Optional. Optional snapshot read timestamp to trade freshness for
622    /// performance.
623    pub read_time: std::option::Option<wkt::Timestamp>,
624
625    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
626}
627
628impl GetConnectSettingsRequest {
629    pub fn new() -> Self {
630        std::default::Default::default()
631    }
632
633    /// Sets the value of [instance][crate::model::GetConnectSettingsRequest::instance].
634    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
635        self.instance = v.into();
636        self
637    }
638
639    /// Sets the value of [project][crate::model::GetConnectSettingsRequest::project].
640    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
641        self.project = v.into();
642        self
643    }
644
645    /// Sets the value of [read_time][crate::model::GetConnectSettingsRequest::read_time].
646    pub fn set_read_time<T>(mut self, v: T) -> Self
647    where
648        T: std::convert::Into<wkt::Timestamp>,
649    {
650        self.read_time = std::option::Option::Some(v.into());
651        self
652    }
653
654    /// Sets or clears the value of [read_time][crate::model::GetConnectSettingsRequest::read_time].
655    pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
656    where
657        T: std::convert::Into<wkt::Timestamp>,
658    {
659        self.read_time = v.map(|x| x.into());
660        self
661    }
662}
663
664impl wkt::message::Message for GetConnectSettingsRequest {
665    fn typename() -> &'static str {
666        "type.googleapis.com/google.cloud.sql.v1.GetConnectSettingsRequest"
667    }
668}
669
670/// Connect settings retrieval response.
671#[derive(Clone, Default, PartialEq)]
672#[non_exhaustive]
673pub struct ConnectSettings {
674    /// This is always `sql#connectSettings`.
675    pub kind: std::string::String,
676
677    /// SSL configuration.
678    pub server_ca_cert: std::option::Option<crate::model::SslCert>,
679
680    /// The assigned IP addresses for the instance.
681    pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
682
683    /// The cloud region for the instance. For example, `us-central1`,
684    /// `europe-west1`. The region cannot be changed after instance creation.
685    pub region: std::string::String,
686
687    /// The database engine type and version. The `databaseVersion`
688    /// field cannot be changed after instance creation.
689    /// MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default),
690    /// or `MYSQL_5_6`.
691    /// PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
692    /// `POSTGRES_11`, `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`.
693    /// SQL Server instances: `SQLSERVER_2017_STANDARD` (default),
694    /// `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`,
695    /// `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
696    /// `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
697    /// `SQLSERVER_2019_WEB`.
698    pub database_version: crate::model::SqlDatabaseVersion,
699
700    /// `SECOND_GEN`: Cloud SQL database instance.
701    /// `EXTERNAL`: A database server that is not managed by Google.
702    /// This property is read-only; use the `tier` property in the `settings`
703    /// object to determine the database type.
704    pub backend_type: crate::model::SqlBackendType,
705
706    /// Whether PSC connectivity is enabled for this instance.
707    pub psc_enabled: bool,
708
709    /// The dns name of the instance.
710    pub dns_name: std::string::String,
711
712    /// Specify what type of CA is used for the server certificate.
713    pub server_ca_mode: crate::model::connect_settings::CaMode,
714
715    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
716}
717
718impl ConnectSettings {
719    pub fn new() -> Self {
720        std::default::Default::default()
721    }
722
723    /// Sets the value of [kind][crate::model::ConnectSettings::kind].
724    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
725        self.kind = v.into();
726        self
727    }
728
729    /// Sets the value of [server_ca_cert][crate::model::ConnectSettings::server_ca_cert].
730    pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
731    where
732        T: std::convert::Into<crate::model::SslCert>,
733    {
734        self.server_ca_cert = std::option::Option::Some(v.into());
735        self
736    }
737
738    /// Sets or clears the value of [server_ca_cert][crate::model::ConnectSettings::server_ca_cert].
739    pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
740    where
741        T: std::convert::Into<crate::model::SslCert>,
742    {
743        self.server_ca_cert = v.map(|x| x.into());
744        self
745    }
746
747    /// Sets the value of [ip_addresses][crate::model::ConnectSettings::ip_addresses].
748    pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
749    where
750        T: std::iter::IntoIterator<Item = V>,
751        V: std::convert::Into<crate::model::IpMapping>,
752    {
753        use std::iter::Iterator;
754        self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
755        self
756    }
757
758    /// Sets the value of [region][crate::model::ConnectSettings::region].
759    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
760        self.region = v.into();
761        self
762    }
763
764    /// Sets the value of [database_version][crate::model::ConnectSettings::database_version].
765    pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
766        mut self,
767        v: T,
768    ) -> Self {
769        self.database_version = v.into();
770        self
771    }
772
773    /// Sets the value of [backend_type][crate::model::ConnectSettings::backend_type].
774    pub fn set_backend_type<T: std::convert::Into<crate::model::SqlBackendType>>(
775        mut self,
776        v: T,
777    ) -> Self {
778        self.backend_type = v.into();
779        self
780    }
781
782    /// Sets the value of [psc_enabled][crate::model::ConnectSettings::psc_enabled].
783    pub fn set_psc_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
784        self.psc_enabled = v.into();
785        self
786    }
787
788    /// Sets the value of [dns_name][crate::model::ConnectSettings::dns_name].
789    pub fn set_dns_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
790        self.dns_name = v.into();
791        self
792    }
793
794    /// Sets the value of [server_ca_mode][crate::model::ConnectSettings::server_ca_mode].
795    pub fn set_server_ca_mode<T: std::convert::Into<crate::model::connect_settings::CaMode>>(
796        mut self,
797        v: T,
798    ) -> Self {
799        self.server_ca_mode = v.into();
800        self
801    }
802}
803
804impl wkt::message::Message for ConnectSettings {
805    fn typename() -> &'static str {
806        "type.googleapis.com/google.cloud.sql.v1.ConnectSettings"
807    }
808}
809
810/// Defines additional types related to [ConnectSettings].
811pub mod connect_settings {
812    #[allow(unused_imports)]
813    use super::*;
814
815    /// Various Certificate Authority (CA) modes for certificate signing.
816    ///
817    /// # Working with unknown values
818    ///
819    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
820    /// additional enum variants at any time. Adding new variants is not considered
821    /// a breaking change. Applications should write their code in anticipation of:
822    ///
823    /// - New values appearing in future releases of the client library, **and**
824    /// - New values received dynamically, without application changes.
825    ///
826    /// Please consult the [Working with enums] section in the user guide for some
827    /// guidelines.
828    ///
829    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
830    #[derive(Clone, Debug, PartialEq)]
831    #[non_exhaustive]
832    pub enum CaMode {
833        /// CA mode is unknown.
834        Unspecified,
835        /// Google-managed self-signed internal CA.
836        GoogleManagedInternalCa,
837        /// Google-managed regional CA part of root CA hierarchy hosted on Google
838        /// Cloud's Certificate Authority Service (CAS).
839        GoogleManagedCasCa,
840        /// If set, the enum was initialized with an unknown value.
841        ///
842        /// Applications can examine the value using [CaMode::value] or
843        /// [CaMode::name].
844        UnknownValue(ca_mode::UnknownValue),
845    }
846
847    #[doc(hidden)]
848    pub mod ca_mode {
849        #[allow(unused_imports)]
850        use super::*;
851        #[derive(Clone, Debug, PartialEq)]
852        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
853    }
854
855    impl CaMode {
856        /// Gets the enum value.
857        ///
858        /// Returns `None` if the enum contains an unknown value deserialized from
859        /// the string representation of enums.
860        pub fn value(&self) -> std::option::Option<i32> {
861            match self {
862                Self::Unspecified => std::option::Option::Some(0),
863                Self::GoogleManagedInternalCa => std::option::Option::Some(1),
864                Self::GoogleManagedCasCa => std::option::Option::Some(2),
865                Self::UnknownValue(u) => u.0.value(),
866            }
867        }
868
869        /// Gets the enum value as a string.
870        ///
871        /// Returns `None` if the enum contains an unknown value deserialized from
872        /// the integer representation of enums.
873        pub fn name(&self) -> std::option::Option<&str> {
874            match self {
875                Self::Unspecified => std::option::Option::Some("CA_MODE_UNSPECIFIED"),
876                Self::GoogleManagedInternalCa => {
877                    std::option::Option::Some("GOOGLE_MANAGED_INTERNAL_CA")
878                }
879                Self::GoogleManagedCasCa => std::option::Option::Some("GOOGLE_MANAGED_CAS_CA"),
880                Self::UnknownValue(u) => u.0.name(),
881            }
882        }
883    }
884
885    impl std::default::Default for CaMode {
886        fn default() -> Self {
887            use std::convert::From;
888            Self::from(0)
889        }
890    }
891
892    impl std::fmt::Display for CaMode {
893        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
894            wkt::internal::display_enum(f, self.name(), self.value())
895        }
896    }
897
898    impl std::convert::From<i32> for CaMode {
899        fn from(value: i32) -> Self {
900            match value {
901                0 => Self::Unspecified,
902                1 => Self::GoogleManagedInternalCa,
903                2 => Self::GoogleManagedCasCa,
904                _ => Self::UnknownValue(ca_mode::UnknownValue(
905                    wkt::internal::UnknownEnumValue::Integer(value),
906                )),
907            }
908        }
909    }
910
911    impl std::convert::From<&str> for CaMode {
912        fn from(value: &str) -> Self {
913            use std::string::ToString;
914            match value {
915                "CA_MODE_UNSPECIFIED" => Self::Unspecified,
916                "GOOGLE_MANAGED_INTERNAL_CA" => Self::GoogleManagedInternalCa,
917                "GOOGLE_MANAGED_CAS_CA" => Self::GoogleManagedCasCa,
918                _ => Self::UnknownValue(ca_mode::UnknownValue(
919                    wkt::internal::UnknownEnumValue::String(value.to_string()),
920                )),
921            }
922        }
923    }
924
925    impl serde::ser::Serialize for CaMode {
926        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
927        where
928            S: serde::Serializer,
929        {
930            match self {
931                Self::Unspecified => serializer.serialize_i32(0),
932                Self::GoogleManagedInternalCa => serializer.serialize_i32(1),
933                Self::GoogleManagedCasCa => serializer.serialize_i32(2),
934                Self::UnknownValue(u) => u.0.serialize(serializer),
935            }
936        }
937    }
938
939    impl<'de> serde::de::Deserialize<'de> for CaMode {
940        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
941        where
942            D: serde::Deserializer<'de>,
943        {
944            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CaMode>::new(
945                ".google.cloud.sql.v1.ConnectSettings.CaMode",
946            ))
947        }
948    }
949}
950
951/// Ephemeral certificate creation request.
952#[derive(Clone, Default, PartialEq)]
953#[non_exhaustive]
954pub struct GenerateEphemeralCertRequest {
955    /// Cloud SQL instance ID. This does not include the project ID.
956    pub instance: std::string::String,
957
958    /// Project ID of the project that contains the instance.
959    pub project: std::string::String,
960
961    /// PEM encoded public key to include in the signed certificate.
962    pub public_key: std::string::String,
963
964    /// Optional. Access token to include in the signed certificate.
965    pub access_token: std::string::String,
966
967    /// Optional. Optional snapshot read timestamp to trade freshness for
968    /// performance.
969    pub read_time: std::option::Option<wkt::Timestamp>,
970
971    /// Optional. If set, it will contain the cert valid duration.
972    pub valid_duration: std::option::Option<wkt::Duration>,
973
974    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
975}
976
977impl GenerateEphemeralCertRequest {
978    pub fn new() -> Self {
979        std::default::Default::default()
980    }
981
982    /// Sets the value of [instance][crate::model::GenerateEphemeralCertRequest::instance].
983    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
984        self.instance = v.into();
985        self
986    }
987
988    /// Sets the value of [project][crate::model::GenerateEphemeralCertRequest::project].
989    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
990        self.project = v.into();
991        self
992    }
993
994    /// Sets the value of [public_key][crate::model::GenerateEphemeralCertRequest::public_key].
995    pub fn set_public_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
996        self.public_key = v.into();
997        self
998    }
999
1000    /// Sets the value of [access_token][crate::model::GenerateEphemeralCertRequest::access_token].
1001    pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1002        self.access_token = v.into();
1003        self
1004    }
1005
1006    /// Sets the value of [read_time][crate::model::GenerateEphemeralCertRequest::read_time].
1007    pub fn set_read_time<T>(mut self, v: T) -> Self
1008    where
1009        T: std::convert::Into<wkt::Timestamp>,
1010    {
1011        self.read_time = std::option::Option::Some(v.into());
1012        self
1013    }
1014
1015    /// Sets or clears the value of [read_time][crate::model::GenerateEphemeralCertRequest::read_time].
1016    pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
1017    where
1018        T: std::convert::Into<wkt::Timestamp>,
1019    {
1020        self.read_time = v.map(|x| x.into());
1021        self
1022    }
1023
1024    /// Sets the value of [valid_duration][crate::model::GenerateEphemeralCertRequest::valid_duration].
1025    pub fn set_valid_duration<T>(mut self, v: T) -> Self
1026    where
1027        T: std::convert::Into<wkt::Duration>,
1028    {
1029        self.valid_duration = std::option::Option::Some(v.into());
1030        self
1031    }
1032
1033    /// Sets or clears the value of [valid_duration][crate::model::GenerateEphemeralCertRequest::valid_duration].
1034    pub fn set_or_clear_valid_duration<T>(mut self, v: std::option::Option<T>) -> Self
1035    where
1036        T: std::convert::Into<wkt::Duration>,
1037    {
1038        self.valid_duration = v.map(|x| x.into());
1039        self
1040    }
1041}
1042
1043impl wkt::message::Message for GenerateEphemeralCertRequest {
1044    fn typename() -> &'static str {
1045        "type.googleapis.com/google.cloud.sql.v1.GenerateEphemeralCertRequest"
1046    }
1047}
1048
1049/// Ephemeral certificate creation request.
1050#[derive(Clone, Default, PartialEq)]
1051#[non_exhaustive]
1052pub struct GenerateEphemeralCertResponse {
1053    /// Generated cert
1054    pub ephemeral_cert: std::option::Option<crate::model::SslCert>,
1055
1056    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1057}
1058
1059impl GenerateEphemeralCertResponse {
1060    pub fn new() -> Self {
1061        std::default::Default::default()
1062    }
1063
1064    /// Sets the value of [ephemeral_cert][crate::model::GenerateEphemeralCertResponse::ephemeral_cert].
1065    pub fn set_ephemeral_cert<T>(mut self, v: T) -> Self
1066    where
1067        T: std::convert::Into<crate::model::SslCert>,
1068    {
1069        self.ephemeral_cert = std::option::Option::Some(v.into());
1070        self
1071    }
1072
1073    /// Sets or clears the value of [ephemeral_cert][crate::model::GenerateEphemeralCertResponse::ephemeral_cert].
1074    pub fn set_or_clear_ephemeral_cert<T>(mut self, v: std::option::Option<T>) -> Self
1075    where
1076        T: std::convert::Into<crate::model::SslCert>,
1077    {
1078        self.ephemeral_cert = v.map(|x| x.into());
1079        self
1080    }
1081}
1082
1083impl wkt::message::Message for GenerateEphemeralCertResponse {
1084    fn typename() -> &'static str {
1085        "type.googleapis.com/google.cloud.sql.v1.GenerateEphemeralCertResponse"
1086    }
1087}
1088
1089/// Database delete request.
1090#[derive(Clone, Default, PartialEq)]
1091#[non_exhaustive]
1092pub struct SqlDatabasesDeleteRequest {
1093    /// Name of the database to be deleted in the instance.
1094    pub database: std::string::String,
1095
1096    /// Database instance ID. This does not include the project ID.
1097    pub instance: std::string::String,
1098
1099    /// Project ID of the project that contains the instance.
1100    pub project: std::string::String,
1101
1102    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1103}
1104
1105impl SqlDatabasesDeleteRequest {
1106    pub fn new() -> Self {
1107        std::default::Default::default()
1108    }
1109
1110    /// Sets the value of [database][crate::model::SqlDatabasesDeleteRequest::database].
1111    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1112        self.database = v.into();
1113        self
1114    }
1115
1116    /// Sets the value of [instance][crate::model::SqlDatabasesDeleteRequest::instance].
1117    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1118        self.instance = v.into();
1119        self
1120    }
1121
1122    /// Sets the value of [project][crate::model::SqlDatabasesDeleteRequest::project].
1123    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1124        self.project = v.into();
1125        self
1126    }
1127}
1128
1129impl wkt::message::Message for SqlDatabasesDeleteRequest {
1130    fn typename() -> &'static str {
1131        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesDeleteRequest"
1132    }
1133}
1134
1135/// Database get request.
1136#[derive(Clone, Default, PartialEq)]
1137#[non_exhaustive]
1138pub struct SqlDatabasesGetRequest {
1139    /// Name of the database in the instance.
1140    pub database: std::string::String,
1141
1142    /// Database instance ID. This does not include the project ID.
1143    pub instance: std::string::String,
1144
1145    /// Project ID of the project that contains the instance.
1146    pub project: std::string::String,
1147
1148    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1149}
1150
1151impl SqlDatabasesGetRequest {
1152    pub fn new() -> Self {
1153        std::default::Default::default()
1154    }
1155
1156    /// Sets the value of [database][crate::model::SqlDatabasesGetRequest::database].
1157    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1158        self.database = v.into();
1159        self
1160    }
1161
1162    /// Sets the value of [instance][crate::model::SqlDatabasesGetRequest::instance].
1163    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1164        self.instance = v.into();
1165        self
1166    }
1167
1168    /// Sets the value of [project][crate::model::SqlDatabasesGetRequest::project].
1169    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1170        self.project = v.into();
1171        self
1172    }
1173}
1174
1175impl wkt::message::Message for SqlDatabasesGetRequest {
1176    fn typename() -> &'static str {
1177        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesGetRequest"
1178    }
1179}
1180
1181/// Database insert request.
1182#[derive(Clone, Default, PartialEq)]
1183#[non_exhaustive]
1184pub struct SqlDatabasesInsertRequest {
1185    /// Database instance ID. This does not include the project ID.
1186    pub instance: std::string::String,
1187
1188    /// Project ID of the project that contains the instance.
1189    pub project: std::string::String,
1190
1191    pub body: std::option::Option<crate::model::Database>,
1192
1193    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1194}
1195
1196impl SqlDatabasesInsertRequest {
1197    pub fn new() -> Self {
1198        std::default::Default::default()
1199    }
1200
1201    /// Sets the value of [instance][crate::model::SqlDatabasesInsertRequest::instance].
1202    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1203        self.instance = v.into();
1204        self
1205    }
1206
1207    /// Sets the value of [project][crate::model::SqlDatabasesInsertRequest::project].
1208    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1209        self.project = v.into();
1210        self
1211    }
1212
1213    /// Sets the value of [body][crate::model::SqlDatabasesInsertRequest::body].
1214    pub fn set_body<T>(mut self, v: T) -> Self
1215    where
1216        T: std::convert::Into<crate::model::Database>,
1217    {
1218        self.body = std::option::Option::Some(v.into());
1219        self
1220    }
1221
1222    /// Sets or clears the value of [body][crate::model::SqlDatabasesInsertRequest::body].
1223    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1224    where
1225        T: std::convert::Into<crate::model::Database>,
1226    {
1227        self.body = v.map(|x| x.into());
1228        self
1229    }
1230}
1231
1232impl wkt::message::Message for SqlDatabasesInsertRequest {
1233    fn typename() -> &'static str {
1234        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesInsertRequest"
1235    }
1236}
1237
1238/// Database list request.
1239#[derive(Clone, Default, PartialEq)]
1240#[non_exhaustive]
1241pub struct SqlDatabasesListRequest {
1242    /// Cloud SQL instance ID. This does not include the project ID.
1243    pub instance: std::string::String,
1244
1245    /// Project ID of the project that contains the instance.
1246    pub project: std::string::String,
1247
1248    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1249}
1250
1251impl SqlDatabasesListRequest {
1252    pub fn new() -> Self {
1253        std::default::Default::default()
1254    }
1255
1256    /// Sets the value of [instance][crate::model::SqlDatabasesListRequest::instance].
1257    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1258        self.instance = v.into();
1259        self
1260    }
1261
1262    /// Sets the value of [project][crate::model::SqlDatabasesListRequest::project].
1263    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1264        self.project = v.into();
1265        self
1266    }
1267}
1268
1269impl wkt::message::Message for SqlDatabasesListRequest {
1270    fn typename() -> &'static str {
1271        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesListRequest"
1272    }
1273}
1274
1275/// Database update request.
1276#[derive(Clone, Default, PartialEq)]
1277#[non_exhaustive]
1278pub struct SqlDatabasesUpdateRequest {
1279    /// Name of the database to be updated in the instance.
1280    pub database: std::string::String,
1281
1282    /// Database instance ID. This does not include the project ID.
1283    pub instance: std::string::String,
1284
1285    /// Project ID of the project that contains the instance.
1286    pub project: std::string::String,
1287
1288    pub body: std::option::Option<crate::model::Database>,
1289
1290    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1291}
1292
1293impl SqlDatabasesUpdateRequest {
1294    pub fn new() -> Self {
1295        std::default::Default::default()
1296    }
1297
1298    /// Sets the value of [database][crate::model::SqlDatabasesUpdateRequest::database].
1299    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1300        self.database = v.into();
1301        self
1302    }
1303
1304    /// Sets the value of [instance][crate::model::SqlDatabasesUpdateRequest::instance].
1305    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1306        self.instance = v.into();
1307        self
1308    }
1309
1310    /// Sets the value of [project][crate::model::SqlDatabasesUpdateRequest::project].
1311    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1312        self.project = v.into();
1313        self
1314    }
1315
1316    /// Sets the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
1317    pub fn set_body<T>(mut self, v: T) -> Self
1318    where
1319        T: std::convert::Into<crate::model::Database>,
1320    {
1321        self.body = std::option::Option::Some(v.into());
1322        self
1323    }
1324
1325    /// Sets or clears the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
1326    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1327    where
1328        T: std::convert::Into<crate::model::Database>,
1329    {
1330        self.body = v.map(|x| x.into());
1331        self
1332    }
1333}
1334
1335impl wkt::message::Message for SqlDatabasesUpdateRequest {
1336    fn typename() -> &'static str {
1337        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesUpdateRequest"
1338    }
1339}
1340
1341/// Database list response.
1342#[derive(Clone, Default, PartialEq)]
1343#[non_exhaustive]
1344pub struct DatabasesListResponse {
1345    /// This is always `sql#databasesList`.
1346    pub kind: std::string::String,
1347
1348    /// List of database resources in the instance.
1349    pub items: std::vec::Vec<crate::model::Database>,
1350
1351    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1352}
1353
1354impl DatabasesListResponse {
1355    pub fn new() -> Self {
1356        std::default::Default::default()
1357    }
1358
1359    /// Sets the value of [kind][crate::model::DatabasesListResponse::kind].
1360    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1361        self.kind = v.into();
1362        self
1363    }
1364
1365    /// Sets the value of [items][crate::model::DatabasesListResponse::items].
1366    pub fn set_items<T, V>(mut self, v: T) -> Self
1367    where
1368        T: std::iter::IntoIterator<Item = V>,
1369        V: std::convert::Into<crate::model::Database>,
1370    {
1371        use std::iter::Iterator;
1372        self.items = v.into_iter().map(|i| i.into()).collect();
1373        self
1374    }
1375}
1376
1377impl wkt::message::Message for DatabasesListResponse {
1378    fn typename() -> &'static str {
1379        "type.googleapis.com/google.cloud.sql.v1.DatabasesListResponse"
1380    }
1381}
1382
1383/// Flags list request.
1384#[derive(Clone, Default, PartialEq)]
1385#[non_exhaustive]
1386pub struct SqlFlagsListRequest {
1387    /// Database type and version you want to retrieve flags for. By default, this
1388    /// method returns flags for all database types and versions.
1389    pub database_version: std::string::String,
1390
1391    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1392}
1393
1394impl SqlFlagsListRequest {
1395    pub fn new() -> Self {
1396        std::default::Default::default()
1397    }
1398
1399    /// Sets the value of [database_version][crate::model::SqlFlagsListRequest::database_version].
1400    pub fn set_database_version<T: std::convert::Into<std::string::String>>(
1401        mut self,
1402        v: T,
1403    ) -> Self {
1404        self.database_version = v.into();
1405        self
1406    }
1407}
1408
1409impl wkt::message::Message for SqlFlagsListRequest {
1410    fn typename() -> &'static str {
1411        "type.googleapis.com/google.cloud.sql.v1.SqlFlagsListRequest"
1412    }
1413}
1414
1415/// Flags list response.
1416#[derive(Clone, Default, PartialEq)]
1417#[non_exhaustive]
1418pub struct FlagsListResponse {
1419    /// This is always `sql#flagsList`.
1420    pub kind: std::string::String,
1421
1422    /// List of flags.
1423    pub items: std::vec::Vec<crate::model::Flag>,
1424
1425    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1426}
1427
1428impl FlagsListResponse {
1429    pub fn new() -> Self {
1430        std::default::Default::default()
1431    }
1432
1433    /// Sets the value of [kind][crate::model::FlagsListResponse::kind].
1434    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1435        self.kind = v.into();
1436        self
1437    }
1438
1439    /// Sets the value of [items][crate::model::FlagsListResponse::items].
1440    pub fn set_items<T, V>(mut self, v: T) -> Self
1441    where
1442        T: std::iter::IntoIterator<Item = V>,
1443        V: std::convert::Into<crate::model::Flag>,
1444    {
1445        use std::iter::Iterator;
1446        self.items = v.into_iter().map(|i| i.into()).collect();
1447        self
1448    }
1449}
1450
1451impl wkt::message::Message for FlagsListResponse {
1452    fn typename() -> &'static str {
1453        "type.googleapis.com/google.cloud.sql.v1.FlagsListResponse"
1454    }
1455}
1456
1457/// A flag resource.
1458#[derive(Clone, Default, PartialEq)]
1459#[non_exhaustive]
1460pub struct Flag {
1461    /// This is the name of the flag. Flag names always use underscores, not
1462    /// hyphens, for example: `max_allowed_packet`
1463    pub name: std::string::String,
1464
1465    /// The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
1466    /// `INTEGER` or `NONE`. `NONE` is used for flags that do not take a
1467    /// value, such as `skip_grant_tables`.
1468    pub r#type: crate::model::SqlFlagType,
1469
1470    /// The database version this flag applies to. Can be
1471    /// MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
1472    /// or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
1473    /// `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
1474    /// `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
1475    /// `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
1476    /// `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
1477    /// `SQLSERVER_2019_WEB`.
1478    /// See [the complete
1479    /// list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
1480    pub applies_to: std::vec::Vec<crate::model::SqlDatabaseVersion>,
1481
1482    /// For `STRING` flags, a list of strings that the value can be set to.
1483    pub allowed_string_values: std::vec::Vec<std::string::String>,
1484
1485    /// For `INTEGER` flags, the minimum allowed value.
1486    pub min_value: std::option::Option<wkt::Int64Value>,
1487
1488    /// For `INTEGER` flags, the maximum allowed value.
1489    pub max_value: std::option::Option<wkt::Int64Value>,
1490
1491    /// Indicates whether changing this flag will trigger a database restart. Only
1492    /// applicable to Second Generation instances.
1493    pub requires_restart: std::option::Option<wkt::BoolValue>,
1494
1495    /// This is always `sql#flag`.
1496    pub kind: std::string::String,
1497
1498    /// Whether or not the flag is considered in beta.
1499    pub in_beta: std::option::Option<wkt::BoolValue>,
1500
1501    /// Use this field if only certain integers are accepted. Can be combined
1502    /// with min_value and max_value to add additional values.
1503    pub allowed_int_values: std::vec::Vec<i64>,
1504
1505    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1506}
1507
1508impl Flag {
1509    pub fn new() -> Self {
1510        std::default::Default::default()
1511    }
1512
1513    /// Sets the value of [name][crate::model::Flag::name].
1514    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1515        self.name = v.into();
1516        self
1517    }
1518
1519    /// Sets the value of [r#type][crate::model::Flag::type].
1520    pub fn set_type<T: std::convert::Into<crate::model::SqlFlagType>>(mut self, v: T) -> Self {
1521        self.r#type = v.into();
1522        self
1523    }
1524
1525    /// Sets the value of [applies_to][crate::model::Flag::applies_to].
1526    pub fn set_applies_to<T, V>(mut self, v: T) -> Self
1527    where
1528        T: std::iter::IntoIterator<Item = V>,
1529        V: std::convert::Into<crate::model::SqlDatabaseVersion>,
1530    {
1531        use std::iter::Iterator;
1532        self.applies_to = v.into_iter().map(|i| i.into()).collect();
1533        self
1534    }
1535
1536    /// Sets the value of [allowed_string_values][crate::model::Flag::allowed_string_values].
1537    pub fn set_allowed_string_values<T, V>(mut self, v: T) -> Self
1538    where
1539        T: std::iter::IntoIterator<Item = V>,
1540        V: std::convert::Into<std::string::String>,
1541    {
1542        use std::iter::Iterator;
1543        self.allowed_string_values = v.into_iter().map(|i| i.into()).collect();
1544        self
1545    }
1546
1547    /// Sets the value of [min_value][crate::model::Flag::min_value].
1548    pub fn set_min_value<T>(mut self, v: T) -> Self
1549    where
1550        T: std::convert::Into<wkt::Int64Value>,
1551    {
1552        self.min_value = std::option::Option::Some(v.into());
1553        self
1554    }
1555
1556    /// Sets or clears the value of [min_value][crate::model::Flag::min_value].
1557    pub fn set_or_clear_min_value<T>(mut self, v: std::option::Option<T>) -> Self
1558    where
1559        T: std::convert::Into<wkt::Int64Value>,
1560    {
1561        self.min_value = v.map(|x| x.into());
1562        self
1563    }
1564
1565    /// Sets the value of [max_value][crate::model::Flag::max_value].
1566    pub fn set_max_value<T>(mut self, v: T) -> Self
1567    where
1568        T: std::convert::Into<wkt::Int64Value>,
1569    {
1570        self.max_value = std::option::Option::Some(v.into());
1571        self
1572    }
1573
1574    /// Sets or clears the value of [max_value][crate::model::Flag::max_value].
1575    pub fn set_or_clear_max_value<T>(mut self, v: std::option::Option<T>) -> Self
1576    where
1577        T: std::convert::Into<wkt::Int64Value>,
1578    {
1579        self.max_value = v.map(|x| x.into());
1580        self
1581    }
1582
1583    /// Sets the value of [requires_restart][crate::model::Flag::requires_restart].
1584    pub fn set_requires_restart<T>(mut self, v: T) -> Self
1585    where
1586        T: std::convert::Into<wkt::BoolValue>,
1587    {
1588        self.requires_restart = std::option::Option::Some(v.into());
1589        self
1590    }
1591
1592    /// Sets or clears the value of [requires_restart][crate::model::Flag::requires_restart].
1593    pub fn set_or_clear_requires_restart<T>(mut self, v: std::option::Option<T>) -> Self
1594    where
1595        T: std::convert::Into<wkt::BoolValue>,
1596    {
1597        self.requires_restart = v.map(|x| x.into());
1598        self
1599    }
1600
1601    /// Sets the value of [kind][crate::model::Flag::kind].
1602    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1603        self.kind = v.into();
1604        self
1605    }
1606
1607    /// Sets the value of [in_beta][crate::model::Flag::in_beta].
1608    pub fn set_in_beta<T>(mut self, v: T) -> Self
1609    where
1610        T: std::convert::Into<wkt::BoolValue>,
1611    {
1612        self.in_beta = std::option::Option::Some(v.into());
1613        self
1614    }
1615
1616    /// Sets or clears the value of [in_beta][crate::model::Flag::in_beta].
1617    pub fn set_or_clear_in_beta<T>(mut self, v: std::option::Option<T>) -> Self
1618    where
1619        T: std::convert::Into<wkt::BoolValue>,
1620    {
1621        self.in_beta = v.map(|x| x.into());
1622        self
1623    }
1624
1625    /// Sets the value of [allowed_int_values][crate::model::Flag::allowed_int_values].
1626    pub fn set_allowed_int_values<T, V>(mut self, v: T) -> Self
1627    where
1628        T: std::iter::IntoIterator<Item = V>,
1629        V: std::convert::Into<i64>,
1630    {
1631        use std::iter::Iterator;
1632        self.allowed_int_values = v.into_iter().map(|i| i.into()).collect();
1633        self
1634    }
1635}
1636
1637impl wkt::message::Message for Flag {
1638    fn typename() -> &'static str {
1639        "type.googleapis.com/google.cloud.sql.v1.Flag"
1640    }
1641}
1642
1643/// Instance add server CA request.
1644#[derive(Clone, Default, PartialEq)]
1645#[non_exhaustive]
1646pub struct SqlInstancesAddServerCaRequest {
1647    /// Cloud SQL instance ID. This does not include the project ID.
1648    pub instance: std::string::String,
1649
1650    /// Project ID of the project that contains the instance.
1651    pub project: std::string::String,
1652
1653    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1654}
1655
1656impl SqlInstancesAddServerCaRequest {
1657    pub fn new() -> Self {
1658        std::default::Default::default()
1659    }
1660
1661    /// Sets the value of [instance][crate::model::SqlInstancesAddServerCaRequest::instance].
1662    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1663        self.instance = v.into();
1664        self
1665    }
1666
1667    /// Sets the value of [project][crate::model::SqlInstancesAddServerCaRequest::project].
1668    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1669        self.project = v.into();
1670        self
1671    }
1672}
1673
1674impl wkt::message::Message for SqlInstancesAddServerCaRequest {
1675    fn typename() -> &'static str {
1676        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAddServerCaRequest"
1677    }
1678}
1679
1680/// Instance clone request.
1681#[derive(Clone, Default, PartialEq)]
1682#[non_exhaustive]
1683pub struct SqlInstancesCloneRequest {
1684    /// The ID of the Cloud SQL instance to be cloned (source). This does not
1685    /// include the project ID.
1686    pub instance: std::string::String,
1687
1688    /// Project ID of the source as well as the clone Cloud SQL instance.
1689    pub project: std::string::String,
1690
1691    pub body: std::option::Option<crate::model::InstancesCloneRequest>,
1692
1693    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1694}
1695
1696impl SqlInstancesCloneRequest {
1697    pub fn new() -> Self {
1698        std::default::Default::default()
1699    }
1700
1701    /// Sets the value of [instance][crate::model::SqlInstancesCloneRequest::instance].
1702    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1703        self.instance = v.into();
1704        self
1705    }
1706
1707    /// Sets the value of [project][crate::model::SqlInstancesCloneRequest::project].
1708    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1709        self.project = v.into();
1710        self
1711    }
1712
1713    /// Sets the value of [body][crate::model::SqlInstancesCloneRequest::body].
1714    pub fn set_body<T>(mut self, v: T) -> Self
1715    where
1716        T: std::convert::Into<crate::model::InstancesCloneRequest>,
1717    {
1718        self.body = std::option::Option::Some(v.into());
1719        self
1720    }
1721
1722    /// Sets or clears the value of [body][crate::model::SqlInstancesCloneRequest::body].
1723    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1724    where
1725        T: std::convert::Into<crate::model::InstancesCloneRequest>,
1726    {
1727        self.body = v.map(|x| x.into());
1728        self
1729    }
1730}
1731
1732impl wkt::message::Message for SqlInstancesCloneRequest {
1733    fn typename() -> &'static str {
1734        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesCloneRequest"
1735    }
1736}
1737
1738/// Instance delete request.
1739#[derive(Clone, Default, PartialEq)]
1740#[non_exhaustive]
1741pub struct SqlInstancesDeleteRequest {
1742    /// Cloud SQL instance ID. This does not include the project ID.
1743    pub instance: std::string::String,
1744
1745    /// Project ID of the project that contains the instance to be deleted.
1746    pub project: std::string::String,
1747
1748    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1749}
1750
1751impl SqlInstancesDeleteRequest {
1752    pub fn new() -> Self {
1753        std::default::Default::default()
1754    }
1755
1756    /// Sets the value of [instance][crate::model::SqlInstancesDeleteRequest::instance].
1757    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1758        self.instance = v.into();
1759        self
1760    }
1761
1762    /// Sets the value of [project][crate::model::SqlInstancesDeleteRequest::project].
1763    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1764        self.project = v.into();
1765        self
1766    }
1767}
1768
1769impl wkt::message::Message for SqlInstancesDeleteRequest {
1770    fn typename() -> &'static str {
1771        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDeleteRequest"
1772    }
1773}
1774
1775/// Instance demote master request.
1776#[derive(Clone, Default, PartialEq)]
1777#[non_exhaustive]
1778pub struct SqlInstancesDemoteMasterRequest {
1779    /// Cloud SQL instance name.
1780    pub instance: std::string::String,
1781
1782    /// ID of the project that contains the instance.
1783    pub project: std::string::String,
1784
1785    pub body: std::option::Option<crate::model::InstancesDemoteMasterRequest>,
1786
1787    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1788}
1789
1790impl SqlInstancesDemoteMasterRequest {
1791    pub fn new() -> Self {
1792        std::default::Default::default()
1793    }
1794
1795    /// Sets the value of [instance][crate::model::SqlInstancesDemoteMasterRequest::instance].
1796    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1797        self.instance = v.into();
1798        self
1799    }
1800
1801    /// Sets the value of [project][crate::model::SqlInstancesDemoteMasterRequest::project].
1802    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1803        self.project = v.into();
1804        self
1805    }
1806
1807    /// Sets the value of [body][crate::model::SqlInstancesDemoteMasterRequest::body].
1808    pub fn set_body<T>(mut self, v: T) -> Self
1809    where
1810        T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
1811    {
1812        self.body = std::option::Option::Some(v.into());
1813        self
1814    }
1815
1816    /// Sets or clears the value of [body][crate::model::SqlInstancesDemoteMasterRequest::body].
1817    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1818    where
1819        T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
1820    {
1821        self.body = v.map(|x| x.into());
1822        self
1823    }
1824}
1825
1826impl wkt::message::Message for SqlInstancesDemoteMasterRequest {
1827    fn typename() -> &'static str {
1828        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDemoteMasterRequest"
1829    }
1830}
1831
1832/// Instance demote request.
1833#[derive(Clone, Default, PartialEq)]
1834#[non_exhaustive]
1835pub struct SqlInstancesDemoteRequest {
1836    /// Required. Cloud SQL instance name.
1837    pub instance: std::string::String,
1838
1839    /// Required. ID of the project that contains the instance.
1840    pub project: std::string::String,
1841
1842    /// Required. The request body.
1843    pub body: std::option::Option<crate::model::InstancesDemoteRequest>,
1844
1845    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1846}
1847
1848impl SqlInstancesDemoteRequest {
1849    pub fn new() -> Self {
1850        std::default::Default::default()
1851    }
1852
1853    /// Sets the value of [instance][crate::model::SqlInstancesDemoteRequest::instance].
1854    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1855        self.instance = v.into();
1856        self
1857    }
1858
1859    /// Sets the value of [project][crate::model::SqlInstancesDemoteRequest::project].
1860    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1861        self.project = v.into();
1862        self
1863    }
1864
1865    /// Sets the value of [body][crate::model::SqlInstancesDemoteRequest::body].
1866    pub fn set_body<T>(mut self, v: T) -> Self
1867    where
1868        T: std::convert::Into<crate::model::InstancesDemoteRequest>,
1869    {
1870        self.body = std::option::Option::Some(v.into());
1871        self
1872    }
1873
1874    /// Sets or clears the value of [body][crate::model::SqlInstancesDemoteRequest::body].
1875    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1876    where
1877        T: std::convert::Into<crate::model::InstancesDemoteRequest>,
1878    {
1879        self.body = v.map(|x| x.into());
1880        self
1881    }
1882}
1883
1884impl wkt::message::Message for SqlInstancesDemoteRequest {
1885    fn typename() -> &'static str {
1886        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDemoteRequest"
1887    }
1888}
1889
1890/// Instance export request.
1891#[derive(Clone, Default, PartialEq)]
1892#[non_exhaustive]
1893pub struct SqlInstancesExportRequest {
1894    /// Cloud SQL instance ID. This does not include the project ID.
1895    pub instance: std::string::String,
1896
1897    /// Project ID of the project that contains the instance to be exported.
1898    pub project: std::string::String,
1899
1900    pub body: std::option::Option<crate::model::InstancesExportRequest>,
1901
1902    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1903}
1904
1905impl SqlInstancesExportRequest {
1906    pub fn new() -> Self {
1907        std::default::Default::default()
1908    }
1909
1910    /// Sets the value of [instance][crate::model::SqlInstancesExportRequest::instance].
1911    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1912        self.instance = v.into();
1913        self
1914    }
1915
1916    /// Sets the value of [project][crate::model::SqlInstancesExportRequest::project].
1917    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1918        self.project = v.into();
1919        self
1920    }
1921
1922    /// Sets the value of [body][crate::model::SqlInstancesExportRequest::body].
1923    pub fn set_body<T>(mut self, v: T) -> Self
1924    where
1925        T: std::convert::Into<crate::model::InstancesExportRequest>,
1926    {
1927        self.body = std::option::Option::Some(v.into());
1928        self
1929    }
1930
1931    /// Sets or clears the value of [body][crate::model::SqlInstancesExportRequest::body].
1932    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1933    where
1934        T: std::convert::Into<crate::model::InstancesExportRequest>,
1935    {
1936        self.body = v.map(|x| x.into());
1937        self
1938    }
1939}
1940
1941impl wkt::message::Message for SqlInstancesExportRequest {
1942    fn typename() -> &'static str {
1943        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExportRequest"
1944    }
1945}
1946
1947/// Instance failover request.
1948#[derive(Clone, Default, PartialEq)]
1949#[non_exhaustive]
1950pub struct SqlInstancesFailoverRequest {
1951    /// Cloud SQL instance ID. This does not include the project ID.
1952    pub instance: std::string::String,
1953
1954    /// ID of the project that contains the read replica.
1955    pub project: std::string::String,
1956
1957    pub body: std::option::Option<crate::model::InstancesFailoverRequest>,
1958
1959    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1960}
1961
1962impl SqlInstancesFailoverRequest {
1963    pub fn new() -> Self {
1964        std::default::Default::default()
1965    }
1966
1967    /// Sets the value of [instance][crate::model::SqlInstancesFailoverRequest::instance].
1968    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1969        self.instance = v.into();
1970        self
1971    }
1972
1973    /// Sets the value of [project][crate::model::SqlInstancesFailoverRequest::project].
1974    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1975        self.project = v.into();
1976        self
1977    }
1978
1979    /// Sets the value of [body][crate::model::SqlInstancesFailoverRequest::body].
1980    pub fn set_body<T>(mut self, v: T) -> Self
1981    where
1982        T: std::convert::Into<crate::model::InstancesFailoverRequest>,
1983    {
1984        self.body = std::option::Option::Some(v.into());
1985        self
1986    }
1987
1988    /// Sets or clears the value of [body][crate::model::SqlInstancesFailoverRequest::body].
1989    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1990    where
1991        T: std::convert::Into<crate::model::InstancesFailoverRequest>,
1992    {
1993        self.body = v.map(|x| x.into());
1994        self
1995    }
1996}
1997
1998impl wkt::message::Message for SqlInstancesFailoverRequest {
1999    fn typename() -> &'static str {
2000        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesFailoverRequest"
2001    }
2002}
2003
2004/// Instance get request.
2005#[derive(Clone, Default, PartialEq)]
2006#[non_exhaustive]
2007pub struct SqlInstancesGetRequest {
2008    /// Database instance ID. This does not include the project ID.
2009    pub instance: std::string::String,
2010
2011    /// Project ID of the project that contains the instance.
2012    pub project: std::string::String,
2013
2014    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2015}
2016
2017impl SqlInstancesGetRequest {
2018    pub fn new() -> Self {
2019        std::default::Default::default()
2020    }
2021
2022    /// Sets the value of [instance][crate::model::SqlInstancesGetRequest::instance].
2023    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2024        self.instance = v.into();
2025        self
2026    }
2027
2028    /// Sets the value of [project][crate::model::SqlInstancesGetRequest::project].
2029    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2030        self.project = v.into();
2031        self
2032    }
2033}
2034
2035impl wkt::message::Message for SqlInstancesGetRequest {
2036    fn typename() -> &'static str {
2037        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetRequest"
2038    }
2039}
2040
2041/// Instance import request.
2042#[derive(Clone, Default, PartialEq)]
2043#[non_exhaustive]
2044pub struct SqlInstancesImportRequest {
2045    /// Cloud SQL instance ID. This does not include the project ID.
2046    pub instance: std::string::String,
2047
2048    /// Project ID of the project that contains the instance.
2049    pub project: std::string::String,
2050
2051    pub body: std::option::Option<crate::model::InstancesImportRequest>,
2052
2053    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2054}
2055
2056impl SqlInstancesImportRequest {
2057    pub fn new() -> Self {
2058        std::default::Default::default()
2059    }
2060
2061    /// Sets the value of [instance][crate::model::SqlInstancesImportRequest::instance].
2062    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2063        self.instance = v.into();
2064        self
2065    }
2066
2067    /// Sets the value of [project][crate::model::SqlInstancesImportRequest::project].
2068    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2069        self.project = v.into();
2070        self
2071    }
2072
2073    /// Sets the value of [body][crate::model::SqlInstancesImportRequest::body].
2074    pub fn set_body<T>(mut self, v: T) -> Self
2075    where
2076        T: std::convert::Into<crate::model::InstancesImportRequest>,
2077    {
2078        self.body = std::option::Option::Some(v.into());
2079        self
2080    }
2081
2082    /// Sets or clears the value of [body][crate::model::SqlInstancesImportRequest::body].
2083    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2084    where
2085        T: std::convert::Into<crate::model::InstancesImportRequest>,
2086    {
2087        self.body = v.map(|x| x.into());
2088        self
2089    }
2090}
2091
2092impl wkt::message::Message for SqlInstancesImportRequest {
2093    fn typename() -> &'static str {
2094        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesImportRequest"
2095    }
2096}
2097
2098/// Instance insert request.
2099#[derive(Clone, Default, PartialEq)]
2100#[non_exhaustive]
2101pub struct SqlInstancesInsertRequest {
2102    /// Project ID of the project to which the newly created Cloud SQL instances
2103    /// should belong.
2104    pub project: std::string::String,
2105
2106    pub body: std::option::Option<crate::model::DatabaseInstance>,
2107
2108    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2109}
2110
2111impl SqlInstancesInsertRequest {
2112    pub fn new() -> Self {
2113        std::default::Default::default()
2114    }
2115
2116    /// Sets the value of [project][crate::model::SqlInstancesInsertRequest::project].
2117    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2118        self.project = v.into();
2119        self
2120    }
2121
2122    /// Sets the value of [body][crate::model::SqlInstancesInsertRequest::body].
2123    pub fn set_body<T>(mut self, v: T) -> Self
2124    where
2125        T: std::convert::Into<crate::model::DatabaseInstance>,
2126    {
2127        self.body = std::option::Option::Some(v.into());
2128        self
2129    }
2130
2131    /// Sets or clears the value of [body][crate::model::SqlInstancesInsertRequest::body].
2132    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2133    where
2134        T: std::convert::Into<crate::model::DatabaseInstance>,
2135    {
2136        self.body = v.map(|x| x.into());
2137        self
2138    }
2139}
2140
2141impl wkt::message::Message for SqlInstancesInsertRequest {
2142    fn typename() -> &'static str {
2143        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesInsertRequest"
2144    }
2145}
2146
2147/// Instance list request.
2148#[derive(Clone, Default, PartialEq)]
2149#[non_exhaustive]
2150pub struct SqlInstancesListRequest {
2151    /// A filter expression that filters resources listed in the response.
2152    /// The expression is in the form of field:value. For example,
2153    /// 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
2154    /// their JSON representation, such as 'settings.userLabels.auto_start:true'.
2155    ///
2156    /// Multiple filter queries are space-separated. For example.
2157    /// 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
2158    /// expression is an AND expression. However, you can include AND and OR
2159    /// expressions explicitly.
2160    pub filter: std::string::String,
2161
2162    /// The maximum number of instances to return. The service may return fewer
2163    /// than this value.
2164    /// If unspecified, at most 500 instances are returned.
2165    /// The maximum value is 1000; values above 1000 are coerced to 1000.
2166    pub max_results: u32,
2167
2168    /// A previously-returned page token representing part of the larger set of
2169    /// results to view.
2170    pub page_token: std::string::String,
2171
2172    /// Project ID of the project for which to list Cloud SQL instances.
2173    pub project: std::string::String,
2174
2175    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2176}
2177
2178impl SqlInstancesListRequest {
2179    pub fn new() -> Self {
2180        std::default::Default::default()
2181    }
2182
2183    /// Sets the value of [filter][crate::model::SqlInstancesListRequest::filter].
2184    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2185        self.filter = v.into();
2186        self
2187    }
2188
2189    /// Sets the value of [max_results][crate::model::SqlInstancesListRequest::max_results].
2190    pub fn set_max_results<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
2191        self.max_results = v.into();
2192        self
2193    }
2194
2195    /// Sets the value of [page_token][crate::model::SqlInstancesListRequest::page_token].
2196    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2197        self.page_token = v.into();
2198        self
2199    }
2200
2201    /// Sets the value of [project][crate::model::SqlInstancesListRequest::project].
2202    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2203        self.project = v.into();
2204        self
2205    }
2206}
2207
2208impl wkt::message::Message for SqlInstancesListRequest {
2209    fn typename() -> &'static str {
2210        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListRequest"
2211    }
2212}
2213
2214/// Instance list server CAs request.
2215#[derive(Clone, Default, PartialEq)]
2216#[non_exhaustive]
2217pub struct SqlInstancesListServerCasRequest {
2218    /// Cloud SQL instance ID. This does not include the project ID.
2219    pub instance: std::string::String,
2220
2221    /// Project ID of the project that contains the instance.
2222    pub project: std::string::String,
2223
2224    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2225}
2226
2227impl SqlInstancesListServerCasRequest {
2228    pub fn new() -> Self {
2229        std::default::Default::default()
2230    }
2231
2232    /// Sets the value of [instance][crate::model::SqlInstancesListServerCasRequest::instance].
2233    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2234        self.instance = v.into();
2235        self
2236    }
2237
2238    /// Sets the value of [project][crate::model::SqlInstancesListServerCasRequest::project].
2239    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2240        self.project = v.into();
2241        self
2242    }
2243}
2244
2245impl wkt::message::Message for SqlInstancesListServerCasRequest {
2246    fn typename() -> &'static str {
2247        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListServerCasRequest"
2248    }
2249}
2250
2251/// Instance patch request.
2252#[derive(Clone, Default, PartialEq)]
2253#[non_exhaustive]
2254pub struct SqlInstancesPatchRequest {
2255    /// Cloud SQL instance ID. This does not include the project ID.
2256    pub instance: std::string::String,
2257
2258    /// Project ID of the project that contains the instance.
2259    pub project: std::string::String,
2260
2261    pub body: std::option::Option<crate::model::DatabaseInstance>,
2262
2263    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2264}
2265
2266impl SqlInstancesPatchRequest {
2267    pub fn new() -> Self {
2268        std::default::Default::default()
2269    }
2270
2271    /// Sets the value of [instance][crate::model::SqlInstancesPatchRequest::instance].
2272    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2273        self.instance = v.into();
2274        self
2275    }
2276
2277    /// Sets the value of [project][crate::model::SqlInstancesPatchRequest::project].
2278    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2279        self.project = v.into();
2280        self
2281    }
2282
2283    /// Sets the value of [body][crate::model::SqlInstancesPatchRequest::body].
2284    pub fn set_body<T>(mut self, v: T) -> Self
2285    where
2286        T: std::convert::Into<crate::model::DatabaseInstance>,
2287    {
2288        self.body = std::option::Option::Some(v.into());
2289        self
2290    }
2291
2292    /// Sets or clears the value of [body][crate::model::SqlInstancesPatchRequest::body].
2293    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2294    where
2295        T: std::convert::Into<crate::model::DatabaseInstance>,
2296    {
2297        self.body = v.map(|x| x.into());
2298        self
2299    }
2300}
2301
2302impl wkt::message::Message for SqlInstancesPatchRequest {
2303    fn typename() -> &'static str {
2304        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPatchRequest"
2305    }
2306}
2307
2308/// Instance promote replica request.
2309#[derive(Clone, Default, PartialEq)]
2310#[non_exhaustive]
2311pub struct SqlInstancesPromoteReplicaRequest {
2312    /// Cloud SQL read replica instance name.
2313    pub instance: std::string::String,
2314
2315    /// ID of the project that contains the read replica.
2316    pub project: std::string::String,
2317
2318    /// Set to true to invoke a replica failover to the designated DR
2319    /// replica. As part of replica failover, the promote operation attempts
2320    /// to add the original primary instance as a replica of the promoted
2321    /// DR replica when the original primary instance comes back online.
2322    /// If set to false or not specified, then the original primary
2323    /// instance becomes an independent Cloud SQL primary instance.
2324    /// Only applicable to MySQL.
2325    pub failover: bool,
2326
2327    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2328}
2329
2330impl SqlInstancesPromoteReplicaRequest {
2331    pub fn new() -> Self {
2332        std::default::Default::default()
2333    }
2334
2335    /// Sets the value of [instance][crate::model::SqlInstancesPromoteReplicaRequest::instance].
2336    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2337        self.instance = v.into();
2338        self
2339    }
2340
2341    /// Sets the value of [project][crate::model::SqlInstancesPromoteReplicaRequest::project].
2342    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2343        self.project = v.into();
2344        self
2345    }
2346
2347    /// Sets the value of [failover][crate::model::SqlInstancesPromoteReplicaRequest::failover].
2348    pub fn set_failover<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2349        self.failover = v.into();
2350        self
2351    }
2352}
2353
2354impl wkt::message::Message for SqlInstancesPromoteReplicaRequest {
2355    fn typename() -> &'static str {
2356        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest"
2357    }
2358}
2359
2360/// Instance switchover request.
2361#[derive(Clone, Default, PartialEq)]
2362#[non_exhaustive]
2363pub struct SqlInstancesSwitchoverRequest {
2364    /// Cloud SQL read replica instance name.
2365    pub instance: std::string::String,
2366
2367    /// ID of the project that contains the replica.
2368    pub project: std::string::String,
2369
2370    /// Optional. (MySQL only) Cloud SQL instance operations timeout, which is a
2371    /// sum of all database operations. Default value is 10 minutes and can be
2372    /// modified to a maximum value of 24 hours.
2373    pub db_timeout: std::option::Option<wkt::Duration>,
2374
2375    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2376}
2377
2378impl SqlInstancesSwitchoverRequest {
2379    pub fn new() -> Self {
2380        std::default::Default::default()
2381    }
2382
2383    /// Sets the value of [instance][crate::model::SqlInstancesSwitchoverRequest::instance].
2384    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2385        self.instance = v.into();
2386        self
2387    }
2388
2389    /// Sets the value of [project][crate::model::SqlInstancesSwitchoverRequest::project].
2390    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2391        self.project = v.into();
2392        self
2393    }
2394
2395    /// Sets the value of [db_timeout][crate::model::SqlInstancesSwitchoverRequest::db_timeout].
2396    pub fn set_db_timeout<T>(mut self, v: T) -> Self
2397    where
2398        T: std::convert::Into<wkt::Duration>,
2399    {
2400        self.db_timeout = std::option::Option::Some(v.into());
2401        self
2402    }
2403
2404    /// Sets or clears the value of [db_timeout][crate::model::SqlInstancesSwitchoverRequest::db_timeout].
2405    pub fn set_or_clear_db_timeout<T>(mut self, v: std::option::Option<T>) -> Self
2406    where
2407        T: std::convert::Into<wkt::Duration>,
2408    {
2409        self.db_timeout = v.map(|x| x.into());
2410        self
2411    }
2412}
2413
2414impl wkt::message::Message for SqlInstancesSwitchoverRequest {
2415    fn typename() -> &'static str {
2416        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesSwitchoverRequest"
2417    }
2418}
2419
2420/// Instance reset SSL config request.
2421#[derive(Clone, Default, PartialEq)]
2422#[non_exhaustive]
2423pub struct SqlInstancesResetSslConfigRequest {
2424    /// Cloud SQL instance ID. This does not include the project ID.
2425    pub instance: std::string::String,
2426
2427    /// Project ID of the project that contains the instance.
2428    pub project: std::string::String,
2429
2430    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2431}
2432
2433impl SqlInstancesResetSslConfigRequest {
2434    pub fn new() -> Self {
2435        std::default::Default::default()
2436    }
2437
2438    /// Sets the value of [instance][crate::model::SqlInstancesResetSslConfigRequest::instance].
2439    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2440        self.instance = v.into();
2441        self
2442    }
2443
2444    /// Sets the value of [project][crate::model::SqlInstancesResetSslConfigRequest::project].
2445    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2446        self.project = v.into();
2447        self
2448    }
2449}
2450
2451impl wkt::message::Message for SqlInstancesResetSslConfigRequest {
2452    fn typename() -> &'static str {
2453        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesResetSslConfigRequest"
2454    }
2455}
2456
2457/// Instance restart request.
2458#[derive(Clone, Default, PartialEq)]
2459#[non_exhaustive]
2460pub struct SqlInstancesRestartRequest {
2461    /// Cloud SQL instance ID. This does not include the project ID.
2462    pub instance: std::string::String,
2463
2464    /// Project ID of the project that contains the instance to be restarted.
2465    pub project: std::string::String,
2466
2467    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2468}
2469
2470impl SqlInstancesRestartRequest {
2471    pub fn new() -> Self {
2472        std::default::Default::default()
2473    }
2474
2475    /// Sets the value of [instance][crate::model::SqlInstancesRestartRequest::instance].
2476    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2477        self.instance = v.into();
2478        self
2479    }
2480
2481    /// Sets the value of [project][crate::model::SqlInstancesRestartRequest::project].
2482    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2483        self.project = v.into();
2484        self
2485    }
2486}
2487
2488impl wkt::message::Message for SqlInstancesRestartRequest {
2489    fn typename() -> &'static str {
2490        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRestartRequest"
2491    }
2492}
2493
2494/// Instance restore backup request.
2495#[derive(Clone, Default, PartialEq)]
2496#[non_exhaustive]
2497pub struct SqlInstancesRestoreBackupRequest {
2498    /// Cloud SQL instance ID. This does not include the project ID.
2499    pub instance: std::string::String,
2500
2501    /// Project ID of the project that contains the instance.
2502    pub project: std::string::String,
2503
2504    pub body: std::option::Option<crate::model::InstancesRestoreBackupRequest>,
2505
2506    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2507}
2508
2509impl SqlInstancesRestoreBackupRequest {
2510    pub fn new() -> Self {
2511        std::default::Default::default()
2512    }
2513
2514    /// Sets the value of [instance][crate::model::SqlInstancesRestoreBackupRequest::instance].
2515    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2516        self.instance = v.into();
2517        self
2518    }
2519
2520    /// Sets the value of [project][crate::model::SqlInstancesRestoreBackupRequest::project].
2521    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2522        self.project = v.into();
2523        self
2524    }
2525
2526    /// Sets the value of [body][crate::model::SqlInstancesRestoreBackupRequest::body].
2527    pub fn set_body<T>(mut self, v: T) -> Self
2528    where
2529        T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
2530    {
2531        self.body = std::option::Option::Some(v.into());
2532        self
2533    }
2534
2535    /// Sets or clears the value of [body][crate::model::SqlInstancesRestoreBackupRequest::body].
2536    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2537    where
2538        T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
2539    {
2540        self.body = v.map(|x| x.into());
2541        self
2542    }
2543}
2544
2545impl wkt::message::Message for SqlInstancesRestoreBackupRequest {
2546    fn typename() -> &'static str {
2547        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRestoreBackupRequest"
2548    }
2549}
2550
2551/// Instance rotate server CA request.
2552#[derive(Clone, Default, PartialEq)]
2553#[non_exhaustive]
2554pub struct SqlInstancesRotateServerCaRequest {
2555    /// Cloud SQL instance ID. This does not include the project ID.
2556    pub instance: std::string::String,
2557
2558    /// Project ID of the project that contains the instance.
2559    pub project: std::string::String,
2560
2561    pub body: std::option::Option<crate::model::InstancesRotateServerCaRequest>,
2562
2563    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2564}
2565
2566impl SqlInstancesRotateServerCaRequest {
2567    pub fn new() -> Self {
2568        std::default::Default::default()
2569    }
2570
2571    /// Sets the value of [instance][crate::model::SqlInstancesRotateServerCaRequest::instance].
2572    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2573        self.instance = v.into();
2574        self
2575    }
2576
2577    /// Sets the value of [project][crate::model::SqlInstancesRotateServerCaRequest::project].
2578    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2579        self.project = v.into();
2580        self
2581    }
2582
2583    /// Sets the value of [body][crate::model::SqlInstancesRotateServerCaRequest::body].
2584    pub fn set_body<T>(mut self, v: T) -> Self
2585    where
2586        T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
2587    {
2588        self.body = std::option::Option::Some(v.into());
2589        self
2590    }
2591
2592    /// Sets or clears the value of [body][crate::model::SqlInstancesRotateServerCaRequest::body].
2593    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2594    where
2595        T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
2596    {
2597        self.body = v.map(|x| x.into());
2598        self
2599    }
2600}
2601
2602impl wkt::message::Message for SqlInstancesRotateServerCaRequest {
2603    fn typename() -> &'static str {
2604        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRotateServerCaRequest"
2605    }
2606}
2607
2608/// Instance start replica request.
2609#[derive(Clone, Default, PartialEq)]
2610#[non_exhaustive]
2611pub struct SqlInstancesStartReplicaRequest {
2612    /// Cloud SQL read replica instance name.
2613    pub instance: std::string::String,
2614
2615    /// ID of the project that contains the read replica.
2616    pub project: std::string::String,
2617
2618    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2619}
2620
2621impl SqlInstancesStartReplicaRequest {
2622    pub fn new() -> Self {
2623        std::default::Default::default()
2624    }
2625
2626    /// Sets the value of [instance][crate::model::SqlInstancesStartReplicaRequest::instance].
2627    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2628        self.instance = v.into();
2629        self
2630    }
2631
2632    /// Sets the value of [project][crate::model::SqlInstancesStartReplicaRequest::project].
2633    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2634        self.project = v.into();
2635        self
2636    }
2637}
2638
2639impl wkt::message::Message for SqlInstancesStartReplicaRequest {
2640    fn typename() -> &'static str {
2641        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStartReplicaRequest"
2642    }
2643}
2644
2645/// Instance stop replica request.
2646#[derive(Clone, Default, PartialEq)]
2647#[non_exhaustive]
2648pub struct SqlInstancesStopReplicaRequest {
2649    /// Cloud SQL read replica instance name.
2650    pub instance: std::string::String,
2651
2652    /// ID of the project that contains the read replica.
2653    pub project: std::string::String,
2654
2655    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2656}
2657
2658impl SqlInstancesStopReplicaRequest {
2659    pub fn new() -> Self {
2660        std::default::Default::default()
2661    }
2662
2663    /// Sets the value of [instance][crate::model::SqlInstancesStopReplicaRequest::instance].
2664    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2665        self.instance = v.into();
2666        self
2667    }
2668
2669    /// Sets the value of [project][crate::model::SqlInstancesStopReplicaRequest::project].
2670    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2671        self.project = v.into();
2672        self
2673    }
2674}
2675
2676impl wkt::message::Message for SqlInstancesStopReplicaRequest {
2677    fn typename() -> &'static str {
2678        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStopReplicaRequest"
2679    }
2680}
2681
2682/// Instance truncate log request.
2683#[derive(Clone, Default, PartialEq)]
2684#[non_exhaustive]
2685pub struct SqlInstancesTruncateLogRequest {
2686    /// Cloud SQL instance ID. This does not include the project ID.
2687    pub instance: std::string::String,
2688
2689    /// Project ID of the Cloud SQL project.
2690    pub project: std::string::String,
2691
2692    pub body: std::option::Option<crate::model::InstancesTruncateLogRequest>,
2693
2694    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2695}
2696
2697impl SqlInstancesTruncateLogRequest {
2698    pub fn new() -> Self {
2699        std::default::Default::default()
2700    }
2701
2702    /// Sets the value of [instance][crate::model::SqlInstancesTruncateLogRequest::instance].
2703    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2704        self.instance = v.into();
2705        self
2706    }
2707
2708    /// Sets the value of [project][crate::model::SqlInstancesTruncateLogRequest::project].
2709    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2710        self.project = v.into();
2711        self
2712    }
2713
2714    /// Sets the value of [body][crate::model::SqlInstancesTruncateLogRequest::body].
2715    pub fn set_body<T>(mut self, v: T) -> Self
2716    where
2717        T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
2718    {
2719        self.body = std::option::Option::Some(v.into());
2720        self
2721    }
2722
2723    /// Sets or clears the value of [body][crate::model::SqlInstancesTruncateLogRequest::body].
2724    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2725    where
2726        T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
2727    {
2728        self.body = v.map(|x| x.into());
2729        self
2730    }
2731}
2732
2733impl wkt::message::Message for SqlInstancesTruncateLogRequest {
2734    fn typename() -> &'static str {
2735        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesTruncateLogRequest"
2736    }
2737}
2738
2739/// Instance perform disk shrink request.
2740#[derive(Clone, Default, PartialEq)]
2741#[non_exhaustive]
2742pub struct SqlInstancesPerformDiskShrinkRequest {
2743    /// Cloud SQL instance ID. This does not include the project ID.
2744    pub instance: std::string::String,
2745
2746    /// Project ID of the project that contains the instance.
2747    pub project: std::string::String,
2748
2749    /// Perform disk shrink context.
2750    pub body: std::option::Option<crate::model::PerformDiskShrinkContext>,
2751
2752    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2753}
2754
2755impl SqlInstancesPerformDiskShrinkRequest {
2756    pub fn new() -> Self {
2757        std::default::Default::default()
2758    }
2759
2760    /// Sets the value of [instance][crate::model::SqlInstancesPerformDiskShrinkRequest::instance].
2761    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2762        self.instance = v.into();
2763        self
2764    }
2765
2766    /// Sets the value of [project][crate::model::SqlInstancesPerformDiskShrinkRequest::project].
2767    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2768        self.project = v.into();
2769        self
2770    }
2771
2772    /// Sets the value of [body][crate::model::SqlInstancesPerformDiskShrinkRequest::body].
2773    pub fn set_body<T>(mut self, v: T) -> Self
2774    where
2775        T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
2776    {
2777        self.body = std::option::Option::Some(v.into());
2778        self
2779    }
2780
2781    /// Sets or clears the value of [body][crate::model::SqlInstancesPerformDiskShrinkRequest::body].
2782    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2783    where
2784        T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
2785    {
2786        self.body = v.map(|x| x.into());
2787        self
2788    }
2789}
2790
2791impl wkt::message::Message for SqlInstancesPerformDiskShrinkRequest {
2792    fn typename() -> &'static str {
2793        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest"
2794    }
2795}
2796
2797/// Instance update request.
2798#[derive(Clone, Default, PartialEq)]
2799#[non_exhaustive]
2800pub struct SqlInstancesUpdateRequest {
2801    /// Cloud SQL instance ID. This does not include the project ID.
2802    pub instance: std::string::String,
2803
2804    /// Project ID of the project that contains the instance.
2805    pub project: std::string::String,
2806
2807    pub body: std::option::Option<crate::model::DatabaseInstance>,
2808
2809    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2810}
2811
2812impl SqlInstancesUpdateRequest {
2813    pub fn new() -> Self {
2814        std::default::Default::default()
2815    }
2816
2817    /// Sets the value of [instance][crate::model::SqlInstancesUpdateRequest::instance].
2818    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2819        self.instance = v.into();
2820        self
2821    }
2822
2823    /// Sets the value of [project][crate::model::SqlInstancesUpdateRequest::project].
2824    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2825        self.project = v.into();
2826        self
2827    }
2828
2829    /// Sets the value of [body][crate::model::SqlInstancesUpdateRequest::body].
2830    pub fn set_body<T>(mut self, v: T) -> Self
2831    where
2832        T: std::convert::Into<crate::model::DatabaseInstance>,
2833    {
2834        self.body = std::option::Option::Some(v.into());
2835        self
2836    }
2837
2838    /// Sets or clears the value of [body][crate::model::SqlInstancesUpdateRequest::body].
2839    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2840    where
2841        T: std::convert::Into<crate::model::DatabaseInstance>,
2842    {
2843        self.body = v.map(|x| x.into());
2844        self
2845    }
2846}
2847
2848impl wkt::message::Message for SqlInstancesUpdateRequest {
2849    fn typename() -> &'static str {
2850        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesUpdateRequest"
2851    }
2852}
2853
2854/// Instance reschedule maintenance request.
2855#[derive(Clone, Default, PartialEq)]
2856#[non_exhaustive]
2857pub struct SqlInstancesRescheduleMaintenanceRequest {
2858    /// Cloud SQL instance ID. This does not include the project ID.
2859    pub instance: std::string::String,
2860
2861    /// ID of the project that contains the instance.
2862    pub project: std::string::String,
2863
2864    pub body: std::option::Option<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
2865
2866    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2867}
2868
2869impl SqlInstancesRescheduleMaintenanceRequest {
2870    pub fn new() -> Self {
2871        std::default::Default::default()
2872    }
2873
2874    /// Sets the value of [instance][crate::model::SqlInstancesRescheduleMaintenanceRequest::instance].
2875    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2876        self.instance = v.into();
2877        self
2878    }
2879
2880    /// Sets the value of [project][crate::model::SqlInstancesRescheduleMaintenanceRequest::project].
2881    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2882        self.project = v.into();
2883        self
2884    }
2885
2886    /// Sets the value of [body][crate::model::SqlInstancesRescheduleMaintenanceRequest::body].
2887    pub fn set_body<T>(mut self, v: T) -> Self
2888    where
2889        T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
2890    {
2891        self.body = std::option::Option::Some(v.into());
2892        self
2893    }
2894
2895    /// Sets or clears the value of [body][crate::model::SqlInstancesRescheduleMaintenanceRequest::body].
2896    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2897    where
2898        T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
2899    {
2900        self.body = v.map(|x| x.into());
2901        self
2902    }
2903}
2904
2905impl wkt::message::Message for SqlInstancesRescheduleMaintenanceRequest {
2906    fn typename() -> &'static str {
2907        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest"
2908    }
2909}
2910
2911/// Instance reencrypt request.
2912#[derive(Clone, Default, PartialEq)]
2913#[non_exhaustive]
2914pub struct SqlInstancesReencryptRequest {
2915    /// Cloud SQL instance ID. This does not include the project ID.
2916    pub instance: std::string::String,
2917
2918    /// ID of the project that contains the instance.
2919    pub project: std::string::String,
2920
2921    /// Reencrypt body that users request
2922    pub body: std::option::Option<crate::model::InstancesReencryptRequest>,
2923
2924    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2925}
2926
2927impl SqlInstancesReencryptRequest {
2928    pub fn new() -> Self {
2929        std::default::Default::default()
2930    }
2931
2932    /// Sets the value of [instance][crate::model::SqlInstancesReencryptRequest::instance].
2933    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2934        self.instance = v.into();
2935        self
2936    }
2937
2938    /// Sets the value of [project][crate::model::SqlInstancesReencryptRequest::project].
2939    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2940        self.project = v.into();
2941        self
2942    }
2943
2944    /// Sets the value of [body][crate::model::SqlInstancesReencryptRequest::body].
2945    pub fn set_body<T>(mut self, v: T) -> Self
2946    where
2947        T: std::convert::Into<crate::model::InstancesReencryptRequest>,
2948    {
2949        self.body = std::option::Option::Some(v.into());
2950        self
2951    }
2952
2953    /// Sets or clears the value of [body][crate::model::SqlInstancesReencryptRequest::body].
2954    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2955    where
2956        T: std::convert::Into<crate::model::InstancesReencryptRequest>,
2957    {
2958        self.body = v.map(|x| x.into());
2959        self
2960    }
2961}
2962
2963impl wkt::message::Message for SqlInstancesReencryptRequest {
2964    fn typename() -> &'static str {
2965        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReencryptRequest"
2966    }
2967}
2968
2969/// Database Instance reencrypt request.
2970#[derive(Clone, Default, PartialEq)]
2971#[non_exhaustive]
2972pub struct InstancesReencryptRequest {
2973    /// Configuration specific to backup re-encryption
2974    pub backup_reencryption_config: std::option::Option<crate::model::BackupReencryptionConfig>,
2975
2976    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2977}
2978
2979impl InstancesReencryptRequest {
2980    pub fn new() -> Self {
2981        std::default::Default::default()
2982    }
2983
2984    /// Sets the value of [backup_reencryption_config][crate::model::InstancesReencryptRequest::backup_reencryption_config].
2985    pub fn set_backup_reencryption_config<T>(mut self, v: T) -> Self
2986    where
2987        T: std::convert::Into<crate::model::BackupReencryptionConfig>,
2988    {
2989        self.backup_reencryption_config = std::option::Option::Some(v.into());
2990        self
2991    }
2992
2993    /// Sets or clears the value of [backup_reencryption_config][crate::model::InstancesReencryptRequest::backup_reencryption_config].
2994    pub fn set_or_clear_backup_reencryption_config<T>(mut self, v: std::option::Option<T>) -> Self
2995    where
2996        T: std::convert::Into<crate::model::BackupReencryptionConfig>,
2997    {
2998        self.backup_reencryption_config = v.map(|x| x.into());
2999        self
3000    }
3001}
3002
3003impl wkt::message::Message for InstancesReencryptRequest {
3004    fn typename() -> &'static str {
3005        "type.googleapis.com/google.cloud.sql.v1.InstancesReencryptRequest"
3006    }
3007}
3008
3009/// Backup Reencryption Config
3010#[derive(Clone, Default, PartialEq)]
3011#[non_exhaustive]
3012pub struct BackupReencryptionConfig {
3013    /// Backup re-encryption limit
3014    pub backup_limit: std::option::Option<i32>,
3015
3016    /// Type of backups users want to re-encrypt.
3017    pub backup_type: std::option::Option<crate::model::backup_reencryption_config::BackupType>,
3018
3019    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3020}
3021
3022impl BackupReencryptionConfig {
3023    pub fn new() -> Self {
3024        std::default::Default::default()
3025    }
3026
3027    /// Sets the value of [backup_limit][crate::model::BackupReencryptionConfig::backup_limit].
3028    pub fn set_backup_limit<T>(mut self, v: T) -> Self
3029    where
3030        T: std::convert::Into<i32>,
3031    {
3032        self.backup_limit = std::option::Option::Some(v.into());
3033        self
3034    }
3035
3036    /// Sets or clears the value of [backup_limit][crate::model::BackupReencryptionConfig::backup_limit].
3037    pub fn set_or_clear_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
3038    where
3039        T: std::convert::Into<i32>,
3040    {
3041        self.backup_limit = v.map(|x| x.into());
3042        self
3043    }
3044
3045    /// Sets the value of [backup_type][crate::model::BackupReencryptionConfig::backup_type].
3046    pub fn set_backup_type<T>(mut self, v: T) -> Self
3047    where
3048        T: std::convert::Into<crate::model::backup_reencryption_config::BackupType>,
3049    {
3050        self.backup_type = std::option::Option::Some(v.into());
3051        self
3052    }
3053
3054    /// Sets or clears the value of [backup_type][crate::model::BackupReencryptionConfig::backup_type].
3055    pub fn set_or_clear_backup_type<T>(mut self, v: std::option::Option<T>) -> Self
3056    where
3057        T: std::convert::Into<crate::model::backup_reencryption_config::BackupType>,
3058    {
3059        self.backup_type = v.map(|x| x.into());
3060        self
3061    }
3062}
3063
3064impl wkt::message::Message for BackupReencryptionConfig {
3065    fn typename() -> &'static str {
3066        "type.googleapis.com/google.cloud.sql.v1.BackupReencryptionConfig"
3067    }
3068}
3069
3070/// Defines additional types related to [BackupReencryptionConfig].
3071pub mod backup_reencryption_config {
3072    #[allow(unused_imports)]
3073    use super::*;
3074
3075    /// Backup type for re-encryption
3076    ///
3077    /// # Working with unknown values
3078    ///
3079    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3080    /// additional enum variants at any time. Adding new variants is not considered
3081    /// a breaking change. Applications should write their code in anticipation of:
3082    ///
3083    /// - New values appearing in future releases of the client library, **and**
3084    /// - New values received dynamically, without application changes.
3085    ///
3086    /// Please consult the [Working with enums] section in the user guide for some
3087    /// guidelines.
3088    ///
3089    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3090    #[derive(Clone, Debug, PartialEq)]
3091    #[non_exhaustive]
3092    pub enum BackupType {
3093        /// Unknown backup type, will be defaulted to AUTOMATIC backup type
3094        Unspecified,
3095        /// Reencrypt automatic backups
3096        Automated,
3097        /// Reencrypt on-demand backups
3098        OnDemand,
3099        /// If set, the enum was initialized with an unknown value.
3100        ///
3101        /// Applications can examine the value using [BackupType::value] or
3102        /// [BackupType::name].
3103        UnknownValue(backup_type::UnknownValue),
3104    }
3105
3106    #[doc(hidden)]
3107    pub mod backup_type {
3108        #[allow(unused_imports)]
3109        use super::*;
3110        #[derive(Clone, Debug, PartialEq)]
3111        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3112    }
3113
3114    impl BackupType {
3115        /// Gets the enum value.
3116        ///
3117        /// Returns `None` if the enum contains an unknown value deserialized from
3118        /// the string representation of enums.
3119        pub fn value(&self) -> std::option::Option<i32> {
3120            match self {
3121                Self::Unspecified => std::option::Option::Some(0),
3122                Self::Automated => std::option::Option::Some(1),
3123                Self::OnDemand => std::option::Option::Some(2),
3124                Self::UnknownValue(u) => u.0.value(),
3125            }
3126        }
3127
3128        /// Gets the enum value as a string.
3129        ///
3130        /// Returns `None` if the enum contains an unknown value deserialized from
3131        /// the integer representation of enums.
3132        pub fn name(&self) -> std::option::Option<&str> {
3133            match self {
3134                Self::Unspecified => std::option::Option::Some("BACKUP_TYPE_UNSPECIFIED"),
3135                Self::Automated => std::option::Option::Some("AUTOMATED"),
3136                Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
3137                Self::UnknownValue(u) => u.0.name(),
3138            }
3139        }
3140    }
3141
3142    impl std::default::Default for BackupType {
3143        fn default() -> Self {
3144            use std::convert::From;
3145            Self::from(0)
3146        }
3147    }
3148
3149    impl std::fmt::Display for BackupType {
3150        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3151            wkt::internal::display_enum(f, self.name(), self.value())
3152        }
3153    }
3154
3155    impl std::convert::From<i32> for BackupType {
3156        fn from(value: i32) -> Self {
3157            match value {
3158                0 => Self::Unspecified,
3159                1 => Self::Automated,
3160                2 => Self::OnDemand,
3161                _ => Self::UnknownValue(backup_type::UnknownValue(
3162                    wkt::internal::UnknownEnumValue::Integer(value),
3163                )),
3164            }
3165        }
3166    }
3167
3168    impl std::convert::From<&str> for BackupType {
3169        fn from(value: &str) -> Self {
3170            use std::string::ToString;
3171            match value {
3172                "BACKUP_TYPE_UNSPECIFIED" => Self::Unspecified,
3173                "AUTOMATED" => Self::Automated,
3174                "ON_DEMAND" => Self::OnDemand,
3175                _ => Self::UnknownValue(backup_type::UnknownValue(
3176                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3177                )),
3178            }
3179        }
3180    }
3181
3182    impl serde::ser::Serialize for BackupType {
3183        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3184        where
3185            S: serde::Serializer,
3186        {
3187            match self {
3188                Self::Unspecified => serializer.serialize_i32(0),
3189                Self::Automated => serializer.serialize_i32(1),
3190                Self::OnDemand => serializer.serialize_i32(2),
3191                Self::UnknownValue(u) => u.0.serialize(serializer),
3192            }
3193        }
3194    }
3195
3196    impl<'de> serde::de::Deserialize<'de> for BackupType {
3197        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3198        where
3199            D: serde::Deserializer<'de>,
3200        {
3201            deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupType>::new(
3202                ".google.cloud.sql.v1.BackupReencryptionConfig.BackupType",
3203            ))
3204        }
3205    }
3206}
3207
3208/// Instance get disk shrink config request.
3209#[derive(Clone, Default, PartialEq)]
3210#[non_exhaustive]
3211pub struct SqlInstancesGetDiskShrinkConfigRequest {
3212    /// Cloud SQL instance ID. This does not include the project ID.
3213    pub instance: std::string::String,
3214
3215    /// Project ID of the project that contains the instance.
3216    pub project: std::string::String,
3217
3218    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3219}
3220
3221impl SqlInstancesGetDiskShrinkConfigRequest {
3222    pub fn new() -> Self {
3223        std::default::Default::default()
3224    }
3225
3226    /// Sets the value of [instance][crate::model::SqlInstancesGetDiskShrinkConfigRequest::instance].
3227    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3228        self.instance = v.into();
3229        self
3230    }
3231
3232    /// Sets the value of [project][crate::model::SqlInstancesGetDiskShrinkConfigRequest::project].
3233    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3234        self.project = v.into();
3235        self
3236    }
3237}
3238
3239impl wkt::message::Message for SqlInstancesGetDiskShrinkConfigRequest {
3240    fn typename() -> &'static str {
3241        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest"
3242    }
3243}
3244
3245/// Instance verify external sync settings request.
3246#[derive(Clone, Default, PartialEq)]
3247#[non_exhaustive]
3248pub struct SqlInstancesVerifyExternalSyncSettingsRequest {
3249    /// Cloud SQL instance ID. This does not include the project ID.
3250    pub instance: std::string::String,
3251
3252    /// Project ID of the project that contains the instance.
3253    pub project: std::string::String,
3254
3255    /// Flag to enable verifying connection only
3256    pub verify_connection_only: bool,
3257
3258    /// External sync mode
3259    pub sync_mode:
3260        crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
3261
3262    /// Optional. Flag to verify settings required by replication setup only
3263    pub verify_replication_only: bool,
3264
3265    /// Optional. MigrationType configures the migration to use physical files or
3266    /// logical dump files. If not set, then the logical dump file configuration is
3267    /// used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
3268    pub migration_type:
3269        crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
3270
3271    /// Optional. Parallel level for initial data sync. Only applicable for
3272    /// PostgreSQL.
3273    pub sync_parallel_level: crate::model::ExternalSyncParallelLevel,
3274
3275    pub sync_config: std::option::Option<
3276        crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
3277    >,
3278
3279    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3280}
3281
3282impl SqlInstancesVerifyExternalSyncSettingsRequest {
3283    pub fn new() -> Self {
3284        std::default::Default::default()
3285    }
3286
3287    /// Sets the value of [instance][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::instance].
3288    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3289        self.instance = v.into();
3290        self
3291    }
3292
3293    /// Sets the value of [project][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::project].
3294    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3295        self.project = v.into();
3296        self
3297    }
3298
3299    /// Sets the value of [verify_connection_only][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::verify_connection_only].
3300    pub fn set_verify_connection_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3301        self.verify_connection_only = v.into();
3302        self
3303    }
3304
3305    /// Sets the value of [sync_mode][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_mode].
3306    pub fn set_sync_mode<
3307        T: std::convert::Into<
3308                crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
3309            >,
3310    >(
3311        mut self,
3312        v: T,
3313    ) -> Self {
3314        self.sync_mode = v.into();
3315        self
3316    }
3317
3318    /// Sets the value of [verify_replication_only][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::verify_replication_only].
3319    pub fn set_verify_replication_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3320        self.verify_replication_only = v.into();
3321        self
3322    }
3323
3324    /// Sets the value of [migration_type][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::migration_type].
3325    pub fn set_migration_type<
3326        T: std::convert::Into<
3327                crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
3328            >,
3329    >(
3330        mut self,
3331        v: T,
3332    ) -> Self {
3333        self.migration_type = v.into();
3334        self
3335    }
3336
3337    /// Sets the value of [sync_parallel_level][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_parallel_level].
3338    pub fn set_sync_parallel_level<
3339        T: std::convert::Into<crate::model::ExternalSyncParallelLevel>,
3340    >(
3341        mut self,
3342        v: T,
3343    ) -> Self {
3344        self.sync_parallel_level = v.into();
3345        self
3346    }
3347
3348    /// Sets the value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config].
3349    ///
3350    /// Note that all the setters affecting `sync_config` are mutually
3351    /// exclusive.
3352    pub fn set_sync_config<
3353        T: std::convert::Into<
3354                std::option::Option<
3355                    crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
3356                >,
3357            >,
3358    >(
3359        mut self,
3360        v: T,
3361    ) -> Self {
3362        self.sync_config = v.into();
3363        self
3364    }
3365
3366    /// The value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config]
3367    /// if it holds a `MysqlSyncConfig`, `None` if the field is not set or
3368    /// holds a different branch.
3369    pub fn mysql_sync_config(
3370        &self,
3371    ) -> std::option::Option<&std::boxed::Box<crate::model::MySqlSyncConfig>> {
3372        #[allow(unreachable_patterns)]
3373        self.sync_config.as_ref().and_then(|v| match v {
3374            crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(v) => std::option::Option::Some(v),
3375            _ => std::option::Option::None,
3376        })
3377    }
3378
3379    /// Sets the value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config]
3380    /// to hold a `MysqlSyncConfig`.
3381    ///
3382    /// Note that all the setters affecting `sync_config` are
3383    /// mutually exclusive.
3384    pub fn set_mysql_sync_config<
3385        T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
3386    >(
3387        mut self,
3388        v: T,
3389    ) -> Self {
3390        self.sync_config = std::option::Option::Some(
3391            crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(
3392                v.into()
3393            )
3394        );
3395        self
3396    }
3397}
3398
3399impl wkt::message::Message for SqlInstancesVerifyExternalSyncSettingsRequest {
3400    fn typename() -> &'static str {
3401        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest"
3402    }
3403}
3404
3405/// Defines additional types related to [SqlInstancesVerifyExternalSyncSettingsRequest].
3406pub mod sql_instances_verify_external_sync_settings_request {
3407    #[allow(unused_imports)]
3408    use super::*;
3409
3410    ///
3411    /// # Working with unknown values
3412    ///
3413    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3414    /// additional enum variants at any time. Adding new variants is not considered
3415    /// a breaking change. Applications should write their code in anticipation of:
3416    ///
3417    /// - New values appearing in future releases of the client library, **and**
3418    /// - New values received dynamically, without application changes.
3419    ///
3420    /// Please consult the [Working with enums] section in the user guide for some
3421    /// guidelines.
3422    ///
3423    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3424    #[derive(Clone, Debug, PartialEq)]
3425    #[non_exhaustive]
3426    pub enum ExternalSyncMode {
3427        /// Unknown external sync mode, will be defaulted to ONLINE mode
3428        Unspecified,
3429        /// Online external sync will set up replication after initial data external
3430        /// sync
3431        Online,
3432        /// Offline external sync only dumps and loads a one-time snapshot of
3433        /// the primary instance's data
3434        Offline,
3435        /// If set, the enum was initialized with an unknown value.
3436        ///
3437        /// Applications can examine the value using [ExternalSyncMode::value] or
3438        /// [ExternalSyncMode::name].
3439        UnknownValue(external_sync_mode::UnknownValue),
3440    }
3441
3442    #[doc(hidden)]
3443    pub mod external_sync_mode {
3444        #[allow(unused_imports)]
3445        use super::*;
3446        #[derive(Clone, Debug, PartialEq)]
3447        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3448    }
3449
3450    impl ExternalSyncMode {
3451        /// Gets the enum value.
3452        ///
3453        /// Returns `None` if the enum contains an unknown value deserialized from
3454        /// the string representation of enums.
3455        pub fn value(&self) -> std::option::Option<i32> {
3456            match self {
3457                Self::Unspecified => std::option::Option::Some(0),
3458                Self::Online => std::option::Option::Some(1),
3459                Self::Offline => std::option::Option::Some(2),
3460                Self::UnknownValue(u) => u.0.value(),
3461            }
3462        }
3463
3464        /// Gets the enum value as a string.
3465        ///
3466        /// Returns `None` if the enum contains an unknown value deserialized from
3467        /// the integer representation of enums.
3468        pub fn name(&self) -> std::option::Option<&str> {
3469            match self {
3470                Self::Unspecified => std::option::Option::Some("EXTERNAL_SYNC_MODE_UNSPECIFIED"),
3471                Self::Online => std::option::Option::Some("ONLINE"),
3472                Self::Offline => std::option::Option::Some("OFFLINE"),
3473                Self::UnknownValue(u) => u.0.name(),
3474            }
3475        }
3476    }
3477
3478    impl std::default::Default for ExternalSyncMode {
3479        fn default() -> Self {
3480            use std::convert::From;
3481            Self::from(0)
3482        }
3483    }
3484
3485    impl std::fmt::Display for ExternalSyncMode {
3486        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3487            wkt::internal::display_enum(f, self.name(), self.value())
3488        }
3489    }
3490
3491    impl std::convert::From<i32> for ExternalSyncMode {
3492        fn from(value: i32) -> Self {
3493            match value {
3494                0 => Self::Unspecified,
3495                1 => Self::Online,
3496                2 => Self::Offline,
3497                _ => Self::UnknownValue(external_sync_mode::UnknownValue(
3498                    wkt::internal::UnknownEnumValue::Integer(value),
3499                )),
3500            }
3501        }
3502    }
3503
3504    impl std::convert::From<&str> for ExternalSyncMode {
3505        fn from(value: &str) -> Self {
3506            use std::string::ToString;
3507            match value {
3508                "EXTERNAL_SYNC_MODE_UNSPECIFIED" => Self::Unspecified,
3509                "ONLINE" => Self::Online,
3510                "OFFLINE" => Self::Offline,
3511                _ => Self::UnknownValue(external_sync_mode::UnknownValue(
3512                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3513                )),
3514            }
3515        }
3516    }
3517
3518    impl serde::ser::Serialize for ExternalSyncMode {
3519        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3520        where
3521            S: serde::Serializer,
3522        {
3523            match self {
3524                Self::Unspecified => serializer.serialize_i32(0),
3525                Self::Online => serializer.serialize_i32(1),
3526                Self::Offline => serializer.serialize_i32(2),
3527                Self::UnknownValue(u) => u.0.serialize(serializer),
3528            }
3529        }
3530    }
3531
3532    impl<'de> serde::de::Deserialize<'de> for ExternalSyncMode {
3533        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3534        where
3535            D: serde::Deserializer<'de>,
3536        {
3537            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExternalSyncMode>::new(
3538                ".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode"))
3539        }
3540    }
3541
3542    /// MigrationType determines whether the migration is a physical file-based
3543    /// migration or a logical dump file-based migration.
3544    ///
3545    /// # Working with unknown values
3546    ///
3547    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3548    /// additional enum variants at any time. Adding new variants is not considered
3549    /// a breaking change. Applications should write their code in anticipation of:
3550    ///
3551    /// - New values appearing in future releases of the client library, **and**
3552    /// - New values received dynamically, without application changes.
3553    ///
3554    /// Please consult the [Working with enums] section in the user guide for some
3555    /// guidelines.
3556    ///
3557    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3558    #[derive(Clone, Debug, PartialEq)]
3559    #[non_exhaustive]
3560    pub enum MigrationType {
3561        /// Default value is a logical dump file-based migration
3562        Unspecified,
3563        /// Logical dump file-based migration
3564        Logical,
3565        /// Physical file-based migration
3566        Physical,
3567        /// If set, the enum was initialized with an unknown value.
3568        ///
3569        /// Applications can examine the value using [MigrationType::value] or
3570        /// [MigrationType::name].
3571        UnknownValue(migration_type::UnknownValue),
3572    }
3573
3574    #[doc(hidden)]
3575    pub mod migration_type {
3576        #[allow(unused_imports)]
3577        use super::*;
3578        #[derive(Clone, Debug, PartialEq)]
3579        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3580    }
3581
3582    impl MigrationType {
3583        /// Gets the enum value.
3584        ///
3585        /// Returns `None` if the enum contains an unknown value deserialized from
3586        /// the string representation of enums.
3587        pub fn value(&self) -> std::option::Option<i32> {
3588            match self {
3589                Self::Unspecified => std::option::Option::Some(0),
3590                Self::Logical => std::option::Option::Some(1),
3591                Self::Physical => std::option::Option::Some(2),
3592                Self::UnknownValue(u) => u.0.value(),
3593            }
3594        }
3595
3596        /// Gets the enum value as a string.
3597        ///
3598        /// Returns `None` if the enum contains an unknown value deserialized from
3599        /// the integer representation of enums.
3600        pub fn name(&self) -> std::option::Option<&str> {
3601            match self {
3602                Self::Unspecified => std::option::Option::Some("MIGRATION_TYPE_UNSPECIFIED"),
3603                Self::Logical => std::option::Option::Some("LOGICAL"),
3604                Self::Physical => std::option::Option::Some("PHYSICAL"),
3605                Self::UnknownValue(u) => u.0.name(),
3606            }
3607        }
3608    }
3609
3610    impl std::default::Default for MigrationType {
3611        fn default() -> Self {
3612            use std::convert::From;
3613            Self::from(0)
3614        }
3615    }
3616
3617    impl std::fmt::Display for MigrationType {
3618        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3619            wkt::internal::display_enum(f, self.name(), self.value())
3620        }
3621    }
3622
3623    impl std::convert::From<i32> for MigrationType {
3624        fn from(value: i32) -> Self {
3625            match value {
3626                0 => Self::Unspecified,
3627                1 => Self::Logical,
3628                2 => Self::Physical,
3629                _ => Self::UnknownValue(migration_type::UnknownValue(
3630                    wkt::internal::UnknownEnumValue::Integer(value),
3631                )),
3632            }
3633        }
3634    }
3635
3636    impl std::convert::From<&str> for MigrationType {
3637        fn from(value: &str) -> Self {
3638            use std::string::ToString;
3639            match value {
3640                "MIGRATION_TYPE_UNSPECIFIED" => Self::Unspecified,
3641                "LOGICAL" => Self::Logical,
3642                "PHYSICAL" => Self::Physical,
3643                _ => Self::UnknownValue(migration_type::UnknownValue(
3644                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3645                )),
3646            }
3647        }
3648    }
3649
3650    impl serde::ser::Serialize for MigrationType {
3651        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3652        where
3653            S: serde::Serializer,
3654        {
3655            match self {
3656                Self::Unspecified => serializer.serialize_i32(0),
3657                Self::Logical => serializer.serialize_i32(1),
3658                Self::Physical => serializer.serialize_i32(2),
3659                Self::UnknownValue(u) => u.0.serialize(serializer),
3660            }
3661        }
3662    }
3663
3664    impl<'de> serde::de::Deserialize<'de> for MigrationType {
3665        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3666        where
3667            D: serde::Deserializer<'de>,
3668        {
3669            deserializer.deserialize_any(wkt::internal::EnumVisitor::<MigrationType>::new(
3670                ".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType",
3671            ))
3672        }
3673    }
3674
3675    #[derive(Clone, Debug, PartialEq)]
3676    #[non_exhaustive]
3677    pub enum SyncConfig {
3678        /// Optional. MySQL-specific settings for start external sync.
3679        MysqlSyncConfig(std::boxed::Box<crate::model::MySqlSyncConfig>),
3680    }
3681}
3682
3683/// Instance start external sync request.
3684#[derive(Clone, Default, PartialEq)]
3685#[non_exhaustive]
3686pub struct SqlInstancesStartExternalSyncRequest {
3687    /// Cloud SQL instance ID. This does not include the project ID.
3688    pub instance: std::string::String,
3689
3690    /// ID of the project that contains the instance.
3691    pub project: std::string::String,
3692
3693    /// External sync mode.
3694    pub sync_mode:
3695        crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
3696
3697    /// Whether to skip the verification step (VESS).
3698    pub skip_verification: bool,
3699
3700    /// Optional. Parallel level for initial data sync. Currently only applicable
3701    /// for MySQL.
3702    pub sync_parallel_level: crate::model::ExternalSyncParallelLevel,
3703
3704    /// Optional. MigrationType configures the migration to use physical files or
3705    /// logical dump files. If not set, then the logical dump file configuration is
3706    /// used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
3707    pub migration_type:
3708        crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
3709
3710    pub sync_config:
3711        std::option::Option<crate::model::sql_instances_start_external_sync_request::SyncConfig>,
3712
3713    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3714}
3715
3716impl SqlInstancesStartExternalSyncRequest {
3717    pub fn new() -> Self {
3718        std::default::Default::default()
3719    }
3720
3721    /// Sets the value of [instance][crate::model::SqlInstancesStartExternalSyncRequest::instance].
3722    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3723        self.instance = v.into();
3724        self
3725    }
3726
3727    /// Sets the value of [project][crate::model::SqlInstancesStartExternalSyncRequest::project].
3728    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3729        self.project = v.into();
3730        self
3731    }
3732
3733    /// Sets the value of [sync_mode][crate::model::SqlInstancesStartExternalSyncRequest::sync_mode].
3734    pub fn set_sync_mode<
3735        T: std::convert::Into<
3736                crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
3737            >,
3738    >(
3739        mut self,
3740        v: T,
3741    ) -> Self {
3742        self.sync_mode = v.into();
3743        self
3744    }
3745
3746    /// Sets the value of [skip_verification][crate::model::SqlInstancesStartExternalSyncRequest::skip_verification].
3747    pub fn set_skip_verification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3748        self.skip_verification = v.into();
3749        self
3750    }
3751
3752    /// Sets the value of [sync_parallel_level][crate::model::SqlInstancesStartExternalSyncRequest::sync_parallel_level].
3753    pub fn set_sync_parallel_level<
3754        T: std::convert::Into<crate::model::ExternalSyncParallelLevel>,
3755    >(
3756        mut self,
3757        v: T,
3758    ) -> Self {
3759        self.sync_parallel_level = v.into();
3760        self
3761    }
3762
3763    /// Sets the value of [migration_type][crate::model::SqlInstancesStartExternalSyncRequest::migration_type].
3764    pub fn set_migration_type<
3765        T: std::convert::Into<
3766                crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
3767            >,
3768    >(
3769        mut self,
3770        v: T,
3771    ) -> Self {
3772        self.migration_type = v.into();
3773        self
3774    }
3775
3776    /// Sets the value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config].
3777    ///
3778    /// Note that all the setters affecting `sync_config` are mutually
3779    /// exclusive.
3780    pub fn set_sync_config<
3781        T: std::convert::Into<
3782                std::option::Option<
3783                    crate::model::sql_instances_start_external_sync_request::SyncConfig,
3784                >,
3785            >,
3786    >(
3787        mut self,
3788        v: T,
3789    ) -> Self {
3790        self.sync_config = v.into();
3791        self
3792    }
3793
3794    /// The value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config]
3795    /// if it holds a `MysqlSyncConfig`, `None` if the field is not set or
3796    /// holds a different branch.
3797    pub fn mysql_sync_config(
3798        &self,
3799    ) -> std::option::Option<&std::boxed::Box<crate::model::MySqlSyncConfig>> {
3800        #[allow(unreachable_patterns)]
3801        self.sync_config.as_ref().and_then(|v| match v {
3802            crate::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(v) => std::option::Option::Some(v),
3803            _ => std::option::Option::None,
3804        })
3805    }
3806
3807    /// Sets the value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config]
3808    /// to hold a `MysqlSyncConfig`.
3809    ///
3810    /// Note that all the setters affecting `sync_config` are
3811    /// mutually exclusive.
3812    pub fn set_mysql_sync_config<
3813        T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
3814    >(
3815        mut self,
3816        v: T,
3817    ) -> Self {
3818        self.sync_config = std::option::Option::Some(
3819            crate::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(
3820                v.into(),
3821            ),
3822        );
3823        self
3824    }
3825}
3826
3827impl wkt::message::Message for SqlInstancesStartExternalSyncRequest {
3828    fn typename() -> &'static str {
3829        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest"
3830    }
3831}
3832
3833/// Defines additional types related to [SqlInstancesStartExternalSyncRequest].
3834pub mod sql_instances_start_external_sync_request {
3835    #[allow(unused_imports)]
3836    use super::*;
3837
3838    #[derive(Clone, Debug, PartialEq)]
3839    #[non_exhaustive]
3840    pub enum SyncConfig {
3841        /// MySQL-specific settings for start external sync.
3842        MysqlSyncConfig(std::boxed::Box<crate::model::MySqlSyncConfig>),
3843    }
3844}
3845
3846/// Instance reset replica size request.
3847#[derive(Clone, Default, PartialEq)]
3848#[non_exhaustive]
3849pub struct SqlInstancesResetReplicaSizeRequest {
3850    /// Cloud SQL read replica instance name.
3851    pub instance: std::string::String,
3852
3853    /// ID of the project that contains the read replica.
3854    pub project: std::string::String,
3855
3856    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3857}
3858
3859impl SqlInstancesResetReplicaSizeRequest {
3860    pub fn new() -> Self {
3861        std::default::Default::default()
3862    }
3863
3864    /// Sets the value of [instance][crate::model::SqlInstancesResetReplicaSizeRequest::instance].
3865    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3866        self.instance = v.into();
3867        self
3868    }
3869
3870    /// Sets the value of [project][crate::model::SqlInstancesResetReplicaSizeRequest::project].
3871    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3872        self.project = v.into();
3873        self
3874    }
3875}
3876
3877impl wkt::message::Message for SqlInstancesResetReplicaSizeRequest {
3878    fn typename() -> &'static str {
3879        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest"
3880    }
3881}
3882
3883/// Instance create ephemeral certificate request.
3884#[derive(Clone, Default, PartialEq)]
3885#[non_exhaustive]
3886pub struct SqlInstancesCreateEphemeralCertRequest {
3887    /// Cloud SQL instance ID. This does not include the project ID.
3888    pub instance: std::string::String,
3889
3890    /// Project ID of the Cloud SQL project.
3891    pub project: std::string::String,
3892
3893    pub body: std::option::Option<crate::model::SslCertsCreateEphemeralRequest>,
3894
3895    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3896}
3897
3898impl SqlInstancesCreateEphemeralCertRequest {
3899    pub fn new() -> Self {
3900        std::default::Default::default()
3901    }
3902
3903    /// Sets the value of [instance][crate::model::SqlInstancesCreateEphemeralCertRequest::instance].
3904    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3905        self.instance = v.into();
3906        self
3907    }
3908
3909    /// Sets the value of [project][crate::model::SqlInstancesCreateEphemeralCertRequest::project].
3910    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3911        self.project = v.into();
3912        self
3913    }
3914
3915    /// Sets the value of [body][crate::model::SqlInstancesCreateEphemeralCertRequest::body].
3916    pub fn set_body<T>(mut self, v: T) -> Self
3917    where
3918        T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
3919    {
3920        self.body = std::option::Option::Some(v.into());
3921        self
3922    }
3923
3924    /// Sets or clears the value of [body][crate::model::SqlInstancesCreateEphemeralCertRequest::body].
3925    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3926    where
3927        T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
3928    {
3929        self.body = v.map(|x| x.into());
3930        self
3931    }
3932}
3933
3934impl wkt::message::Message for SqlInstancesCreateEphemeralCertRequest {
3935    fn typename() -> &'static str {
3936        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest"
3937    }
3938}
3939
3940/// Database instance clone request.
3941#[derive(Clone, Default, PartialEq)]
3942#[non_exhaustive]
3943pub struct InstancesCloneRequest {
3944    /// Contains details about the clone operation.
3945    pub clone_context: std::option::Option<crate::model::CloneContext>,
3946
3947    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3948}
3949
3950impl InstancesCloneRequest {
3951    pub fn new() -> Self {
3952        std::default::Default::default()
3953    }
3954
3955    /// Sets the value of [clone_context][crate::model::InstancesCloneRequest::clone_context].
3956    pub fn set_clone_context<T>(mut self, v: T) -> Self
3957    where
3958        T: std::convert::Into<crate::model::CloneContext>,
3959    {
3960        self.clone_context = std::option::Option::Some(v.into());
3961        self
3962    }
3963
3964    /// Sets or clears the value of [clone_context][crate::model::InstancesCloneRequest::clone_context].
3965    pub fn set_or_clear_clone_context<T>(mut self, v: std::option::Option<T>) -> Self
3966    where
3967        T: std::convert::Into<crate::model::CloneContext>,
3968    {
3969        self.clone_context = v.map(|x| x.into());
3970        self
3971    }
3972}
3973
3974impl wkt::message::Message for InstancesCloneRequest {
3975    fn typename() -> &'static str {
3976        "type.googleapis.com/google.cloud.sql.v1.InstancesCloneRequest"
3977    }
3978}
3979
3980/// Database demote primary instance request.
3981#[derive(Clone, Default, PartialEq)]
3982#[non_exhaustive]
3983pub struct InstancesDemoteMasterRequest {
3984    /// Contains details about the demoteMaster operation.
3985    pub demote_master_context: std::option::Option<crate::model::DemoteMasterContext>,
3986
3987    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3988}
3989
3990impl InstancesDemoteMasterRequest {
3991    pub fn new() -> Self {
3992        std::default::Default::default()
3993    }
3994
3995    /// Sets the value of [demote_master_context][crate::model::InstancesDemoteMasterRequest::demote_master_context].
3996    pub fn set_demote_master_context<T>(mut self, v: T) -> Self
3997    where
3998        T: std::convert::Into<crate::model::DemoteMasterContext>,
3999    {
4000        self.demote_master_context = std::option::Option::Some(v.into());
4001        self
4002    }
4003
4004    /// Sets or clears the value of [demote_master_context][crate::model::InstancesDemoteMasterRequest::demote_master_context].
4005    pub fn set_or_clear_demote_master_context<T>(mut self, v: std::option::Option<T>) -> Self
4006    where
4007        T: std::convert::Into<crate::model::DemoteMasterContext>,
4008    {
4009        self.demote_master_context = v.map(|x| x.into());
4010        self
4011    }
4012}
4013
4014impl wkt::message::Message for InstancesDemoteMasterRequest {
4015    fn typename() -> &'static str {
4016        "type.googleapis.com/google.cloud.sql.v1.InstancesDemoteMasterRequest"
4017    }
4018}
4019
4020/// This request is used to demote an existing standalone instance to be a
4021/// Cloud SQL read replica for an external database server.
4022#[derive(Clone, Default, PartialEq)]
4023#[non_exhaustive]
4024pub struct InstancesDemoteRequest {
4025    /// Required. Contains details about the demote operation.
4026    pub demote_context: std::option::Option<crate::model::DemoteContext>,
4027
4028    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4029}
4030
4031impl InstancesDemoteRequest {
4032    pub fn new() -> Self {
4033        std::default::Default::default()
4034    }
4035
4036    /// Sets the value of [demote_context][crate::model::InstancesDemoteRequest::demote_context].
4037    pub fn set_demote_context<T>(mut self, v: T) -> Self
4038    where
4039        T: std::convert::Into<crate::model::DemoteContext>,
4040    {
4041        self.demote_context = std::option::Option::Some(v.into());
4042        self
4043    }
4044
4045    /// Sets or clears the value of [demote_context][crate::model::InstancesDemoteRequest::demote_context].
4046    pub fn set_or_clear_demote_context<T>(mut self, v: std::option::Option<T>) -> Self
4047    where
4048        T: std::convert::Into<crate::model::DemoteContext>,
4049    {
4050        self.demote_context = v.map(|x| x.into());
4051        self
4052    }
4053}
4054
4055impl wkt::message::Message for InstancesDemoteRequest {
4056    fn typename() -> &'static str {
4057        "type.googleapis.com/google.cloud.sql.v1.InstancesDemoteRequest"
4058    }
4059}
4060
4061/// Database instance export request.
4062#[derive(Clone, Default, PartialEq)]
4063#[non_exhaustive]
4064pub struct InstancesExportRequest {
4065    /// Contains details about the export operation.
4066    pub export_context: std::option::Option<crate::model::ExportContext>,
4067
4068    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4069}
4070
4071impl InstancesExportRequest {
4072    pub fn new() -> Self {
4073        std::default::Default::default()
4074    }
4075
4076    /// Sets the value of [export_context][crate::model::InstancesExportRequest::export_context].
4077    pub fn set_export_context<T>(mut self, v: T) -> Self
4078    where
4079        T: std::convert::Into<crate::model::ExportContext>,
4080    {
4081        self.export_context = std::option::Option::Some(v.into());
4082        self
4083    }
4084
4085    /// Sets or clears the value of [export_context][crate::model::InstancesExportRequest::export_context].
4086    pub fn set_or_clear_export_context<T>(mut self, v: std::option::Option<T>) -> Self
4087    where
4088        T: std::convert::Into<crate::model::ExportContext>,
4089    {
4090        self.export_context = v.map(|x| x.into());
4091        self
4092    }
4093}
4094
4095impl wkt::message::Message for InstancesExportRequest {
4096    fn typename() -> &'static str {
4097        "type.googleapis.com/google.cloud.sql.v1.InstancesExportRequest"
4098    }
4099}
4100
4101/// Instance failover request.
4102#[derive(Clone, Default, PartialEq)]
4103#[non_exhaustive]
4104pub struct InstancesFailoverRequest {
4105    /// Failover Context.
4106    pub failover_context: std::option::Option<crate::model::FailoverContext>,
4107
4108    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4109}
4110
4111impl InstancesFailoverRequest {
4112    pub fn new() -> Self {
4113        std::default::Default::default()
4114    }
4115
4116    /// Sets the value of [failover_context][crate::model::InstancesFailoverRequest::failover_context].
4117    pub fn set_failover_context<T>(mut self, v: T) -> Self
4118    where
4119        T: std::convert::Into<crate::model::FailoverContext>,
4120    {
4121        self.failover_context = std::option::Option::Some(v.into());
4122        self
4123    }
4124
4125    /// Sets or clears the value of [failover_context][crate::model::InstancesFailoverRequest::failover_context].
4126    pub fn set_or_clear_failover_context<T>(mut self, v: std::option::Option<T>) -> Self
4127    where
4128        T: std::convert::Into<crate::model::FailoverContext>,
4129    {
4130        self.failover_context = v.map(|x| x.into());
4131        self
4132    }
4133}
4134
4135impl wkt::message::Message for InstancesFailoverRequest {
4136    fn typename() -> &'static str {
4137        "type.googleapis.com/google.cloud.sql.v1.InstancesFailoverRequest"
4138    }
4139}
4140
4141/// SslCerts create ephemeral certificate request.
4142#[derive(Clone, Default, PartialEq)]
4143#[non_exhaustive]
4144pub struct SslCertsCreateEphemeralRequest {
4145    /// PEM encoded public key to include in the signed certificate.
4146    pub public_key: std::string::String,
4147
4148    /// Access token to include in the signed certificate.
4149    pub access_token: std::string::String,
4150
4151    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4152}
4153
4154impl SslCertsCreateEphemeralRequest {
4155    pub fn new() -> Self {
4156        std::default::Default::default()
4157    }
4158
4159    /// Sets the value of [public_key][crate::model::SslCertsCreateEphemeralRequest::public_key].
4160    pub fn set_public_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4161        self.public_key = v.into();
4162        self
4163    }
4164
4165    /// Sets the value of [access_token][crate::model::SslCertsCreateEphemeralRequest::access_token].
4166    pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4167        self.access_token = v.into();
4168        self
4169    }
4170}
4171
4172impl wkt::message::Message for SslCertsCreateEphemeralRequest {
4173    fn typename() -> &'static str {
4174        "type.googleapis.com/google.cloud.sql.v1.SslCertsCreateEphemeralRequest"
4175    }
4176}
4177
4178/// Database instance import request.
4179#[derive(Clone, Default, PartialEq)]
4180#[non_exhaustive]
4181pub struct InstancesImportRequest {
4182    /// Contains details about the import operation.
4183    pub import_context: std::option::Option<crate::model::ImportContext>,
4184
4185    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4186}
4187
4188impl InstancesImportRequest {
4189    pub fn new() -> Self {
4190        std::default::Default::default()
4191    }
4192
4193    /// Sets the value of [import_context][crate::model::InstancesImportRequest::import_context].
4194    pub fn set_import_context<T>(mut self, v: T) -> Self
4195    where
4196        T: std::convert::Into<crate::model::ImportContext>,
4197    {
4198        self.import_context = std::option::Option::Some(v.into());
4199        self
4200    }
4201
4202    /// Sets or clears the value of [import_context][crate::model::InstancesImportRequest::import_context].
4203    pub fn set_or_clear_import_context<T>(mut self, v: std::option::Option<T>) -> Self
4204    where
4205        T: std::convert::Into<crate::model::ImportContext>,
4206    {
4207        self.import_context = v.map(|x| x.into());
4208        self
4209    }
4210}
4211
4212impl wkt::message::Message for InstancesImportRequest {
4213    fn typename() -> &'static str {
4214        "type.googleapis.com/google.cloud.sql.v1.InstancesImportRequest"
4215    }
4216}
4217
4218/// Database instances list response.
4219#[derive(Clone, Default, PartialEq)]
4220#[non_exhaustive]
4221pub struct InstancesListResponse {
4222    /// This is always `sql#instancesList`.
4223    pub kind: std::string::String,
4224
4225    /// List of warnings that occurred while handling the request.
4226    pub warnings: std::vec::Vec<crate::model::ApiWarning>,
4227
4228    /// List of database instance resources.
4229    pub items: std::vec::Vec<crate::model::DatabaseInstance>,
4230
4231    /// The continuation token, used to page through large result sets. Provide
4232    /// this value in a subsequent request to return the next page of results.
4233    pub next_page_token: std::string::String,
4234
4235    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4236}
4237
4238impl InstancesListResponse {
4239    pub fn new() -> Self {
4240        std::default::Default::default()
4241    }
4242
4243    /// Sets the value of [kind][crate::model::InstancesListResponse::kind].
4244    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4245        self.kind = v.into();
4246        self
4247    }
4248
4249    /// Sets the value of [warnings][crate::model::InstancesListResponse::warnings].
4250    pub fn set_warnings<T, V>(mut self, v: T) -> Self
4251    where
4252        T: std::iter::IntoIterator<Item = V>,
4253        V: std::convert::Into<crate::model::ApiWarning>,
4254    {
4255        use std::iter::Iterator;
4256        self.warnings = v.into_iter().map(|i| i.into()).collect();
4257        self
4258    }
4259
4260    /// Sets the value of [items][crate::model::InstancesListResponse::items].
4261    pub fn set_items<T, V>(mut self, v: T) -> Self
4262    where
4263        T: std::iter::IntoIterator<Item = V>,
4264        V: std::convert::Into<crate::model::DatabaseInstance>,
4265    {
4266        use std::iter::Iterator;
4267        self.items = v.into_iter().map(|i| i.into()).collect();
4268        self
4269    }
4270
4271    /// Sets the value of [next_page_token][crate::model::InstancesListResponse::next_page_token].
4272    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4273        self.next_page_token = v.into();
4274        self
4275    }
4276}
4277
4278impl wkt::message::Message for InstancesListResponse {
4279    fn typename() -> &'static str {
4280        "type.googleapis.com/google.cloud.sql.v1.InstancesListResponse"
4281    }
4282}
4283
4284#[doc(hidden)]
4285impl gax::paginator::internal::PageableResponse for InstancesListResponse {
4286    type PageItem = crate::model::DatabaseInstance;
4287
4288    fn items(self) -> std::vec::Vec<Self::PageItem> {
4289        self.items
4290    }
4291
4292    fn next_page_token(&self) -> std::string::String {
4293        use std::clone::Clone;
4294        self.next_page_token.clone()
4295    }
4296}
4297
4298/// Instances ListServerCas response.
4299#[derive(Clone, Default, PartialEq)]
4300#[non_exhaustive]
4301pub struct InstancesListServerCasResponse {
4302    /// List of server CA certificates for the instance.
4303    pub certs: std::vec::Vec<crate::model::SslCert>,
4304
4305    pub active_version: std::string::String,
4306
4307    /// This is always `sql#instancesListServerCas`.
4308    pub kind: std::string::String,
4309
4310    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4311}
4312
4313impl InstancesListServerCasResponse {
4314    pub fn new() -> Self {
4315        std::default::Default::default()
4316    }
4317
4318    /// Sets the value of [certs][crate::model::InstancesListServerCasResponse::certs].
4319    pub fn set_certs<T, V>(mut self, v: T) -> Self
4320    where
4321        T: std::iter::IntoIterator<Item = V>,
4322        V: std::convert::Into<crate::model::SslCert>,
4323    {
4324        use std::iter::Iterator;
4325        self.certs = v.into_iter().map(|i| i.into()).collect();
4326        self
4327    }
4328
4329    /// Sets the value of [active_version][crate::model::InstancesListServerCasResponse::active_version].
4330    pub fn set_active_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4331        self.active_version = v.into();
4332        self
4333    }
4334
4335    /// Sets the value of [kind][crate::model::InstancesListServerCasResponse::kind].
4336    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4337        self.kind = v.into();
4338        self
4339    }
4340}
4341
4342impl wkt::message::Message for InstancesListServerCasResponse {
4343    fn typename() -> &'static str {
4344        "type.googleapis.com/google.cloud.sql.v1.InstancesListServerCasResponse"
4345    }
4346}
4347
4348/// Database instance restore backup request.
4349#[derive(Clone, Default, PartialEq)]
4350#[non_exhaustive]
4351pub struct InstancesRestoreBackupRequest {
4352    /// Parameters required to perform the restore backup operation.
4353    pub restore_backup_context: std::option::Option<crate::model::RestoreBackupContext>,
4354
4355    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4356}
4357
4358impl InstancesRestoreBackupRequest {
4359    pub fn new() -> Self {
4360        std::default::Default::default()
4361    }
4362
4363    /// Sets the value of [restore_backup_context][crate::model::InstancesRestoreBackupRequest::restore_backup_context].
4364    pub fn set_restore_backup_context<T>(mut self, v: T) -> Self
4365    where
4366        T: std::convert::Into<crate::model::RestoreBackupContext>,
4367    {
4368        self.restore_backup_context = std::option::Option::Some(v.into());
4369        self
4370    }
4371
4372    /// Sets or clears the value of [restore_backup_context][crate::model::InstancesRestoreBackupRequest::restore_backup_context].
4373    pub fn set_or_clear_restore_backup_context<T>(mut self, v: std::option::Option<T>) -> Self
4374    where
4375        T: std::convert::Into<crate::model::RestoreBackupContext>,
4376    {
4377        self.restore_backup_context = v.map(|x| x.into());
4378        self
4379    }
4380}
4381
4382impl wkt::message::Message for InstancesRestoreBackupRequest {
4383    fn typename() -> &'static str {
4384        "type.googleapis.com/google.cloud.sql.v1.InstancesRestoreBackupRequest"
4385    }
4386}
4387
4388/// Rotate server CA request.
4389#[derive(Clone, Default, PartialEq)]
4390#[non_exhaustive]
4391pub struct InstancesRotateServerCaRequest {
4392    /// Contains details about the rotate server CA operation.
4393    pub rotate_server_ca_context: std::option::Option<crate::model::RotateServerCaContext>,
4394
4395    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4396}
4397
4398impl InstancesRotateServerCaRequest {
4399    pub fn new() -> Self {
4400        std::default::Default::default()
4401    }
4402
4403    /// Sets the value of [rotate_server_ca_context][crate::model::InstancesRotateServerCaRequest::rotate_server_ca_context].
4404    pub fn set_rotate_server_ca_context<T>(mut self, v: T) -> Self
4405    where
4406        T: std::convert::Into<crate::model::RotateServerCaContext>,
4407    {
4408        self.rotate_server_ca_context = std::option::Option::Some(v.into());
4409        self
4410    }
4411
4412    /// Sets or clears the value of [rotate_server_ca_context][crate::model::InstancesRotateServerCaRequest::rotate_server_ca_context].
4413    pub fn set_or_clear_rotate_server_ca_context<T>(mut self, v: std::option::Option<T>) -> Self
4414    where
4415        T: std::convert::Into<crate::model::RotateServerCaContext>,
4416    {
4417        self.rotate_server_ca_context = v.map(|x| x.into());
4418        self
4419    }
4420}
4421
4422impl wkt::message::Message for InstancesRotateServerCaRequest {
4423    fn typename() -> &'static str {
4424        "type.googleapis.com/google.cloud.sql.v1.InstancesRotateServerCaRequest"
4425    }
4426}
4427
4428/// Instance truncate log request.
4429#[derive(Clone, Default, PartialEq)]
4430#[non_exhaustive]
4431pub struct InstancesTruncateLogRequest {
4432    /// Contains details about the truncate log operation.
4433    pub truncate_log_context: std::option::Option<crate::model::TruncateLogContext>,
4434
4435    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4436}
4437
4438impl InstancesTruncateLogRequest {
4439    pub fn new() -> Self {
4440        std::default::Default::default()
4441    }
4442
4443    /// Sets the value of [truncate_log_context][crate::model::InstancesTruncateLogRequest::truncate_log_context].
4444    pub fn set_truncate_log_context<T>(mut self, v: T) -> Self
4445    where
4446        T: std::convert::Into<crate::model::TruncateLogContext>,
4447    {
4448        self.truncate_log_context = std::option::Option::Some(v.into());
4449        self
4450    }
4451
4452    /// Sets or clears the value of [truncate_log_context][crate::model::InstancesTruncateLogRequest::truncate_log_context].
4453    pub fn set_or_clear_truncate_log_context<T>(mut self, v: std::option::Option<T>) -> Self
4454    where
4455        T: std::convert::Into<crate::model::TruncateLogContext>,
4456    {
4457        self.truncate_log_context = v.map(|x| x.into());
4458        self
4459    }
4460}
4461
4462impl wkt::message::Message for InstancesTruncateLogRequest {
4463    fn typename() -> &'static str {
4464        "type.googleapis.com/google.cloud.sql.v1.InstancesTruncateLogRequest"
4465    }
4466}
4467
4468/// Request to acquire a lease for SSRS.
4469#[derive(Clone, Default, PartialEq)]
4470#[non_exhaustive]
4471pub struct InstancesAcquireSsrsLeaseRequest {
4472    /// Contains details about the acquire SSRS lease operation.
4473    pub acquire_ssrs_lease_context: std::option::Option<crate::model::AcquireSsrsLeaseContext>,
4474
4475    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4476}
4477
4478impl InstancesAcquireSsrsLeaseRequest {
4479    pub fn new() -> Self {
4480        std::default::Default::default()
4481    }
4482
4483    /// Sets the value of [acquire_ssrs_lease_context][crate::model::InstancesAcquireSsrsLeaseRequest::acquire_ssrs_lease_context].
4484    pub fn set_acquire_ssrs_lease_context<T>(mut self, v: T) -> Self
4485    where
4486        T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
4487    {
4488        self.acquire_ssrs_lease_context = std::option::Option::Some(v.into());
4489        self
4490    }
4491
4492    /// Sets or clears the value of [acquire_ssrs_lease_context][crate::model::InstancesAcquireSsrsLeaseRequest::acquire_ssrs_lease_context].
4493    pub fn set_or_clear_acquire_ssrs_lease_context<T>(mut self, v: std::option::Option<T>) -> Self
4494    where
4495        T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
4496    {
4497        self.acquire_ssrs_lease_context = v.map(|x| x.into());
4498        self
4499    }
4500}
4501
4502impl wkt::message::Message for InstancesAcquireSsrsLeaseRequest {
4503    fn typename() -> &'static str {
4504        "type.googleapis.com/google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest"
4505    }
4506}
4507
4508/// Instance verify external sync settings response.
4509#[derive(Clone, Default, PartialEq)]
4510#[non_exhaustive]
4511pub struct SqlInstancesVerifyExternalSyncSettingsResponse {
4512    /// This is always `sql#migrationSettingErrorList`.
4513    pub kind: std::string::String,
4514
4515    /// List of migration violations.
4516    pub errors: std::vec::Vec<crate::model::SqlExternalSyncSettingError>,
4517
4518    /// List of migration warnings.
4519    pub warnings: std::vec::Vec<crate::model::SqlExternalSyncSettingError>,
4520
4521    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4522}
4523
4524impl SqlInstancesVerifyExternalSyncSettingsResponse {
4525    pub fn new() -> Self {
4526        std::default::Default::default()
4527    }
4528
4529    /// Sets the value of [kind][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::kind].
4530    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4531        self.kind = v.into();
4532        self
4533    }
4534
4535    /// Sets the value of [errors][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::errors].
4536    pub fn set_errors<T, V>(mut self, v: T) -> Self
4537    where
4538        T: std::iter::IntoIterator<Item = V>,
4539        V: std::convert::Into<crate::model::SqlExternalSyncSettingError>,
4540    {
4541        use std::iter::Iterator;
4542        self.errors = v.into_iter().map(|i| i.into()).collect();
4543        self
4544    }
4545
4546    /// Sets the value of [warnings][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::warnings].
4547    pub fn set_warnings<T, V>(mut self, v: T) -> Self
4548    where
4549        T: std::iter::IntoIterator<Item = V>,
4550        V: std::convert::Into<crate::model::SqlExternalSyncSettingError>,
4551    {
4552        use std::iter::Iterator;
4553        self.warnings = v.into_iter().map(|i| i.into()).collect();
4554        self
4555    }
4556}
4557
4558impl wkt::message::Message for SqlInstancesVerifyExternalSyncSettingsResponse {
4559    fn typename() -> &'static str {
4560        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse"
4561    }
4562}
4563
4564/// Instance get disk shrink config response.
4565#[derive(Clone, Default, PartialEq)]
4566#[non_exhaustive]
4567pub struct SqlInstancesGetDiskShrinkConfigResponse {
4568    /// This is always `sql#getDiskShrinkConfig`.
4569    pub kind: std::string::String,
4570
4571    /// The minimum size to which a disk can be shrunk in GigaBytes.
4572    pub minimal_target_size_gb: i64,
4573
4574    /// Additional message to customers.
4575    pub message: std::string::String,
4576
4577    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4578}
4579
4580impl SqlInstancesGetDiskShrinkConfigResponse {
4581    pub fn new() -> Self {
4582        std::default::Default::default()
4583    }
4584
4585    /// Sets the value of [kind][crate::model::SqlInstancesGetDiskShrinkConfigResponse::kind].
4586    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4587        self.kind = v.into();
4588        self
4589    }
4590
4591    /// Sets the value of [minimal_target_size_gb][crate::model::SqlInstancesGetDiskShrinkConfigResponse::minimal_target_size_gb].
4592    pub fn set_minimal_target_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4593        self.minimal_target_size_gb = v.into();
4594        self
4595    }
4596
4597    /// Sets the value of [message][crate::model::SqlInstancesGetDiskShrinkConfigResponse::message].
4598    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4599        self.message = v.into();
4600        self
4601    }
4602}
4603
4604impl wkt::message::Message for SqlInstancesGetDiskShrinkConfigResponse {
4605    fn typename() -> &'static str {
4606        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse"
4607    }
4608}
4609
4610/// Instance get latest recovery time request.
4611#[derive(Clone, Default, PartialEq)]
4612#[non_exhaustive]
4613pub struct SqlInstancesGetLatestRecoveryTimeRequest {
4614    /// Cloud SQL instance ID. This does not include the project ID.
4615    pub instance: std::string::String,
4616
4617    /// Project ID of the project that contains the instance.
4618    pub project: std::string::String,
4619
4620    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4621}
4622
4623impl SqlInstancesGetLatestRecoveryTimeRequest {
4624    pub fn new() -> Self {
4625        std::default::Default::default()
4626    }
4627
4628    /// Sets the value of [instance][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::instance].
4629    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4630        self.instance = v.into();
4631        self
4632    }
4633
4634    /// Sets the value of [project][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::project].
4635    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4636        self.project = v.into();
4637        self
4638    }
4639}
4640
4641impl wkt::message::Message for SqlInstancesGetLatestRecoveryTimeRequest {
4642    fn typename() -> &'static str {
4643        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest"
4644    }
4645}
4646
4647/// Instance get latest recovery time response.
4648#[derive(Clone, Default, PartialEq)]
4649#[non_exhaustive]
4650pub struct SqlInstancesGetLatestRecoveryTimeResponse {
4651    /// This is always `sql#getLatestRecoveryTime`.
4652    pub kind: std::string::String,
4653
4654    /// Timestamp, identifies the latest recovery time of the source instance.
4655    pub latest_recovery_time: std::option::Option<wkt::Timestamp>,
4656
4657    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4658}
4659
4660impl SqlInstancesGetLatestRecoveryTimeResponse {
4661    pub fn new() -> Self {
4662        std::default::Default::default()
4663    }
4664
4665    /// Sets the value of [kind][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::kind].
4666    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4667        self.kind = v.into();
4668        self
4669    }
4670
4671    /// Sets the value of [latest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::latest_recovery_time].
4672    pub fn set_latest_recovery_time<T>(mut self, v: T) -> Self
4673    where
4674        T: std::convert::Into<wkt::Timestamp>,
4675    {
4676        self.latest_recovery_time = std::option::Option::Some(v.into());
4677        self
4678    }
4679
4680    /// Sets or clears the value of [latest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::latest_recovery_time].
4681    pub fn set_or_clear_latest_recovery_time<T>(mut self, v: std::option::Option<T>) -> Self
4682    where
4683        T: std::convert::Into<wkt::Timestamp>,
4684    {
4685        self.latest_recovery_time = v.map(|x| x.into());
4686        self
4687    }
4688}
4689
4690impl wkt::message::Message for SqlInstancesGetLatestRecoveryTimeResponse {
4691    fn typename() -> &'static str {
4692        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse"
4693    }
4694}
4695
4696/// Database instance clone context.
4697#[derive(Clone, Default, PartialEq)]
4698#[non_exhaustive]
4699pub struct CloneContext {
4700    /// This is always `sql#cloneContext`.
4701    pub kind: std::string::String,
4702
4703    /// Reserved for future use.
4704    pub pitr_timestamp_ms: i64,
4705
4706    /// Name of the Cloud SQL instance to be created as a clone.
4707    pub destination_instance_name: std::string::String,
4708
4709    /// Binary log coordinates, if specified, identify the position up to which the
4710    /// source instance is cloned. If not specified, the source instance is
4711    /// cloned up to the most recent binary log coordinates.
4712    pub bin_log_coordinates: std::option::Option<crate::model::BinLogCoordinates>,
4713
4714    /// Timestamp, if specified, identifies the time to which the source instance
4715    /// is cloned.
4716    pub point_in_time: std::option::Option<wkt::Timestamp>,
4717
4718    /// The name of the allocated ip range for the private ip Cloud SQL instance.
4719    /// For example: "google-managed-services-default". If set, the cloned instance
4720    /// ip will be created in the allocated range. The range name must comply with
4721    /// [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
4722    /// must be 1-63 characters long and match the regular expression
4723    /// [a-z]([-a-z0-9]*[a-z0-9])?.
4724    /// Reserved for future use.
4725    pub allocated_ip_range: std::string::String,
4726
4727    /// (SQL Server only) Clone only the specified databases from the source
4728    /// instance. Clone all databases if empty.
4729    pub database_names: std::vec::Vec<std::string::String>,
4730
4731    /// Optional. Copy clone and point-in-time recovery clone of an instance to the
4732    /// specified zone. If no zone is specified, clone to the same primary zone as
4733    /// the source instance. This field applies to all DB types.
4734    pub preferred_zone: std::option::Option<std::string::String>,
4735
4736    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4737}
4738
4739impl CloneContext {
4740    pub fn new() -> Self {
4741        std::default::Default::default()
4742    }
4743
4744    /// Sets the value of [kind][crate::model::CloneContext::kind].
4745    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4746        self.kind = v.into();
4747        self
4748    }
4749
4750    /// Sets the value of [pitr_timestamp_ms][crate::model::CloneContext::pitr_timestamp_ms].
4751    pub fn set_pitr_timestamp_ms<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4752        self.pitr_timestamp_ms = v.into();
4753        self
4754    }
4755
4756    /// Sets the value of [destination_instance_name][crate::model::CloneContext::destination_instance_name].
4757    pub fn set_destination_instance_name<T: std::convert::Into<std::string::String>>(
4758        mut self,
4759        v: T,
4760    ) -> Self {
4761        self.destination_instance_name = v.into();
4762        self
4763    }
4764
4765    /// Sets the value of [bin_log_coordinates][crate::model::CloneContext::bin_log_coordinates].
4766    pub fn set_bin_log_coordinates<T>(mut self, v: T) -> Self
4767    where
4768        T: std::convert::Into<crate::model::BinLogCoordinates>,
4769    {
4770        self.bin_log_coordinates = std::option::Option::Some(v.into());
4771        self
4772    }
4773
4774    /// Sets or clears the value of [bin_log_coordinates][crate::model::CloneContext::bin_log_coordinates].
4775    pub fn set_or_clear_bin_log_coordinates<T>(mut self, v: std::option::Option<T>) -> Self
4776    where
4777        T: std::convert::Into<crate::model::BinLogCoordinates>,
4778    {
4779        self.bin_log_coordinates = v.map(|x| x.into());
4780        self
4781    }
4782
4783    /// Sets the value of [point_in_time][crate::model::CloneContext::point_in_time].
4784    pub fn set_point_in_time<T>(mut self, v: T) -> Self
4785    where
4786        T: std::convert::Into<wkt::Timestamp>,
4787    {
4788        self.point_in_time = std::option::Option::Some(v.into());
4789        self
4790    }
4791
4792    /// Sets or clears the value of [point_in_time][crate::model::CloneContext::point_in_time].
4793    pub fn set_or_clear_point_in_time<T>(mut self, v: std::option::Option<T>) -> Self
4794    where
4795        T: std::convert::Into<wkt::Timestamp>,
4796    {
4797        self.point_in_time = v.map(|x| x.into());
4798        self
4799    }
4800
4801    /// Sets the value of [allocated_ip_range][crate::model::CloneContext::allocated_ip_range].
4802    pub fn set_allocated_ip_range<T: std::convert::Into<std::string::String>>(
4803        mut self,
4804        v: T,
4805    ) -> Self {
4806        self.allocated_ip_range = v.into();
4807        self
4808    }
4809
4810    /// Sets the value of [database_names][crate::model::CloneContext::database_names].
4811    pub fn set_database_names<T, V>(mut self, v: T) -> Self
4812    where
4813        T: std::iter::IntoIterator<Item = V>,
4814        V: std::convert::Into<std::string::String>,
4815    {
4816        use std::iter::Iterator;
4817        self.database_names = v.into_iter().map(|i| i.into()).collect();
4818        self
4819    }
4820
4821    /// Sets the value of [preferred_zone][crate::model::CloneContext::preferred_zone].
4822    pub fn set_preferred_zone<T>(mut self, v: T) -> Self
4823    where
4824        T: std::convert::Into<std::string::String>,
4825    {
4826        self.preferred_zone = std::option::Option::Some(v.into());
4827        self
4828    }
4829
4830    /// Sets or clears the value of [preferred_zone][crate::model::CloneContext::preferred_zone].
4831    pub fn set_or_clear_preferred_zone<T>(mut self, v: std::option::Option<T>) -> Self
4832    where
4833        T: std::convert::Into<std::string::String>,
4834    {
4835        self.preferred_zone = v.map(|x| x.into());
4836        self
4837    }
4838}
4839
4840impl wkt::message::Message for CloneContext {
4841    fn typename() -> &'static str {
4842        "type.googleapis.com/google.cloud.sql.v1.CloneContext"
4843    }
4844}
4845
4846/// Binary log coordinates.
4847#[derive(Clone, Default, PartialEq)]
4848#[non_exhaustive]
4849pub struct BinLogCoordinates {
4850    /// Name of the binary log file for a Cloud SQL instance.
4851    pub bin_log_file_name: std::string::String,
4852
4853    /// Position (offset) within the binary log file.
4854    pub bin_log_position: i64,
4855
4856    /// This is always `sql#binLogCoordinates`.
4857    pub kind: std::string::String,
4858
4859    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4860}
4861
4862impl BinLogCoordinates {
4863    pub fn new() -> Self {
4864        std::default::Default::default()
4865    }
4866
4867    /// Sets the value of [bin_log_file_name][crate::model::BinLogCoordinates::bin_log_file_name].
4868    pub fn set_bin_log_file_name<T: std::convert::Into<std::string::String>>(
4869        mut self,
4870        v: T,
4871    ) -> Self {
4872        self.bin_log_file_name = v.into();
4873        self
4874    }
4875
4876    /// Sets the value of [bin_log_position][crate::model::BinLogCoordinates::bin_log_position].
4877    pub fn set_bin_log_position<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4878        self.bin_log_position = v.into();
4879        self
4880    }
4881
4882    /// Sets the value of [kind][crate::model::BinLogCoordinates::kind].
4883    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4884        self.kind = v.into();
4885        self
4886    }
4887}
4888
4889impl wkt::message::Message for BinLogCoordinates {
4890    fn typename() -> &'static str {
4891        "type.googleapis.com/google.cloud.sql.v1.BinLogCoordinates"
4892    }
4893}
4894
4895/// A Cloud SQL instance resource.
4896#[derive(Clone, Default, PartialEq)]
4897#[non_exhaustive]
4898pub struct DatabaseInstance {
4899    /// This is always `sql#instance`.
4900    pub kind: std::string::String,
4901
4902    /// The current serving state of the Cloud SQL instance.
4903    pub state: crate::model::database_instance::SqlInstanceState,
4904
4905    /// The database engine type and version. The `databaseVersion` field cannot
4906    /// be changed after instance creation.
4907    pub database_version: crate::model::SqlDatabaseVersion,
4908
4909    /// The user settings.
4910    pub settings: std::option::Option<crate::model::Settings>,
4911
4912    /// This field is deprecated and will be removed from a future version of the
4913    /// API. Use the `settings.settingsVersion` field instead.
4914    pub etag: std::string::String,
4915
4916    /// The name and status of the failover replica.
4917    pub failover_replica: std::option::Option<crate::model::database_instance::SqlFailoverReplica>,
4918
4919    /// The name of the instance which will act as primary in the replication
4920    /// setup.
4921    pub master_instance_name: std::string::String,
4922
4923    /// The replicas of the instance.
4924    pub replica_names: std::vec::Vec<std::string::String>,
4925
4926    /// The maximum disk size of the instance in bytes.
4927    #[deprecated]
4928    pub max_disk_size: std::option::Option<wkt::Int64Value>,
4929
4930    /// The current disk usage of the instance in bytes. This property has been
4931    /// deprecated. Use the
4932    /// "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
4933    /// Monitoring API instead. Please see [this
4934    /// announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
4935    /// for details.
4936    #[deprecated]
4937    pub current_disk_size: std::option::Option<wkt::Int64Value>,
4938
4939    /// The assigned IP addresses for the instance.
4940    pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
4941
4942    /// SSL configuration.
4943    pub server_ca_cert: std::option::Option<crate::model::SslCert>,
4944
4945    /// The instance type.
4946    pub instance_type: crate::model::SqlInstanceType,
4947
4948    /// The project ID of the project containing the Cloud SQL instance. The Google
4949    /// apps domain is prefixed if applicable.
4950    pub project: std::string::String,
4951
4952    /// The IPv6 address assigned to the instance.
4953    /// (Deprecated) This property was applicable only
4954    /// to First Generation instances.
4955    #[deprecated]
4956    pub ipv6_address: std::string::String,
4957
4958    /// The service account email address assigned to the instance.\This
4959    /// property is read-only.
4960    pub service_account_email_address: std::string::String,
4961
4962    /// Configuration specific to on-premises instances.
4963    pub on_premises_configuration: std::option::Option<crate::model::OnPremisesConfiguration>,
4964
4965    /// Configuration specific to failover replicas and read replicas.
4966    pub replica_configuration: std::option::Option<crate::model::ReplicaConfiguration>,
4967
4968    /// The backend type.
4969    /// `SECOND_GEN`: Cloud SQL database instance.
4970    /// `EXTERNAL`: A database server that is not managed by Google.
4971    ///
4972    /// This property is read-only; use the `tier` property in the `settings`
4973    /// object to determine the database type.
4974    pub backend_type: crate::model::SqlBackendType,
4975
4976    /// The URI of this resource.
4977    pub self_link: std::string::String,
4978
4979    /// If the instance state is SUSPENDED, the reason for the suspension.
4980    pub suspension_reason: std::vec::Vec<crate::model::SqlSuspensionReason>,
4981
4982    /// Connection name of the Cloud SQL instance used in connection strings.
4983    pub connection_name: std::string::String,
4984
4985    /// Name of the Cloud SQL instance. This does not include the project ID.
4986    pub name: std::string::String,
4987
4988    /// The geographical region of the Cloud SQL instance.
4989    ///
4990    /// It can be one of the
4991    /// [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r)
4992    /// where Cloud SQL operates:
4993    ///
4994    /// For example,  `asia-east1`, `europe-west1`, and  `us-central1`.
4995    /// The default value is `us-central1`.
4996    pub region: std::string::String,
4997
4998    /// The Compute Engine zone that the instance is currently serving from. This
4999    /// value could be different from the zone that was specified when the instance
5000    /// was created if the instance has failed over to its secondary zone. WARNING:
5001    /// Changing this might restart the instance.
5002    pub gce_zone: std::string::String,
5003
5004    /// The Compute Engine zone that the failover instance is currently serving
5005    /// from for a regional instance. This value could be different
5006    /// from the zone that was specified when the instance
5007    /// was created if the instance has failed over to its secondary/failover zone.
5008    pub secondary_gce_zone: std::string::String,
5009
5010    /// Disk encryption configuration specific to an instance.
5011    pub disk_encryption_configuration:
5012        std::option::Option<crate::model::DiskEncryptionConfiguration>,
5013
5014    /// Disk encryption status specific to an instance.
5015    pub disk_encryption_status: std::option::Option<crate::model::DiskEncryptionStatus>,
5016
5017    /// Initial root password. Use only on creation. You must set root passwords
5018    /// before you can connect to PostgreSQL instances.
5019    pub root_password: std::string::String,
5020
5021    /// The start time of any upcoming scheduled maintenance for this instance.
5022    pub scheduled_maintenance:
5023        std::option::Option<crate::model::database_instance::SqlScheduledMaintenance>,
5024
5025    /// This status indicates whether the instance satisfies PZS.
5026    ///
5027    /// The status is reserved for future use.
5028    pub satisfies_pzs: std::option::Option<wkt::BoolValue>,
5029
5030    /// Output only. Stores the current database version running on the instance
5031    /// including minor version such as `MYSQL_8_0_18`.
5032    pub database_installed_version: std::string::String,
5033
5034    /// This field represents the report generated by the proactive database
5035    /// wellness job for OutOfDisk issues.
5036    ///
5037    /// * Writers:
5038    /// * the proactive database wellness job for OOD.
5039    /// * Readers:
5040    /// * the proactive database wellness job
5041    pub out_of_disk_report:
5042        std::option::Option<crate::model::database_instance::SqlOutOfDiskReport>,
5043
5044    /// Output only. The time when the instance was created in
5045    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
5046    /// `2012-11-15T16:19:00.094Z`.
5047    pub create_time: std::option::Option<wkt::Timestamp>,
5048
5049    /// Output only. List all maintenance versions applicable on the instance
5050    pub available_maintenance_versions: std::vec::Vec<std::string::String>,
5051
5052    /// The current software version on the instance.
5053    pub maintenance_version: std::string::String,
5054
5055    /// Output only. All database versions that are available for upgrade.
5056    pub upgradable_database_versions: std::vec::Vec<crate::model::AvailableDatabaseVersion>,
5057
5058    pub sql_network_architecture:
5059        std::option::Option<crate::model::database_instance::SqlNetworkArchitecture>,
5060
5061    /// Output only. The link to service attachment of PSC instance.
5062    pub psc_service_attachment_link: std::option::Option<std::string::String>,
5063
5064    /// Output only. The dns name of the instance.
5065    pub dns_name: std::option::Option<std::string::String>,
5066
5067    /// Output only. DEPRECATED: please use write_endpoint instead.
5068    #[deprecated]
5069    pub primary_dns_name: std::option::Option<std::string::String>,
5070
5071    /// Output only. The dns name of the primary instance in a replication group.
5072    pub write_endpoint: std::option::Option<std::string::String>,
5073
5074    /// Optional. A primary instance and disaster recovery (DR) replica pair.
5075    /// A DR replica is a cross-region replica that you designate
5076    /// for failover in the event that the primary instance
5077    /// experiences regional failure. Only applicable to MySQL.
5078    pub replication_cluster: std::option::Option<crate::model::ReplicationCluster>,
5079
5080    /// Gemini instance configuration.
5081    pub gemini_config: std::option::Option<crate::model::GeminiInstanceConfig>,
5082
5083    /// Output only. This status indicates whether the instance satisfies PZI.
5084    ///
5085    /// The status is reserved for future use.
5086    pub satisfies_pzi: std::option::Option<wkt::BoolValue>,
5087
5088    /// Input only. Whether Cloud SQL is enabled to switch storing point-in-time
5089    /// recovery log files from a data disk to Cloud Storage.
5090    pub switch_transaction_logs_to_cloud_storage_enabled: std::option::Option<wkt::BoolValue>,
5091
5092    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5093}
5094
5095impl DatabaseInstance {
5096    pub fn new() -> Self {
5097        std::default::Default::default()
5098    }
5099
5100    /// Sets the value of [kind][crate::model::DatabaseInstance::kind].
5101    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5102        self.kind = v.into();
5103        self
5104    }
5105
5106    /// Sets the value of [state][crate::model::DatabaseInstance::state].
5107    pub fn set_state<T: std::convert::Into<crate::model::database_instance::SqlInstanceState>>(
5108        mut self,
5109        v: T,
5110    ) -> Self {
5111        self.state = v.into();
5112        self
5113    }
5114
5115    /// Sets the value of [database_version][crate::model::DatabaseInstance::database_version].
5116    pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
5117        mut self,
5118        v: T,
5119    ) -> Self {
5120        self.database_version = v.into();
5121        self
5122    }
5123
5124    /// Sets the value of [settings][crate::model::DatabaseInstance::settings].
5125    pub fn set_settings<T>(mut self, v: T) -> Self
5126    where
5127        T: std::convert::Into<crate::model::Settings>,
5128    {
5129        self.settings = std::option::Option::Some(v.into());
5130        self
5131    }
5132
5133    /// Sets or clears the value of [settings][crate::model::DatabaseInstance::settings].
5134    pub fn set_or_clear_settings<T>(mut self, v: std::option::Option<T>) -> Self
5135    where
5136        T: std::convert::Into<crate::model::Settings>,
5137    {
5138        self.settings = v.map(|x| x.into());
5139        self
5140    }
5141
5142    /// Sets the value of [etag][crate::model::DatabaseInstance::etag].
5143    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5144        self.etag = v.into();
5145        self
5146    }
5147
5148    /// Sets the value of [failover_replica][crate::model::DatabaseInstance::failover_replica].
5149    pub fn set_failover_replica<T>(mut self, v: T) -> Self
5150    where
5151        T: std::convert::Into<crate::model::database_instance::SqlFailoverReplica>,
5152    {
5153        self.failover_replica = std::option::Option::Some(v.into());
5154        self
5155    }
5156
5157    /// Sets or clears the value of [failover_replica][crate::model::DatabaseInstance::failover_replica].
5158    pub fn set_or_clear_failover_replica<T>(mut self, v: std::option::Option<T>) -> Self
5159    where
5160        T: std::convert::Into<crate::model::database_instance::SqlFailoverReplica>,
5161    {
5162        self.failover_replica = v.map(|x| x.into());
5163        self
5164    }
5165
5166    /// Sets the value of [master_instance_name][crate::model::DatabaseInstance::master_instance_name].
5167    pub fn set_master_instance_name<T: std::convert::Into<std::string::String>>(
5168        mut self,
5169        v: T,
5170    ) -> Self {
5171        self.master_instance_name = v.into();
5172        self
5173    }
5174
5175    /// Sets the value of [replica_names][crate::model::DatabaseInstance::replica_names].
5176    pub fn set_replica_names<T, V>(mut self, v: T) -> Self
5177    where
5178        T: std::iter::IntoIterator<Item = V>,
5179        V: std::convert::Into<std::string::String>,
5180    {
5181        use std::iter::Iterator;
5182        self.replica_names = v.into_iter().map(|i| i.into()).collect();
5183        self
5184    }
5185
5186    /// Sets the value of [max_disk_size][crate::model::DatabaseInstance::max_disk_size].
5187    #[deprecated]
5188    pub fn set_max_disk_size<T>(mut self, v: T) -> Self
5189    where
5190        T: std::convert::Into<wkt::Int64Value>,
5191    {
5192        self.max_disk_size = std::option::Option::Some(v.into());
5193        self
5194    }
5195
5196    /// Sets or clears the value of [max_disk_size][crate::model::DatabaseInstance::max_disk_size].
5197    #[deprecated]
5198    pub fn set_or_clear_max_disk_size<T>(mut self, v: std::option::Option<T>) -> Self
5199    where
5200        T: std::convert::Into<wkt::Int64Value>,
5201    {
5202        self.max_disk_size = v.map(|x| x.into());
5203        self
5204    }
5205
5206    /// Sets the value of [current_disk_size][crate::model::DatabaseInstance::current_disk_size].
5207    #[deprecated]
5208    pub fn set_current_disk_size<T>(mut self, v: T) -> Self
5209    where
5210        T: std::convert::Into<wkt::Int64Value>,
5211    {
5212        self.current_disk_size = std::option::Option::Some(v.into());
5213        self
5214    }
5215
5216    /// Sets or clears the value of [current_disk_size][crate::model::DatabaseInstance::current_disk_size].
5217    #[deprecated]
5218    pub fn set_or_clear_current_disk_size<T>(mut self, v: std::option::Option<T>) -> Self
5219    where
5220        T: std::convert::Into<wkt::Int64Value>,
5221    {
5222        self.current_disk_size = v.map(|x| x.into());
5223        self
5224    }
5225
5226    /// Sets the value of [ip_addresses][crate::model::DatabaseInstance::ip_addresses].
5227    pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
5228    where
5229        T: std::iter::IntoIterator<Item = V>,
5230        V: std::convert::Into<crate::model::IpMapping>,
5231    {
5232        use std::iter::Iterator;
5233        self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
5234        self
5235    }
5236
5237    /// Sets the value of [server_ca_cert][crate::model::DatabaseInstance::server_ca_cert].
5238    pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
5239    where
5240        T: std::convert::Into<crate::model::SslCert>,
5241    {
5242        self.server_ca_cert = std::option::Option::Some(v.into());
5243        self
5244    }
5245
5246    /// Sets or clears the value of [server_ca_cert][crate::model::DatabaseInstance::server_ca_cert].
5247    pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
5248    where
5249        T: std::convert::Into<crate::model::SslCert>,
5250    {
5251        self.server_ca_cert = v.map(|x| x.into());
5252        self
5253    }
5254
5255    /// Sets the value of [instance_type][crate::model::DatabaseInstance::instance_type].
5256    pub fn set_instance_type<T: std::convert::Into<crate::model::SqlInstanceType>>(
5257        mut self,
5258        v: T,
5259    ) -> Self {
5260        self.instance_type = v.into();
5261        self
5262    }
5263
5264    /// Sets the value of [project][crate::model::DatabaseInstance::project].
5265    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5266        self.project = v.into();
5267        self
5268    }
5269
5270    /// Sets the value of [ipv6_address][crate::model::DatabaseInstance::ipv6_address].
5271    #[deprecated]
5272    pub fn set_ipv6_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5273        self.ipv6_address = v.into();
5274        self
5275    }
5276
5277    /// Sets the value of [service_account_email_address][crate::model::DatabaseInstance::service_account_email_address].
5278    pub fn set_service_account_email_address<T: std::convert::Into<std::string::String>>(
5279        mut self,
5280        v: T,
5281    ) -> Self {
5282        self.service_account_email_address = v.into();
5283        self
5284    }
5285
5286    /// Sets the value of [on_premises_configuration][crate::model::DatabaseInstance::on_premises_configuration].
5287    pub fn set_on_premises_configuration<T>(mut self, v: T) -> Self
5288    where
5289        T: std::convert::Into<crate::model::OnPremisesConfiguration>,
5290    {
5291        self.on_premises_configuration = std::option::Option::Some(v.into());
5292        self
5293    }
5294
5295    /// Sets or clears the value of [on_premises_configuration][crate::model::DatabaseInstance::on_premises_configuration].
5296    pub fn set_or_clear_on_premises_configuration<T>(mut self, v: std::option::Option<T>) -> Self
5297    where
5298        T: std::convert::Into<crate::model::OnPremisesConfiguration>,
5299    {
5300        self.on_premises_configuration = v.map(|x| x.into());
5301        self
5302    }
5303
5304    /// Sets the value of [replica_configuration][crate::model::DatabaseInstance::replica_configuration].
5305    pub fn set_replica_configuration<T>(mut self, v: T) -> Self
5306    where
5307        T: std::convert::Into<crate::model::ReplicaConfiguration>,
5308    {
5309        self.replica_configuration = std::option::Option::Some(v.into());
5310        self
5311    }
5312
5313    /// Sets or clears the value of [replica_configuration][crate::model::DatabaseInstance::replica_configuration].
5314    pub fn set_or_clear_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
5315    where
5316        T: std::convert::Into<crate::model::ReplicaConfiguration>,
5317    {
5318        self.replica_configuration = v.map(|x| x.into());
5319        self
5320    }
5321
5322    /// Sets the value of [backend_type][crate::model::DatabaseInstance::backend_type].
5323    pub fn set_backend_type<T: std::convert::Into<crate::model::SqlBackendType>>(
5324        mut self,
5325        v: T,
5326    ) -> Self {
5327        self.backend_type = v.into();
5328        self
5329    }
5330
5331    /// Sets the value of [self_link][crate::model::DatabaseInstance::self_link].
5332    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5333        self.self_link = v.into();
5334        self
5335    }
5336
5337    /// Sets the value of [suspension_reason][crate::model::DatabaseInstance::suspension_reason].
5338    pub fn set_suspension_reason<T, V>(mut self, v: T) -> Self
5339    where
5340        T: std::iter::IntoIterator<Item = V>,
5341        V: std::convert::Into<crate::model::SqlSuspensionReason>,
5342    {
5343        use std::iter::Iterator;
5344        self.suspension_reason = v.into_iter().map(|i| i.into()).collect();
5345        self
5346    }
5347
5348    /// Sets the value of [connection_name][crate::model::DatabaseInstance::connection_name].
5349    pub fn set_connection_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5350        self.connection_name = v.into();
5351        self
5352    }
5353
5354    /// Sets the value of [name][crate::model::DatabaseInstance::name].
5355    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5356        self.name = v.into();
5357        self
5358    }
5359
5360    /// Sets the value of [region][crate::model::DatabaseInstance::region].
5361    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5362        self.region = v.into();
5363        self
5364    }
5365
5366    /// Sets the value of [gce_zone][crate::model::DatabaseInstance::gce_zone].
5367    pub fn set_gce_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5368        self.gce_zone = v.into();
5369        self
5370    }
5371
5372    /// Sets the value of [secondary_gce_zone][crate::model::DatabaseInstance::secondary_gce_zone].
5373    pub fn set_secondary_gce_zone<T: std::convert::Into<std::string::String>>(
5374        mut self,
5375        v: T,
5376    ) -> Self {
5377        self.secondary_gce_zone = v.into();
5378        self
5379    }
5380
5381    /// Sets the value of [disk_encryption_configuration][crate::model::DatabaseInstance::disk_encryption_configuration].
5382    pub fn set_disk_encryption_configuration<T>(mut self, v: T) -> Self
5383    where
5384        T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
5385    {
5386        self.disk_encryption_configuration = std::option::Option::Some(v.into());
5387        self
5388    }
5389
5390    /// Sets or clears the value of [disk_encryption_configuration][crate::model::DatabaseInstance::disk_encryption_configuration].
5391    pub fn set_or_clear_disk_encryption_configuration<T>(
5392        mut self,
5393        v: std::option::Option<T>,
5394    ) -> Self
5395    where
5396        T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
5397    {
5398        self.disk_encryption_configuration = v.map(|x| x.into());
5399        self
5400    }
5401
5402    /// Sets the value of [disk_encryption_status][crate::model::DatabaseInstance::disk_encryption_status].
5403    pub fn set_disk_encryption_status<T>(mut self, v: T) -> Self
5404    where
5405        T: std::convert::Into<crate::model::DiskEncryptionStatus>,
5406    {
5407        self.disk_encryption_status = std::option::Option::Some(v.into());
5408        self
5409    }
5410
5411    /// Sets or clears the value of [disk_encryption_status][crate::model::DatabaseInstance::disk_encryption_status].
5412    pub fn set_or_clear_disk_encryption_status<T>(mut self, v: std::option::Option<T>) -> Self
5413    where
5414        T: std::convert::Into<crate::model::DiskEncryptionStatus>,
5415    {
5416        self.disk_encryption_status = v.map(|x| x.into());
5417        self
5418    }
5419
5420    /// Sets the value of [root_password][crate::model::DatabaseInstance::root_password].
5421    pub fn set_root_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5422        self.root_password = v.into();
5423        self
5424    }
5425
5426    /// Sets the value of [scheduled_maintenance][crate::model::DatabaseInstance::scheduled_maintenance].
5427    pub fn set_scheduled_maintenance<T>(mut self, v: T) -> Self
5428    where
5429        T: std::convert::Into<crate::model::database_instance::SqlScheduledMaintenance>,
5430    {
5431        self.scheduled_maintenance = std::option::Option::Some(v.into());
5432        self
5433    }
5434
5435    /// Sets or clears the value of [scheduled_maintenance][crate::model::DatabaseInstance::scheduled_maintenance].
5436    pub fn set_or_clear_scheduled_maintenance<T>(mut self, v: std::option::Option<T>) -> Self
5437    where
5438        T: std::convert::Into<crate::model::database_instance::SqlScheduledMaintenance>,
5439    {
5440        self.scheduled_maintenance = v.map(|x| x.into());
5441        self
5442    }
5443
5444    /// Sets the value of [satisfies_pzs][crate::model::DatabaseInstance::satisfies_pzs].
5445    pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
5446    where
5447        T: std::convert::Into<wkt::BoolValue>,
5448    {
5449        self.satisfies_pzs = std::option::Option::Some(v.into());
5450        self
5451    }
5452
5453    /// Sets or clears the value of [satisfies_pzs][crate::model::DatabaseInstance::satisfies_pzs].
5454    pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
5455    where
5456        T: std::convert::Into<wkt::BoolValue>,
5457    {
5458        self.satisfies_pzs = v.map(|x| x.into());
5459        self
5460    }
5461
5462    /// Sets the value of [database_installed_version][crate::model::DatabaseInstance::database_installed_version].
5463    pub fn set_database_installed_version<T: std::convert::Into<std::string::String>>(
5464        mut self,
5465        v: T,
5466    ) -> Self {
5467        self.database_installed_version = v.into();
5468        self
5469    }
5470
5471    /// Sets the value of [out_of_disk_report][crate::model::DatabaseInstance::out_of_disk_report].
5472    pub fn set_out_of_disk_report<T>(mut self, v: T) -> Self
5473    where
5474        T: std::convert::Into<crate::model::database_instance::SqlOutOfDiskReport>,
5475    {
5476        self.out_of_disk_report = std::option::Option::Some(v.into());
5477        self
5478    }
5479
5480    /// Sets or clears the value of [out_of_disk_report][crate::model::DatabaseInstance::out_of_disk_report].
5481    pub fn set_or_clear_out_of_disk_report<T>(mut self, v: std::option::Option<T>) -> Self
5482    where
5483        T: std::convert::Into<crate::model::database_instance::SqlOutOfDiskReport>,
5484    {
5485        self.out_of_disk_report = v.map(|x| x.into());
5486        self
5487    }
5488
5489    /// Sets the value of [create_time][crate::model::DatabaseInstance::create_time].
5490    pub fn set_create_time<T>(mut self, v: T) -> Self
5491    where
5492        T: std::convert::Into<wkt::Timestamp>,
5493    {
5494        self.create_time = std::option::Option::Some(v.into());
5495        self
5496    }
5497
5498    /// Sets or clears the value of [create_time][crate::model::DatabaseInstance::create_time].
5499    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5500    where
5501        T: std::convert::Into<wkt::Timestamp>,
5502    {
5503        self.create_time = v.map(|x| x.into());
5504        self
5505    }
5506
5507    /// Sets the value of [available_maintenance_versions][crate::model::DatabaseInstance::available_maintenance_versions].
5508    pub fn set_available_maintenance_versions<T, V>(mut self, v: T) -> Self
5509    where
5510        T: std::iter::IntoIterator<Item = V>,
5511        V: std::convert::Into<std::string::String>,
5512    {
5513        use std::iter::Iterator;
5514        self.available_maintenance_versions = v.into_iter().map(|i| i.into()).collect();
5515        self
5516    }
5517
5518    /// Sets the value of [maintenance_version][crate::model::DatabaseInstance::maintenance_version].
5519    pub fn set_maintenance_version<T: std::convert::Into<std::string::String>>(
5520        mut self,
5521        v: T,
5522    ) -> Self {
5523        self.maintenance_version = v.into();
5524        self
5525    }
5526
5527    /// Sets the value of [upgradable_database_versions][crate::model::DatabaseInstance::upgradable_database_versions].
5528    pub fn set_upgradable_database_versions<T, V>(mut self, v: T) -> Self
5529    where
5530        T: std::iter::IntoIterator<Item = V>,
5531        V: std::convert::Into<crate::model::AvailableDatabaseVersion>,
5532    {
5533        use std::iter::Iterator;
5534        self.upgradable_database_versions = v.into_iter().map(|i| i.into()).collect();
5535        self
5536    }
5537
5538    /// Sets the value of [sql_network_architecture][crate::model::DatabaseInstance::sql_network_architecture].
5539    pub fn set_sql_network_architecture<T>(mut self, v: T) -> Self
5540    where
5541        T: std::convert::Into<crate::model::database_instance::SqlNetworkArchitecture>,
5542    {
5543        self.sql_network_architecture = std::option::Option::Some(v.into());
5544        self
5545    }
5546
5547    /// Sets or clears the value of [sql_network_architecture][crate::model::DatabaseInstance::sql_network_architecture].
5548    pub fn set_or_clear_sql_network_architecture<T>(mut self, v: std::option::Option<T>) -> Self
5549    where
5550        T: std::convert::Into<crate::model::database_instance::SqlNetworkArchitecture>,
5551    {
5552        self.sql_network_architecture = v.map(|x| x.into());
5553        self
5554    }
5555
5556    /// Sets the value of [psc_service_attachment_link][crate::model::DatabaseInstance::psc_service_attachment_link].
5557    pub fn set_psc_service_attachment_link<T>(mut self, v: T) -> Self
5558    where
5559        T: std::convert::Into<std::string::String>,
5560    {
5561        self.psc_service_attachment_link = std::option::Option::Some(v.into());
5562        self
5563    }
5564
5565    /// Sets or clears the value of [psc_service_attachment_link][crate::model::DatabaseInstance::psc_service_attachment_link].
5566    pub fn set_or_clear_psc_service_attachment_link<T>(mut self, v: std::option::Option<T>) -> Self
5567    where
5568        T: std::convert::Into<std::string::String>,
5569    {
5570        self.psc_service_attachment_link = v.map(|x| x.into());
5571        self
5572    }
5573
5574    /// Sets the value of [dns_name][crate::model::DatabaseInstance::dns_name].
5575    pub fn set_dns_name<T>(mut self, v: T) -> Self
5576    where
5577        T: std::convert::Into<std::string::String>,
5578    {
5579        self.dns_name = std::option::Option::Some(v.into());
5580        self
5581    }
5582
5583    /// Sets or clears the value of [dns_name][crate::model::DatabaseInstance::dns_name].
5584    pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
5585    where
5586        T: std::convert::Into<std::string::String>,
5587    {
5588        self.dns_name = v.map(|x| x.into());
5589        self
5590    }
5591
5592    /// Sets the value of [primary_dns_name][crate::model::DatabaseInstance::primary_dns_name].
5593    #[deprecated]
5594    pub fn set_primary_dns_name<T>(mut self, v: T) -> Self
5595    where
5596        T: std::convert::Into<std::string::String>,
5597    {
5598        self.primary_dns_name = std::option::Option::Some(v.into());
5599        self
5600    }
5601
5602    /// Sets or clears the value of [primary_dns_name][crate::model::DatabaseInstance::primary_dns_name].
5603    #[deprecated]
5604    pub fn set_or_clear_primary_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
5605    where
5606        T: std::convert::Into<std::string::String>,
5607    {
5608        self.primary_dns_name = v.map(|x| x.into());
5609        self
5610    }
5611
5612    /// Sets the value of [write_endpoint][crate::model::DatabaseInstance::write_endpoint].
5613    pub fn set_write_endpoint<T>(mut self, v: T) -> Self
5614    where
5615        T: std::convert::Into<std::string::String>,
5616    {
5617        self.write_endpoint = std::option::Option::Some(v.into());
5618        self
5619    }
5620
5621    /// Sets or clears the value of [write_endpoint][crate::model::DatabaseInstance::write_endpoint].
5622    pub fn set_or_clear_write_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
5623    where
5624        T: std::convert::Into<std::string::String>,
5625    {
5626        self.write_endpoint = v.map(|x| x.into());
5627        self
5628    }
5629
5630    /// Sets the value of [replication_cluster][crate::model::DatabaseInstance::replication_cluster].
5631    pub fn set_replication_cluster<T>(mut self, v: T) -> Self
5632    where
5633        T: std::convert::Into<crate::model::ReplicationCluster>,
5634    {
5635        self.replication_cluster = std::option::Option::Some(v.into());
5636        self
5637    }
5638
5639    /// Sets or clears the value of [replication_cluster][crate::model::DatabaseInstance::replication_cluster].
5640    pub fn set_or_clear_replication_cluster<T>(mut self, v: std::option::Option<T>) -> Self
5641    where
5642        T: std::convert::Into<crate::model::ReplicationCluster>,
5643    {
5644        self.replication_cluster = v.map(|x| x.into());
5645        self
5646    }
5647
5648    /// Sets the value of [gemini_config][crate::model::DatabaseInstance::gemini_config].
5649    pub fn set_gemini_config<T>(mut self, v: T) -> Self
5650    where
5651        T: std::convert::Into<crate::model::GeminiInstanceConfig>,
5652    {
5653        self.gemini_config = std::option::Option::Some(v.into());
5654        self
5655    }
5656
5657    /// Sets or clears the value of [gemini_config][crate::model::DatabaseInstance::gemini_config].
5658    pub fn set_or_clear_gemini_config<T>(mut self, v: std::option::Option<T>) -> Self
5659    where
5660        T: std::convert::Into<crate::model::GeminiInstanceConfig>,
5661    {
5662        self.gemini_config = v.map(|x| x.into());
5663        self
5664    }
5665
5666    /// Sets the value of [satisfies_pzi][crate::model::DatabaseInstance::satisfies_pzi].
5667    pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
5668    where
5669        T: std::convert::Into<wkt::BoolValue>,
5670    {
5671        self.satisfies_pzi = std::option::Option::Some(v.into());
5672        self
5673    }
5674
5675    /// Sets or clears the value of [satisfies_pzi][crate::model::DatabaseInstance::satisfies_pzi].
5676    pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
5677    where
5678        T: std::convert::Into<wkt::BoolValue>,
5679    {
5680        self.satisfies_pzi = v.map(|x| x.into());
5681        self
5682    }
5683
5684    /// Sets the value of [switch_transaction_logs_to_cloud_storage_enabled][crate::model::DatabaseInstance::switch_transaction_logs_to_cloud_storage_enabled].
5685    pub fn set_switch_transaction_logs_to_cloud_storage_enabled<T>(mut self, v: T) -> Self
5686    where
5687        T: std::convert::Into<wkt::BoolValue>,
5688    {
5689        self.switch_transaction_logs_to_cloud_storage_enabled = std::option::Option::Some(v.into());
5690        self
5691    }
5692
5693    /// Sets or clears the value of [switch_transaction_logs_to_cloud_storage_enabled][crate::model::DatabaseInstance::switch_transaction_logs_to_cloud_storage_enabled].
5694    pub fn set_or_clear_switch_transaction_logs_to_cloud_storage_enabled<T>(
5695        mut self,
5696        v: std::option::Option<T>,
5697    ) -> Self
5698    where
5699        T: std::convert::Into<wkt::BoolValue>,
5700    {
5701        self.switch_transaction_logs_to_cloud_storage_enabled = v.map(|x| x.into());
5702        self
5703    }
5704}
5705
5706impl wkt::message::Message for DatabaseInstance {
5707    fn typename() -> &'static str {
5708        "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance"
5709    }
5710}
5711
5712/// Defines additional types related to [DatabaseInstance].
5713pub mod database_instance {
5714    #[allow(unused_imports)]
5715    use super::*;
5716
5717    #[derive(Clone, Default, PartialEq)]
5718    #[non_exhaustive]
5719    pub struct SqlFailoverReplica {
5720        /// The name of the failover replica. If specified at instance creation, a
5721        /// failover replica is created for the instance. The name
5722        /// doesn't include the project ID.
5723        pub name: std::string::String,
5724
5725        /// The availability status of the failover replica. A false status indicates
5726        /// that the failover replica is out of sync. The primary instance can only
5727        /// failover to the failover replica when the status is true.
5728        pub available: std::option::Option<wkt::BoolValue>,
5729
5730        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5731    }
5732
5733    impl SqlFailoverReplica {
5734        pub fn new() -> Self {
5735            std::default::Default::default()
5736        }
5737
5738        /// Sets the value of [name][crate::model::database_instance::SqlFailoverReplica::name].
5739        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5740            self.name = v.into();
5741            self
5742        }
5743
5744        /// Sets the value of [available][crate::model::database_instance::SqlFailoverReplica::available].
5745        pub fn set_available<T>(mut self, v: T) -> Self
5746        where
5747            T: std::convert::Into<wkt::BoolValue>,
5748        {
5749            self.available = std::option::Option::Some(v.into());
5750            self
5751        }
5752
5753        /// Sets or clears the value of [available][crate::model::database_instance::SqlFailoverReplica::available].
5754        pub fn set_or_clear_available<T>(mut self, v: std::option::Option<T>) -> Self
5755        where
5756            T: std::convert::Into<wkt::BoolValue>,
5757        {
5758            self.available = v.map(|x| x.into());
5759            self
5760        }
5761    }
5762
5763    impl wkt::message::Message for SqlFailoverReplica {
5764        fn typename() -> &'static str {
5765            "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica"
5766        }
5767    }
5768
5769    /// Any scheduled maintenance for this instance.
5770    #[derive(Clone, Default, PartialEq)]
5771    #[non_exhaustive]
5772    pub struct SqlScheduledMaintenance {
5773        /// The start time of any upcoming scheduled maintenance for this instance.
5774        pub start_time: std::option::Option<wkt::Timestamp>,
5775
5776        #[deprecated]
5777        pub can_defer: bool,
5778
5779        /// If the scheduled maintenance can be rescheduled.
5780        pub can_reschedule: bool,
5781
5782        /// Maintenance cannot be rescheduled to start beyond this deadline.
5783        pub schedule_deadline_time: std::option::Option<wkt::Timestamp>,
5784
5785        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5786    }
5787
5788    impl SqlScheduledMaintenance {
5789        pub fn new() -> Self {
5790            std::default::Default::default()
5791        }
5792
5793        /// Sets the value of [start_time][crate::model::database_instance::SqlScheduledMaintenance::start_time].
5794        pub fn set_start_time<T>(mut self, v: T) -> Self
5795        where
5796            T: std::convert::Into<wkt::Timestamp>,
5797        {
5798            self.start_time = std::option::Option::Some(v.into());
5799            self
5800        }
5801
5802        /// Sets or clears the value of [start_time][crate::model::database_instance::SqlScheduledMaintenance::start_time].
5803        pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
5804        where
5805            T: std::convert::Into<wkt::Timestamp>,
5806        {
5807            self.start_time = v.map(|x| x.into());
5808            self
5809        }
5810
5811        /// Sets the value of [can_defer][crate::model::database_instance::SqlScheduledMaintenance::can_defer].
5812        #[deprecated]
5813        pub fn set_can_defer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5814            self.can_defer = v.into();
5815            self
5816        }
5817
5818        /// Sets the value of [can_reschedule][crate::model::database_instance::SqlScheduledMaintenance::can_reschedule].
5819        pub fn set_can_reschedule<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5820            self.can_reschedule = v.into();
5821            self
5822        }
5823
5824        /// Sets the value of [schedule_deadline_time][crate::model::database_instance::SqlScheduledMaintenance::schedule_deadline_time].
5825        pub fn set_schedule_deadline_time<T>(mut self, v: T) -> Self
5826        where
5827            T: std::convert::Into<wkt::Timestamp>,
5828        {
5829            self.schedule_deadline_time = std::option::Option::Some(v.into());
5830            self
5831        }
5832
5833        /// Sets or clears the value of [schedule_deadline_time][crate::model::database_instance::SqlScheduledMaintenance::schedule_deadline_time].
5834        pub fn set_or_clear_schedule_deadline_time<T>(mut self, v: std::option::Option<T>) -> Self
5835        where
5836            T: std::convert::Into<wkt::Timestamp>,
5837        {
5838            self.schedule_deadline_time = v.map(|x| x.into());
5839            self
5840        }
5841    }
5842
5843    impl wkt::message::Message for SqlScheduledMaintenance {
5844        fn typename() -> &'static str {
5845            "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance"
5846        }
5847    }
5848
5849    /// This message wraps up the information written by out-of-disk detection job.
5850    #[derive(Clone, Default, PartialEq)]
5851    #[non_exhaustive]
5852    pub struct SqlOutOfDiskReport {
5853        /// This field represents the state generated by the proactive database
5854        /// wellness job for OutOfDisk issues.
5855        ///
5856        /// * Writers:
5857        /// * the proactive database wellness job for OOD.
5858        /// * Readers:
5859        /// * the proactive database wellness job
5860        pub sql_out_of_disk_state: std::option::Option<
5861            crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
5862        >,
5863
5864        /// The minimum recommended increase size in GigaBytes
5865        /// This field is consumed by the frontend
5866        ///
5867        /// * Writers:
5868        /// * the proactive database wellness job for OOD.
5869        /// * Readers:
5870        pub sql_min_recommended_increase_size_gb: std::option::Option<i32>,
5871
5872        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5873    }
5874
5875    impl SqlOutOfDiskReport {
5876        pub fn new() -> Self {
5877            std::default::Default::default()
5878        }
5879
5880        /// Sets the value of [sql_out_of_disk_state][crate::model::database_instance::SqlOutOfDiskReport::sql_out_of_disk_state].
5881        pub fn set_sql_out_of_disk_state<T>(mut self, v: T) -> Self
5882        where
5883            T: std::convert::Into<
5884                    crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
5885                >,
5886        {
5887            self.sql_out_of_disk_state = std::option::Option::Some(v.into());
5888            self
5889        }
5890
5891        /// Sets or clears the value of [sql_out_of_disk_state][crate::model::database_instance::SqlOutOfDiskReport::sql_out_of_disk_state].
5892        pub fn set_or_clear_sql_out_of_disk_state<T>(mut self, v: std::option::Option<T>) -> Self
5893        where
5894            T: std::convert::Into<
5895                    crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
5896                >,
5897        {
5898            self.sql_out_of_disk_state = v.map(|x| x.into());
5899            self
5900        }
5901
5902        /// Sets the value of [sql_min_recommended_increase_size_gb][crate::model::database_instance::SqlOutOfDiskReport::sql_min_recommended_increase_size_gb].
5903        pub fn set_sql_min_recommended_increase_size_gb<T>(mut self, v: T) -> Self
5904        where
5905            T: std::convert::Into<i32>,
5906        {
5907            self.sql_min_recommended_increase_size_gb = std::option::Option::Some(v.into());
5908            self
5909        }
5910
5911        /// Sets or clears the value of [sql_min_recommended_increase_size_gb][crate::model::database_instance::SqlOutOfDiskReport::sql_min_recommended_increase_size_gb].
5912        pub fn set_or_clear_sql_min_recommended_increase_size_gb<T>(
5913            mut self,
5914            v: std::option::Option<T>,
5915        ) -> Self
5916        where
5917            T: std::convert::Into<i32>,
5918        {
5919            self.sql_min_recommended_increase_size_gb = v.map(|x| x.into());
5920            self
5921        }
5922    }
5923
5924    impl wkt::message::Message for SqlOutOfDiskReport {
5925        fn typename() -> &'static str {
5926            "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport"
5927        }
5928    }
5929
5930    /// Defines additional types related to [SqlOutOfDiskReport].
5931    pub mod sql_out_of_disk_report {
5932        #[allow(unused_imports)]
5933        use super::*;
5934
5935        /// This enum lists all possible states regarding out-of-disk issues.
5936        ///
5937        /// # Working with unknown values
5938        ///
5939        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5940        /// additional enum variants at any time. Adding new variants is not considered
5941        /// a breaking change. Applications should write their code in anticipation of:
5942        ///
5943        /// - New values appearing in future releases of the client library, **and**
5944        /// - New values received dynamically, without application changes.
5945        ///
5946        /// Please consult the [Working with enums] section in the user guide for some
5947        /// guidelines.
5948        ///
5949        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5950        #[derive(Clone, Debug, PartialEq)]
5951        #[non_exhaustive]
5952        pub enum SqlOutOfDiskState {
5953            /// Unspecified state
5954            Unspecified,
5955            /// The instance has plenty space on data disk
5956            Normal,
5957            /// Data disk is almost used up. It is shutdown to prevent data
5958            /// corruption.
5959            SoftShutdown,
5960            /// If set, the enum was initialized with an unknown value.
5961            ///
5962            /// Applications can examine the value using [SqlOutOfDiskState::value] or
5963            /// [SqlOutOfDiskState::name].
5964            UnknownValue(sql_out_of_disk_state::UnknownValue),
5965        }
5966
5967        #[doc(hidden)]
5968        pub mod sql_out_of_disk_state {
5969            #[allow(unused_imports)]
5970            use super::*;
5971            #[derive(Clone, Debug, PartialEq)]
5972            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5973        }
5974
5975        impl SqlOutOfDiskState {
5976            /// Gets the enum value.
5977            ///
5978            /// Returns `None` if the enum contains an unknown value deserialized from
5979            /// the string representation of enums.
5980            pub fn value(&self) -> std::option::Option<i32> {
5981                match self {
5982                    Self::Unspecified => std::option::Option::Some(0),
5983                    Self::Normal => std::option::Option::Some(1),
5984                    Self::SoftShutdown => std::option::Option::Some(2),
5985                    Self::UnknownValue(u) => u.0.value(),
5986                }
5987            }
5988
5989            /// Gets the enum value as a string.
5990            ///
5991            /// Returns `None` if the enum contains an unknown value deserialized from
5992            /// the integer representation of enums.
5993            pub fn name(&self) -> std::option::Option<&str> {
5994                match self {
5995                    Self::Unspecified => {
5996                        std::option::Option::Some("SQL_OUT_OF_DISK_STATE_UNSPECIFIED")
5997                    }
5998                    Self::Normal => std::option::Option::Some("NORMAL"),
5999                    Self::SoftShutdown => std::option::Option::Some("SOFT_SHUTDOWN"),
6000                    Self::UnknownValue(u) => u.0.name(),
6001                }
6002            }
6003        }
6004
6005        impl std::default::Default for SqlOutOfDiskState {
6006            fn default() -> Self {
6007                use std::convert::From;
6008                Self::from(0)
6009            }
6010        }
6011
6012        impl std::fmt::Display for SqlOutOfDiskState {
6013            fn fmt(
6014                &self,
6015                f: &mut std::fmt::Formatter<'_>,
6016            ) -> std::result::Result<(), std::fmt::Error> {
6017                wkt::internal::display_enum(f, self.name(), self.value())
6018            }
6019        }
6020
6021        impl std::convert::From<i32> for SqlOutOfDiskState {
6022            fn from(value: i32) -> Self {
6023                match value {
6024                    0 => Self::Unspecified,
6025                    1 => Self::Normal,
6026                    2 => Self::SoftShutdown,
6027                    _ => Self::UnknownValue(sql_out_of_disk_state::UnknownValue(
6028                        wkt::internal::UnknownEnumValue::Integer(value),
6029                    )),
6030                }
6031            }
6032        }
6033
6034        impl std::convert::From<&str> for SqlOutOfDiskState {
6035            fn from(value: &str) -> Self {
6036                use std::string::ToString;
6037                match value {
6038                    "SQL_OUT_OF_DISK_STATE_UNSPECIFIED" => Self::Unspecified,
6039                    "NORMAL" => Self::Normal,
6040                    "SOFT_SHUTDOWN" => Self::SoftShutdown,
6041                    _ => Self::UnknownValue(sql_out_of_disk_state::UnknownValue(
6042                        wkt::internal::UnknownEnumValue::String(value.to_string()),
6043                    )),
6044                }
6045            }
6046        }
6047
6048        impl serde::ser::Serialize for SqlOutOfDiskState {
6049            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6050            where
6051                S: serde::Serializer,
6052            {
6053                match self {
6054                    Self::Unspecified => serializer.serialize_i32(0),
6055                    Self::Normal => serializer.serialize_i32(1),
6056                    Self::SoftShutdown => serializer.serialize_i32(2),
6057                    Self::UnknownValue(u) => u.0.serialize(serializer),
6058                }
6059            }
6060        }
6061
6062        impl<'de> serde::de::Deserialize<'de> for SqlOutOfDiskState {
6063            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6064            where
6065                D: serde::Deserializer<'de>,
6066            {
6067                deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOutOfDiskState>::new(
6068                    ".google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState",
6069                ))
6070            }
6071        }
6072    }
6073
6074    /// The current serving state of the database instance.
6075    ///
6076    /// # Working with unknown values
6077    ///
6078    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6079    /// additional enum variants at any time. Adding new variants is not considered
6080    /// a breaking change. Applications should write their code in anticipation of:
6081    ///
6082    /// - New values appearing in future releases of the client library, **and**
6083    /// - New values received dynamically, without application changes.
6084    ///
6085    /// Please consult the [Working with enums] section in the user guide for some
6086    /// guidelines.
6087    ///
6088    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6089    #[derive(Clone, Debug, PartialEq)]
6090    #[non_exhaustive]
6091    pub enum SqlInstanceState {
6092        /// The state of the instance is unknown.
6093        Unspecified,
6094        /// The instance is running, or has been stopped by owner.
6095        Runnable,
6096        /// The instance is not available, for example due to problems with billing.
6097        Suspended,
6098        /// The instance is being deleted.
6099        PendingDelete,
6100        /// The instance is being created.
6101        PendingCreate,
6102        /// The instance is down for maintenance.
6103        Maintenance,
6104        /// The creation of the instance failed or a fatal error occurred during
6105        /// maintenance.
6106        Failed,
6107        /// Deprecated
6108        #[deprecated]
6109        OnlineMaintenance,
6110        /// If set, the enum was initialized with an unknown value.
6111        ///
6112        /// Applications can examine the value using [SqlInstanceState::value] or
6113        /// [SqlInstanceState::name].
6114        UnknownValue(sql_instance_state::UnknownValue),
6115    }
6116
6117    #[doc(hidden)]
6118    pub mod sql_instance_state {
6119        #[allow(unused_imports)]
6120        use super::*;
6121        #[derive(Clone, Debug, PartialEq)]
6122        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6123    }
6124
6125    impl SqlInstanceState {
6126        /// Gets the enum value.
6127        ///
6128        /// Returns `None` if the enum contains an unknown value deserialized from
6129        /// the string representation of enums.
6130        pub fn value(&self) -> std::option::Option<i32> {
6131            match self {
6132                Self::Unspecified => std::option::Option::Some(0),
6133                Self::Runnable => std::option::Option::Some(1),
6134                Self::Suspended => std::option::Option::Some(2),
6135                Self::PendingDelete => std::option::Option::Some(3),
6136                Self::PendingCreate => std::option::Option::Some(4),
6137                Self::Maintenance => std::option::Option::Some(5),
6138                Self::Failed => std::option::Option::Some(6),
6139                Self::OnlineMaintenance => std::option::Option::Some(7),
6140                Self::UnknownValue(u) => u.0.value(),
6141            }
6142        }
6143
6144        /// Gets the enum value as a string.
6145        ///
6146        /// Returns `None` if the enum contains an unknown value deserialized from
6147        /// the integer representation of enums.
6148        pub fn name(&self) -> std::option::Option<&str> {
6149            match self {
6150                Self::Unspecified => std::option::Option::Some("SQL_INSTANCE_STATE_UNSPECIFIED"),
6151                Self::Runnable => std::option::Option::Some("RUNNABLE"),
6152                Self::Suspended => std::option::Option::Some("SUSPENDED"),
6153                Self::PendingDelete => std::option::Option::Some("PENDING_DELETE"),
6154                Self::PendingCreate => std::option::Option::Some("PENDING_CREATE"),
6155                Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
6156                Self::Failed => std::option::Option::Some("FAILED"),
6157                Self::OnlineMaintenance => std::option::Option::Some("ONLINE_MAINTENANCE"),
6158                Self::UnknownValue(u) => u.0.name(),
6159            }
6160        }
6161    }
6162
6163    impl std::default::Default for SqlInstanceState {
6164        fn default() -> Self {
6165            use std::convert::From;
6166            Self::from(0)
6167        }
6168    }
6169
6170    impl std::fmt::Display for SqlInstanceState {
6171        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6172            wkt::internal::display_enum(f, self.name(), self.value())
6173        }
6174    }
6175
6176    impl std::convert::From<i32> for SqlInstanceState {
6177        fn from(value: i32) -> Self {
6178            match value {
6179                0 => Self::Unspecified,
6180                1 => Self::Runnable,
6181                2 => Self::Suspended,
6182                3 => Self::PendingDelete,
6183                4 => Self::PendingCreate,
6184                5 => Self::Maintenance,
6185                6 => Self::Failed,
6186                7 => Self::OnlineMaintenance,
6187                _ => Self::UnknownValue(sql_instance_state::UnknownValue(
6188                    wkt::internal::UnknownEnumValue::Integer(value),
6189                )),
6190            }
6191        }
6192    }
6193
6194    impl std::convert::From<&str> for SqlInstanceState {
6195        fn from(value: &str) -> Self {
6196            use std::string::ToString;
6197            match value {
6198                "SQL_INSTANCE_STATE_UNSPECIFIED" => Self::Unspecified,
6199                "RUNNABLE" => Self::Runnable,
6200                "SUSPENDED" => Self::Suspended,
6201                "PENDING_DELETE" => Self::PendingDelete,
6202                "PENDING_CREATE" => Self::PendingCreate,
6203                "MAINTENANCE" => Self::Maintenance,
6204                "FAILED" => Self::Failed,
6205                "ONLINE_MAINTENANCE" => Self::OnlineMaintenance,
6206                _ => Self::UnknownValue(sql_instance_state::UnknownValue(
6207                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6208                )),
6209            }
6210        }
6211    }
6212
6213    impl serde::ser::Serialize for SqlInstanceState {
6214        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6215        where
6216            S: serde::Serializer,
6217        {
6218            match self {
6219                Self::Unspecified => serializer.serialize_i32(0),
6220                Self::Runnable => serializer.serialize_i32(1),
6221                Self::Suspended => serializer.serialize_i32(2),
6222                Self::PendingDelete => serializer.serialize_i32(3),
6223                Self::PendingCreate => serializer.serialize_i32(4),
6224                Self::Maintenance => serializer.serialize_i32(5),
6225                Self::Failed => serializer.serialize_i32(6),
6226                Self::OnlineMaintenance => serializer.serialize_i32(7),
6227                Self::UnknownValue(u) => u.0.serialize(serializer),
6228            }
6229        }
6230    }
6231
6232    impl<'de> serde::de::Deserialize<'de> for SqlInstanceState {
6233        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6234        where
6235            D: serde::Deserializer<'de>,
6236        {
6237            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlInstanceState>::new(
6238                ".google.cloud.sql.v1.DatabaseInstance.SqlInstanceState",
6239            ))
6240        }
6241    }
6242
6243    /// The SQL network architecture for the instance.
6244    ///
6245    /// # Working with unknown values
6246    ///
6247    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6248    /// additional enum variants at any time. Adding new variants is not considered
6249    /// a breaking change. Applications should write their code in anticipation of:
6250    ///
6251    /// - New values appearing in future releases of the client library, **and**
6252    /// - New values received dynamically, without application changes.
6253    ///
6254    /// Please consult the [Working with enums] section in the user guide for some
6255    /// guidelines.
6256    ///
6257    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6258    #[derive(Clone, Debug, PartialEq)]
6259    #[non_exhaustive]
6260    pub enum SqlNetworkArchitecture {
6261        Unspecified,
6262        /// The instance uses the new network architecture.
6263        NewNetworkArchitecture,
6264        /// The instance uses the old network architecture.
6265        OldNetworkArchitecture,
6266        /// If set, the enum was initialized with an unknown value.
6267        ///
6268        /// Applications can examine the value using [SqlNetworkArchitecture::value] or
6269        /// [SqlNetworkArchitecture::name].
6270        UnknownValue(sql_network_architecture::UnknownValue),
6271    }
6272
6273    #[doc(hidden)]
6274    pub mod sql_network_architecture {
6275        #[allow(unused_imports)]
6276        use super::*;
6277        #[derive(Clone, Debug, PartialEq)]
6278        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6279    }
6280
6281    impl SqlNetworkArchitecture {
6282        /// Gets the enum value.
6283        ///
6284        /// Returns `None` if the enum contains an unknown value deserialized from
6285        /// the string representation of enums.
6286        pub fn value(&self) -> std::option::Option<i32> {
6287            match self {
6288                Self::Unspecified => std::option::Option::Some(0),
6289                Self::NewNetworkArchitecture => std::option::Option::Some(1),
6290                Self::OldNetworkArchitecture => std::option::Option::Some(2),
6291                Self::UnknownValue(u) => u.0.value(),
6292            }
6293        }
6294
6295        /// Gets the enum value as a string.
6296        ///
6297        /// Returns `None` if the enum contains an unknown value deserialized from
6298        /// the integer representation of enums.
6299        pub fn name(&self) -> std::option::Option<&str> {
6300            match self {
6301                Self::Unspecified => {
6302                    std::option::Option::Some("SQL_NETWORK_ARCHITECTURE_UNSPECIFIED")
6303                }
6304                Self::NewNetworkArchitecture => {
6305                    std::option::Option::Some("NEW_NETWORK_ARCHITECTURE")
6306                }
6307                Self::OldNetworkArchitecture => {
6308                    std::option::Option::Some("OLD_NETWORK_ARCHITECTURE")
6309                }
6310                Self::UnknownValue(u) => u.0.name(),
6311            }
6312        }
6313    }
6314
6315    impl std::default::Default for SqlNetworkArchitecture {
6316        fn default() -> Self {
6317            use std::convert::From;
6318            Self::from(0)
6319        }
6320    }
6321
6322    impl std::fmt::Display for SqlNetworkArchitecture {
6323        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6324            wkt::internal::display_enum(f, self.name(), self.value())
6325        }
6326    }
6327
6328    impl std::convert::From<i32> for SqlNetworkArchitecture {
6329        fn from(value: i32) -> Self {
6330            match value {
6331                0 => Self::Unspecified,
6332                1 => Self::NewNetworkArchitecture,
6333                2 => Self::OldNetworkArchitecture,
6334                _ => Self::UnknownValue(sql_network_architecture::UnknownValue(
6335                    wkt::internal::UnknownEnumValue::Integer(value),
6336                )),
6337            }
6338        }
6339    }
6340
6341    impl std::convert::From<&str> for SqlNetworkArchitecture {
6342        fn from(value: &str) -> Self {
6343            use std::string::ToString;
6344            match value {
6345                "SQL_NETWORK_ARCHITECTURE_UNSPECIFIED" => Self::Unspecified,
6346                "NEW_NETWORK_ARCHITECTURE" => Self::NewNetworkArchitecture,
6347                "OLD_NETWORK_ARCHITECTURE" => Self::OldNetworkArchitecture,
6348                _ => Self::UnknownValue(sql_network_architecture::UnknownValue(
6349                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6350                )),
6351            }
6352        }
6353    }
6354
6355    impl serde::ser::Serialize for SqlNetworkArchitecture {
6356        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6357        where
6358            S: serde::Serializer,
6359        {
6360            match self {
6361                Self::Unspecified => serializer.serialize_i32(0),
6362                Self::NewNetworkArchitecture => serializer.serialize_i32(1),
6363                Self::OldNetworkArchitecture => serializer.serialize_i32(2),
6364                Self::UnknownValue(u) => u.0.serialize(serializer),
6365            }
6366        }
6367    }
6368
6369    impl<'de> serde::de::Deserialize<'de> for SqlNetworkArchitecture {
6370        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6371        where
6372            D: serde::Deserializer<'de>,
6373        {
6374            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlNetworkArchitecture>::new(
6375                ".google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture",
6376            ))
6377        }
6378    }
6379}
6380
6381/// Gemini instance configuration.
6382#[derive(Clone, Default, PartialEq)]
6383#[non_exhaustive]
6384pub struct GeminiInstanceConfig {
6385    /// Output only. Whether Gemini is enabled.
6386    pub entitled: std::option::Option<bool>,
6387
6388    /// Output only. Whether the vacuum management is enabled.
6389    pub google_vacuum_mgmt_enabled: std::option::Option<bool>,
6390
6391    /// Output only. Whether canceling the out-of-memory (OOM) session is enabled.
6392    pub oom_session_cancel_enabled: std::option::Option<bool>,
6393
6394    /// Output only. Whether the active query is enabled.
6395    pub active_query_enabled: std::option::Option<bool>,
6396
6397    /// Output only. Whether the index advisor is enabled.
6398    pub index_advisor_enabled: std::option::Option<bool>,
6399
6400    /// Output only. Whether the flag recommender is enabled.
6401    pub flag_recommender_enabled: std::option::Option<bool>,
6402
6403    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6404}
6405
6406impl GeminiInstanceConfig {
6407    pub fn new() -> Self {
6408        std::default::Default::default()
6409    }
6410
6411    /// Sets the value of [entitled][crate::model::GeminiInstanceConfig::entitled].
6412    pub fn set_entitled<T>(mut self, v: T) -> Self
6413    where
6414        T: std::convert::Into<bool>,
6415    {
6416        self.entitled = std::option::Option::Some(v.into());
6417        self
6418    }
6419
6420    /// Sets or clears the value of [entitled][crate::model::GeminiInstanceConfig::entitled].
6421    pub fn set_or_clear_entitled<T>(mut self, v: std::option::Option<T>) -> Self
6422    where
6423        T: std::convert::Into<bool>,
6424    {
6425        self.entitled = v.map(|x| x.into());
6426        self
6427    }
6428
6429    /// Sets the value of [google_vacuum_mgmt_enabled][crate::model::GeminiInstanceConfig::google_vacuum_mgmt_enabled].
6430    pub fn set_google_vacuum_mgmt_enabled<T>(mut self, v: T) -> Self
6431    where
6432        T: std::convert::Into<bool>,
6433    {
6434        self.google_vacuum_mgmt_enabled = std::option::Option::Some(v.into());
6435        self
6436    }
6437
6438    /// Sets or clears the value of [google_vacuum_mgmt_enabled][crate::model::GeminiInstanceConfig::google_vacuum_mgmt_enabled].
6439    pub fn set_or_clear_google_vacuum_mgmt_enabled<T>(mut self, v: std::option::Option<T>) -> Self
6440    where
6441        T: std::convert::Into<bool>,
6442    {
6443        self.google_vacuum_mgmt_enabled = v.map(|x| x.into());
6444        self
6445    }
6446
6447    /// Sets the value of [oom_session_cancel_enabled][crate::model::GeminiInstanceConfig::oom_session_cancel_enabled].
6448    pub fn set_oom_session_cancel_enabled<T>(mut self, v: T) -> Self
6449    where
6450        T: std::convert::Into<bool>,
6451    {
6452        self.oom_session_cancel_enabled = std::option::Option::Some(v.into());
6453        self
6454    }
6455
6456    /// Sets or clears the value of [oom_session_cancel_enabled][crate::model::GeminiInstanceConfig::oom_session_cancel_enabled].
6457    pub fn set_or_clear_oom_session_cancel_enabled<T>(mut self, v: std::option::Option<T>) -> Self
6458    where
6459        T: std::convert::Into<bool>,
6460    {
6461        self.oom_session_cancel_enabled = v.map(|x| x.into());
6462        self
6463    }
6464
6465    /// Sets the value of [active_query_enabled][crate::model::GeminiInstanceConfig::active_query_enabled].
6466    pub fn set_active_query_enabled<T>(mut self, v: T) -> Self
6467    where
6468        T: std::convert::Into<bool>,
6469    {
6470        self.active_query_enabled = std::option::Option::Some(v.into());
6471        self
6472    }
6473
6474    /// Sets or clears the value of [active_query_enabled][crate::model::GeminiInstanceConfig::active_query_enabled].
6475    pub fn set_or_clear_active_query_enabled<T>(mut self, v: std::option::Option<T>) -> Self
6476    where
6477        T: std::convert::Into<bool>,
6478    {
6479        self.active_query_enabled = v.map(|x| x.into());
6480        self
6481    }
6482
6483    /// Sets the value of [index_advisor_enabled][crate::model::GeminiInstanceConfig::index_advisor_enabled].
6484    pub fn set_index_advisor_enabled<T>(mut self, v: T) -> Self
6485    where
6486        T: std::convert::Into<bool>,
6487    {
6488        self.index_advisor_enabled = std::option::Option::Some(v.into());
6489        self
6490    }
6491
6492    /// Sets or clears the value of [index_advisor_enabled][crate::model::GeminiInstanceConfig::index_advisor_enabled].
6493    pub fn set_or_clear_index_advisor_enabled<T>(mut self, v: std::option::Option<T>) -> Self
6494    where
6495        T: std::convert::Into<bool>,
6496    {
6497        self.index_advisor_enabled = v.map(|x| x.into());
6498        self
6499    }
6500
6501    /// Sets the value of [flag_recommender_enabled][crate::model::GeminiInstanceConfig::flag_recommender_enabled].
6502    pub fn set_flag_recommender_enabled<T>(mut self, v: T) -> Self
6503    where
6504        T: std::convert::Into<bool>,
6505    {
6506        self.flag_recommender_enabled = std::option::Option::Some(v.into());
6507        self
6508    }
6509
6510    /// Sets or clears the value of [flag_recommender_enabled][crate::model::GeminiInstanceConfig::flag_recommender_enabled].
6511    pub fn set_or_clear_flag_recommender_enabled<T>(mut self, v: std::option::Option<T>) -> Self
6512    where
6513        T: std::convert::Into<bool>,
6514    {
6515        self.flag_recommender_enabled = v.map(|x| x.into());
6516        self
6517    }
6518}
6519
6520impl wkt::message::Message for GeminiInstanceConfig {
6521    fn typename() -> &'static str {
6522        "type.googleapis.com/google.cloud.sql.v1.GeminiInstanceConfig"
6523    }
6524}
6525
6526/// A primary instance and disaster recovery (DR) replica pair.
6527/// A DR replica is a cross-region replica that you designate for failover in
6528/// the event that the primary instance experiences regional failure.
6529/// Only applicable to MySQL.
6530#[derive(Clone, Default, PartialEq)]
6531#[non_exhaustive]
6532pub struct ReplicationCluster {
6533    /// Output only. If set, it indicates this instance has a private service
6534    /// access (PSA) dns endpoint that is pointing to the primary instance of the
6535    /// cluster. If this instance is the primary, the dns should be pointing to
6536    /// this instance. After Switchover or Replica failover, this DNS endpoint
6537    /// points to the promoted instance. This is a read-only field, returned to the
6538    /// user as information. This field can exist even if a standalone instance
6539    /// does not yet have a replica, or had a DR replica that was deleted.
6540    pub psa_write_endpoint: std::string::String,
6541
6542    /// Optional. If the instance is a primary instance, then this field identifies
6543    /// the disaster recovery (DR) replica. A DR replica is an optional
6544    /// configuration for Enterprise Plus edition instances. If the instance is a
6545    /// read replica, then the field is not set. Set this field to a replica name
6546    /// to designate a DR replica for a primary instance. Remove the replica name
6547    /// to remove the DR replica designation.
6548    pub failover_dr_replica_name: std::string::String,
6549
6550    /// Output only. Read-only field that indicates whether the replica is a DR
6551    /// replica. This field is not set if the instance is a primary instance.
6552    pub dr_replica: bool,
6553
6554    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6555}
6556
6557impl ReplicationCluster {
6558    pub fn new() -> Self {
6559        std::default::Default::default()
6560    }
6561
6562    /// Sets the value of [psa_write_endpoint][crate::model::ReplicationCluster::psa_write_endpoint].
6563    pub fn set_psa_write_endpoint<T: std::convert::Into<std::string::String>>(
6564        mut self,
6565        v: T,
6566    ) -> Self {
6567        self.psa_write_endpoint = v.into();
6568        self
6569    }
6570
6571    /// Sets the value of [failover_dr_replica_name][crate::model::ReplicationCluster::failover_dr_replica_name].
6572    pub fn set_failover_dr_replica_name<T: std::convert::Into<std::string::String>>(
6573        mut self,
6574        v: T,
6575    ) -> Self {
6576        self.failover_dr_replica_name = v.into();
6577        self
6578    }
6579
6580    /// Sets the value of [dr_replica][crate::model::ReplicationCluster::dr_replica].
6581    pub fn set_dr_replica<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6582        self.dr_replica = v.into();
6583        self
6584    }
6585}
6586
6587impl wkt::message::Message for ReplicationCluster {
6588    fn typename() -> &'static str {
6589        "type.googleapis.com/google.cloud.sql.v1.ReplicationCluster"
6590    }
6591}
6592
6593/// An available database version. It can be a major or a minor version.
6594#[derive(Clone, Default, PartialEq)]
6595#[non_exhaustive]
6596pub struct AvailableDatabaseVersion {
6597    /// The version's major version name.
6598    pub major_version: std::option::Option<std::string::String>,
6599
6600    /// The database version name. For MySQL 8.0, this string provides the database
6601    /// major and minor version.
6602    pub name: std::option::Option<std::string::String>,
6603
6604    /// The database version's display name.
6605    pub display_name: std::option::Option<std::string::String>,
6606
6607    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6608}
6609
6610impl AvailableDatabaseVersion {
6611    pub fn new() -> Self {
6612        std::default::Default::default()
6613    }
6614
6615    /// Sets the value of [major_version][crate::model::AvailableDatabaseVersion::major_version].
6616    pub fn set_major_version<T>(mut self, v: T) -> Self
6617    where
6618        T: std::convert::Into<std::string::String>,
6619    {
6620        self.major_version = std::option::Option::Some(v.into());
6621        self
6622    }
6623
6624    /// Sets or clears the value of [major_version][crate::model::AvailableDatabaseVersion::major_version].
6625    pub fn set_or_clear_major_version<T>(mut self, v: std::option::Option<T>) -> Self
6626    where
6627        T: std::convert::Into<std::string::String>,
6628    {
6629        self.major_version = v.map(|x| x.into());
6630        self
6631    }
6632
6633    /// Sets the value of [name][crate::model::AvailableDatabaseVersion::name].
6634    pub fn set_name<T>(mut self, v: T) -> Self
6635    where
6636        T: std::convert::Into<std::string::String>,
6637    {
6638        self.name = std::option::Option::Some(v.into());
6639        self
6640    }
6641
6642    /// Sets or clears the value of [name][crate::model::AvailableDatabaseVersion::name].
6643    pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
6644    where
6645        T: std::convert::Into<std::string::String>,
6646    {
6647        self.name = v.map(|x| x.into());
6648        self
6649    }
6650
6651    /// Sets the value of [display_name][crate::model::AvailableDatabaseVersion::display_name].
6652    pub fn set_display_name<T>(mut self, v: T) -> Self
6653    where
6654        T: std::convert::Into<std::string::String>,
6655    {
6656        self.display_name = std::option::Option::Some(v.into());
6657        self
6658    }
6659
6660    /// Sets or clears the value of [display_name][crate::model::AvailableDatabaseVersion::display_name].
6661    pub fn set_or_clear_display_name<T>(mut self, v: std::option::Option<T>) -> Self
6662    where
6663        T: std::convert::Into<std::string::String>,
6664    {
6665        self.display_name = v.map(|x| x.into());
6666        self
6667    }
6668}
6669
6670impl wkt::message::Message for AvailableDatabaseVersion {
6671    fn typename() -> &'static str {
6672        "type.googleapis.com/google.cloud.sql.v1.AvailableDatabaseVersion"
6673    }
6674}
6675
6676/// Reschedule options for maintenance windows.
6677#[derive(Clone, Default, PartialEq)]
6678#[non_exhaustive]
6679pub struct SqlInstancesRescheduleMaintenanceRequestBody {
6680    /// Required. The type of the reschedule the user wants.
6681    pub reschedule: std::option::Option<
6682        crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
6683    >,
6684
6685    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6686}
6687
6688impl SqlInstancesRescheduleMaintenanceRequestBody {
6689    pub fn new() -> Self {
6690        std::default::Default::default()
6691    }
6692
6693    /// Sets the value of [reschedule][crate::model::SqlInstancesRescheduleMaintenanceRequestBody::reschedule].
6694    pub fn set_reschedule<T>(mut self, v: T) -> Self
6695    where
6696        T: std::convert::Into<
6697                crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
6698            >,
6699    {
6700        self.reschedule = std::option::Option::Some(v.into());
6701        self
6702    }
6703
6704    /// Sets or clears the value of [reschedule][crate::model::SqlInstancesRescheduleMaintenanceRequestBody::reschedule].
6705    pub fn set_or_clear_reschedule<T>(mut self, v: std::option::Option<T>) -> Self
6706    where
6707        T: std::convert::Into<
6708                crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
6709            >,
6710    {
6711        self.reschedule = v.map(|x| x.into());
6712        self
6713    }
6714}
6715
6716impl wkt::message::Message for SqlInstancesRescheduleMaintenanceRequestBody {
6717    fn typename() -> &'static str {
6718        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody"
6719    }
6720}
6721
6722/// Defines additional types related to [SqlInstancesRescheduleMaintenanceRequestBody].
6723pub mod sql_instances_reschedule_maintenance_request_body {
6724    #[allow(unused_imports)]
6725    use super::*;
6726
6727    #[derive(Clone, Default, PartialEq)]
6728    #[non_exhaustive]
6729    pub struct Reschedule {
6730        /// Required. The type of the reschedule.
6731        pub reschedule_type:
6732            crate::model::sql_instances_reschedule_maintenance_request_body::RescheduleType,
6733
6734        /// Optional. Timestamp when the maintenance shall be rescheduled to if
6735        /// reschedule_type=SPECIFIC_TIME, in
6736        /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
6737        /// `2012-11-15T16:19:00.094Z`.
6738        pub schedule_time: std::option::Option<wkt::Timestamp>,
6739
6740        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6741    }
6742
6743    impl Reschedule {
6744        pub fn new() -> Self {
6745            std::default::Default::default()
6746        }
6747
6748        /// Sets the value of [reschedule_type][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::reschedule_type].
6749        pub fn set_reschedule_type<
6750            T: std::convert::Into<
6751                    crate::model::sql_instances_reschedule_maintenance_request_body::RescheduleType,
6752                >,
6753        >(
6754            mut self,
6755            v: T,
6756        ) -> Self {
6757            self.reschedule_type = v.into();
6758            self
6759        }
6760
6761        /// Sets the value of [schedule_time][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::schedule_time].
6762        pub fn set_schedule_time<T>(mut self, v: T) -> Self
6763        where
6764            T: std::convert::Into<wkt::Timestamp>,
6765        {
6766            self.schedule_time = std::option::Option::Some(v.into());
6767            self
6768        }
6769
6770        /// Sets or clears the value of [schedule_time][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::schedule_time].
6771        pub fn set_or_clear_schedule_time<T>(mut self, v: std::option::Option<T>) -> Self
6772        where
6773            T: std::convert::Into<wkt::Timestamp>,
6774        {
6775            self.schedule_time = v.map(|x| x.into());
6776            self
6777        }
6778    }
6779
6780    impl wkt::message::Message for Reschedule {
6781        fn typename() -> &'static str {
6782            "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule"
6783        }
6784    }
6785
6786    ///
6787    /// # Working with unknown values
6788    ///
6789    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6790    /// additional enum variants at any time. Adding new variants is not considered
6791    /// a breaking change. Applications should write their code in anticipation of:
6792    ///
6793    /// - New values appearing in future releases of the client library, **and**
6794    /// - New values received dynamically, without application changes.
6795    ///
6796    /// Please consult the [Working with enums] section in the user guide for some
6797    /// guidelines.
6798    ///
6799    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6800    #[derive(Clone, Debug, PartialEq)]
6801    #[non_exhaustive]
6802    pub enum RescheduleType {
6803        Unspecified,
6804        /// Reschedules maintenance to happen now (within 5 minutes).
6805        Immediate,
6806        /// Reschedules maintenance to occur within one week from the originally
6807        /// scheduled day and time.
6808        NextAvailableWindow,
6809        /// Reschedules maintenance to a specific time and day.
6810        SpecificTime,
6811        /// If set, the enum was initialized with an unknown value.
6812        ///
6813        /// Applications can examine the value using [RescheduleType::value] or
6814        /// [RescheduleType::name].
6815        UnknownValue(reschedule_type::UnknownValue),
6816    }
6817
6818    #[doc(hidden)]
6819    pub mod reschedule_type {
6820        #[allow(unused_imports)]
6821        use super::*;
6822        #[derive(Clone, Debug, PartialEq)]
6823        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6824    }
6825
6826    impl RescheduleType {
6827        /// Gets the enum value.
6828        ///
6829        /// Returns `None` if the enum contains an unknown value deserialized from
6830        /// the string representation of enums.
6831        pub fn value(&self) -> std::option::Option<i32> {
6832            match self {
6833                Self::Unspecified => std::option::Option::Some(0),
6834                Self::Immediate => std::option::Option::Some(1),
6835                Self::NextAvailableWindow => std::option::Option::Some(2),
6836                Self::SpecificTime => std::option::Option::Some(3),
6837                Self::UnknownValue(u) => u.0.value(),
6838            }
6839        }
6840
6841        /// Gets the enum value as a string.
6842        ///
6843        /// Returns `None` if the enum contains an unknown value deserialized from
6844        /// the integer representation of enums.
6845        pub fn name(&self) -> std::option::Option<&str> {
6846            match self {
6847                Self::Unspecified => std::option::Option::Some("RESCHEDULE_TYPE_UNSPECIFIED"),
6848                Self::Immediate => std::option::Option::Some("IMMEDIATE"),
6849                Self::NextAvailableWindow => std::option::Option::Some("NEXT_AVAILABLE_WINDOW"),
6850                Self::SpecificTime => std::option::Option::Some("SPECIFIC_TIME"),
6851                Self::UnknownValue(u) => u.0.name(),
6852            }
6853        }
6854    }
6855
6856    impl std::default::Default for RescheduleType {
6857        fn default() -> Self {
6858            use std::convert::From;
6859            Self::from(0)
6860        }
6861    }
6862
6863    impl std::fmt::Display for RescheduleType {
6864        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6865            wkt::internal::display_enum(f, self.name(), self.value())
6866        }
6867    }
6868
6869    impl std::convert::From<i32> for RescheduleType {
6870        fn from(value: i32) -> Self {
6871            match value {
6872                0 => Self::Unspecified,
6873                1 => Self::Immediate,
6874                2 => Self::NextAvailableWindow,
6875                3 => Self::SpecificTime,
6876                _ => Self::UnknownValue(reschedule_type::UnknownValue(
6877                    wkt::internal::UnknownEnumValue::Integer(value),
6878                )),
6879            }
6880        }
6881    }
6882
6883    impl std::convert::From<&str> for RescheduleType {
6884        fn from(value: &str) -> Self {
6885            use std::string::ToString;
6886            match value {
6887                "RESCHEDULE_TYPE_UNSPECIFIED" => Self::Unspecified,
6888                "IMMEDIATE" => Self::Immediate,
6889                "NEXT_AVAILABLE_WINDOW" => Self::NextAvailableWindow,
6890                "SPECIFIC_TIME" => Self::SpecificTime,
6891                _ => Self::UnknownValue(reschedule_type::UnknownValue(
6892                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6893                )),
6894            }
6895        }
6896    }
6897
6898    impl serde::ser::Serialize for RescheduleType {
6899        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6900        where
6901            S: serde::Serializer,
6902        {
6903            match self {
6904                Self::Unspecified => serializer.serialize_i32(0),
6905                Self::Immediate => serializer.serialize_i32(1),
6906                Self::NextAvailableWindow => serializer.serialize_i32(2),
6907                Self::SpecificTime => serializer.serialize_i32(3),
6908                Self::UnknownValue(u) => u.0.serialize(serializer),
6909            }
6910        }
6911    }
6912
6913    impl<'de> serde::de::Deserialize<'de> for RescheduleType {
6914        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6915        where
6916            D: serde::Deserializer<'de>,
6917        {
6918            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RescheduleType>::new(
6919                ".google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType",
6920            ))
6921        }
6922    }
6923}
6924
6925/// Database instance demote primary instance context.
6926#[derive(Clone, Default, PartialEq)]
6927#[non_exhaustive]
6928pub struct DemoteMasterContext {
6929    /// This is always `sql#demoteMasterContext`.
6930    pub kind: std::string::String,
6931
6932    /// Verify the GTID consistency for demote operation. Default value:
6933    /// `True`. Setting this flag to `false` enables you to bypass the GTID
6934    /// consistency check between on-premises primary instance and Cloud SQL
6935    /// instance during the demotion operation but also exposes you to the risk of
6936    /// future replication failures. Change the value only if you know the reason
6937    /// for the GTID divergence and are confident that doing so will not cause any
6938    /// replication issues.
6939    pub verify_gtid_consistency: std::option::Option<wkt::BoolValue>,
6940
6941    /// The name of the instance which will act as on-premises primary instance
6942    /// in the replication setup.
6943    pub master_instance_name: std::string::String,
6944
6945    /// Configuration specific to read-replicas replicating from the on-premises
6946    /// primary instance.
6947    pub replica_configuration: std::option::Option<crate::model::DemoteMasterConfiguration>,
6948
6949    /// Flag to skip replication setup on the instance.
6950    pub skip_replication_setup: bool,
6951
6952    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6953}
6954
6955impl DemoteMasterContext {
6956    pub fn new() -> Self {
6957        std::default::Default::default()
6958    }
6959
6960    /// Sets the value of [kind][crate::model::DemoteMasterContext::kind].
6961    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6962        self.kind = v.into();
6963        self
6964    }
6965
6966    /// Sets the value of [verify_gtid_consistency][crate::model::DemoteMasterContext::verify_gtid_consistency].
6967    pub fn set_verify_gtid_consistency<T>(mut self, v: T) -> Self
6968    where
6969        T: std::convert::Into<wkt::BoolValue>,
6970    {
6971        self.verify_gtid_consistency = std::option::Option::Some(v.into());
6972        self
6973    }
6974
6975    /// Sets or clears the value of [verify_gtid_consistency][crate::model::DemoteMasterContext::verify_gtid_consistency].
6976    pub fn set_or_clear_verify_gtid_consistency<T>(mut self, v: std::option::Option<T>) -> Self
6977    where
6978        T: std::convert::Into<wkt::BoolValue>,
6979    {
6980        self.verify_gtid_consistency = v.map(|x| x.into());
6981        self
6982    }
6983
6984    /// Sets the value of [master_instance_name][crate::model::DemoteMasterContext::master_instance_name].
6985    pub fn set_master_instance_name<T: std::convert::Into<std::string::String>>(
6986        mut self,
6987        v: T,
6988    ) -> Self {
6989        self.master_instance_name = v.into();
6990        self
6991    }
6992
6993    /// Sets the value of [replica_configuration][crate::model::DemoteMasterContext::replica_configuration].
6994    pub fn set_replica_configuration<T>(mut self, v: T) -> Self
6995    where
6996        T: std::convert::Into<crate::model::DemoteMasterConfiguration>,
6997    {
6998        self.replica_configuration = std::option::Option::Some(v.into());
6999        self
7000    }
7001
7002    /// Sets or clears the value of [replica_configuration][crate::model::DemoteMasterContext::replica_configuration].
7003    pub fn set_or_clear_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
7004    where
7005        T: std::convert::Into<crate::model::DemoteMasterConfiguration>,
7006    {
7007        self.replica_configuration = v.map(|x| x.into());
7008        self
7009    }
7010
7011    /// Sets the value of [skip_replication_setup][crate::model::DemoteMasterContext::skip_replication_setup].
7012    pub fn set_skip_replication_setup<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7013        self.skip_replication_setup = v.into();
7014        self
7015    }
7016}
7017
7018impl wkt::message::Message for DemoteMasterContext {
7019    fn typename() -> &'static str {
7020        "type.googleapis.com/google.cloud.sql.v1.DemoteMasterContext"
7021    }
7022}
7023
7024/// This context is used to demote an existing standalone instance to be
7025/// a Cloud SQL read replica for an external database server.
7026#[derive(Clone, Default, PartialEq)]
7027#[non_exhaustive]
7028pub struct DemoteContext {
7029    /// This is always `sql#demoteContext`.
7030    pub kind: std::string::String,
7031
7032    /// Required. The name of the instance which acts as the on-premises primary
7033    /// instance in the replication setup.
7034    pub source_representative_instance_name: std::string::String,
7035
7036    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7037}
7038
7039impl DemoteContext {
7040    pub fn new() -> Self {
7041        std::default::Default::default()
7042    }
7043
7044    /// Sets the value of [kind][crate::model::DemoteContext::kind].
7045    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7046        self.kind = v.into();
7047        self
7048    }
7049
7050    /// Sets the value of [source_representative_instance_name][crate::model::DemoteContext::source_representative_instance_name].
7051    pub fn set_source_representative_instance_name<T: std::convert::Into<std::string::String>>(
7052        mut self,
7053        v: T,
7054    ) -> Self {
7055        self.source_representative_instance_name = v.into();
7056        self
7057    }
7058}
7059
7060impl wkt::message::Message for DemoteContext {
7061    fn typename() -> &'static str {
7062        "type.googleapis.com/google.cloud.sql.v1.DemoteContext"
7063    }
7064}
7065
7066/// Database instance failover context.
7067#[derive(Clone, Default, PartialEq)]
7068#[non_exhaustive]
7069pub struct FailoverContext {
7070    /// The current settings version of this instance. Request will be rejected if
7071    /// this version doesn't match the current settings version.
7072    pub settings_version: i64,
7073
7074    /// This is always `sql#failoverContext`.
7075    pub kind: std::string::String,
7076
7077    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7078}
7079
7080impl FailoverContext {
7081    pub fn new() -> Self {
7082        std::default::Default::default()
7083    }
7084
7085    /// Sets the value of [settings_version][crate::model::FailoverContext::settings_version].
7086    pub fn set_settings_version<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
7087        self.settings_version = v.into();
7088        self
7089    }
7090
7091    /// Sets the value of [kind][crate::model::FailoverContext::kind].
7092    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7093        self.kind = v.into();
7094        self
7095    }
7096}
7097
7098impl wkt::message::Message for FailoverContext {
7099    fn typename() -> &'static str {
7100        "type.googleapis.com/google.cloud.sql.v1.FailoverContext"
7101    }
7102}
7103
7104/// Database instance restore from backup context.
7105/// Backup context contains source instance id and project id.
7106#[derive(Clone, Default, PartialEq)]
7107#[non_exhaustive]
7108pub struct RestoreBackupContext {
7109    /// This is always `sql#restoreBackupContext`.
7110    pub kind: std::string::String,
7111
7112    /// The ID of the backup run to restore from.
7113    pub backup_run_id: i64,
7114
7115    /// The ID of the instance that the backup was taken from.
7116    pub instance_id: std::string::String,
7117
7118    /// The full project ID of the source instance.
7119    pub project: std::string::String,
7120
7121    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7122}
7123
7124impl RestoreBackupContext {
7125    pub fn new() -> Self {
7126        std::default::Default::default()
7127    }
7128
7129    /// Sets the value of [kind][crate::model::RestoreBackupContext::kind].
7130    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7131        self.kind = v.into();
7132        self
7133    }
7134
7135    /// Sets the value of [backup_run_id][crate::model::RestoreBackupContext::backup_run_id].
7136    pub fn set_backup_run_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
7137        self.backup_run_id = v.into();
7138        self
7139    }
7140
7141    /// Sets the value of [instance_id][crate::model::RestoreBackupContext::instance_id].
7142    pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7143        self.instance_id = v.into();
7144        self
7145    }
7146
7147    /// Sets the value of [project][crate::model::RestoreBackupContext::project].
7148    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7149        self.project = v.into();
7150        self
7151    }
7152}
7153
7154impl wkt::message::Message for RestoreBackupContext {
7155    fn typename() -> &'static str {
7156        "type.googleapis.com/google.cloud.sql.v1.RestoreBackupContext"
7157    }
7158}
7159
7160/// Instance rotate server CA context.
7161#[derive(Clone, Default, PartialEq)]
7162#[non_exhaustive]
7163pub struct RotateServerCaContext {
7164    /// This is always `sql#rotateServerCaContext`.
7165    pub kind: std::string::String,
7166
7167    /// The fingerprint of the next version to be rotated to. If left unspecified,
7168    /// will be rotated to the most recently added server CA version.
7169    pub next_version: std::string::String,
7170
7171    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7172}
7173
7174impl RotateServerCaContext {
7175    pub fn new() -> Self {
7176        std::default::Default::default()
7177    }
7178
7179    /// Sets the value of [kind][crate::model::RotateServerCaContext::kind].
7180    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7181        self.kind = v.into();
7182        self
7183    }
7184
7185    /// Sets the value of [next_version][crate::model::RotateServerCaContext::next_version].
7186    pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7187        self.next_version = v.into();
7188        self
7189    }
7190}
7191
7192impl wkt::message::Message for RotateServerCaContext {
7193    fn typename() -> &'static str {
7194        "type.googleapis.com/google.cloud.sql.v1.RotateServerCaContext"
7195    }
7196}
7197
7198/// Database Instance truncate log context.
7199#[derive(Clone, Default, PartialEq)]
7200#[non_exhaustive]
7201pub struct TruncateLogContext {
7202    /// This is always `sql#truncateLogContext`.
7203    pub kind: std::string::String,
7204
7205    /// The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and
7206    /// `MYSQL_SLOW_TABLE`.
7207    pub log_type: std::string::String,
7208
7209    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7210}
7211
7212impl TruncateLogContext {
7213    pub fn new() -> Self {
7214        std::default::Default::default()
7215    }
7216
7217    /// Sets the value of [kind][crate::model::TruncateLogContext::kind].
7218    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7219        self.kind = v.into();
7220        self
7221    }
7222
7223    /// Sets the value of [log_type][crate::model::TruncateLogContext::log_type].
7224    pub fn set_log_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7225        self.log_type = v.into();
7226        self
7227    }
7228}
7229
7230impl wkt::message::Message for TruncateLogContext {
7231    fn typename() -> &'static str {
7232        "type.googleapis.com/google.cloud.sql.v1.TruncateLogContext"
7233    }
7234}
7235
7236/// External primary instance migration setting error/warning.
7237#[derive(Clone, Default, PartialEq)]
7238#[non_exhaustive]
7239pub struct SqlExternalSyncSettingError {
7240    /// Can be `sql#externalSyncSettingError` or
7241    /// `sql#externalSyncSettingWarning`.
7242    pub kind: std::string::String,
7243
7244    /// Identifies the specific error that occurred.
7245    pub r#type: crate::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType,
7246
7247    /// Additional information about the error encountered.
7248    pub detail: std::string::String,
7249
7250    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7251}
7252
7253impl SqlExternalSyncSettingError {
7254    pub fn new() -> Self {
7255        std::default::Default::default()
7256    }
7257
7258    /// Sets the value of [kind][crate::model::SqlExternalSyncSettingError::kind].
7259    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7260        self.kind = v.into();
7261        self
7262    }
7263
7264    /// Sets the value of [r#type][crate::model::SqlExternalSyncSettingError::type].
7265    pub fn set_type<
7266        T: std::convert::Into<
7267                crate::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType,
7268            >,
7269    >(
7270        mut self,
7271        v: T,
7272    ) -> Self {
7273        self.r#type = v.into();
7274        self
7275    }
7276
7277    /// Sets the value of [detail][crate::model::SqlExternalSyncSettingError::detail].
7278    pub fn set_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7279        self.detail = v.into();
7280        self
7281    }
7282}
7283
7284impl wkt::message::Message for SqlExternalSyncSettingError {
7285    fn typename() -> &'static str {
7286        "type.googleapis.com/google.cloud.sql.v1.SqlExternalSyncSettingError"
7287    }
7288}
7289
7290/// Defines additional types related to [SqlExternalSyncSettingError].
7291pub mod sql_external_sync_setting_error {
7292    #[allow(unused_imports)]
7293    use super::*;
7294
7295    ///
7296    /// # Working with unknown values
7297    ///
7298    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7299    /// additional enum variants at any time. Adding new variants is not considered
7300    /// a breaking change. Applications should write their code in anticipation of:
7301    ///
7302    /// - New values appearing in future releases of the client library, **and**
7303    /// - New values received dynamically, without application changes.
7304    ///
7305    /// Please consult the [Working with enums] section in the user guide for some
7306    /// guidelines.
7307    ///
7308    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7309    #[derive(Clone, Debug, PartialEq)]
7310    #[non_exhaustive]
7311    pub enum SqlExternalSyncSettingErrorType {
7312        Unspecified,
7313        ConnectionFailure,
7314        BinlogNotEnabled,
7315        IncompatibleDatabaseVersion,
7316        ReplicaAlreadySetup,
7317        /// The replication user is missing privileges that are required.
7318        InsufficientPrivilege,
7319        /// Unsupported migration type.
7320        UnsupportedMigrationType,
7321        /// No pglogical extension installed on databases, applicable for postgres.
7322        NoPglogicalInstalled,
7323        /// pglogical node already exists on databases, applicable for postgres.
7324        PglogicalNodeAlreadyExists,
7325        /// The value of parameter wal_level is not set to logical.
7326        InvalidWalLevel,
7327        /// The value of parameter shared_preload_libraries does not include
7328        /// pglogical.
7329        InvalidSharedPreloadLibrary,
7330        /// The value of parameter max_replication_slots is not sufficient.
7331        InsufficientMaxReplicationSlots,
7332        /// The value of parameter max_wal_senders is not sufficient.
7333        InsufficientMaxWalSenders,
7334        /// The value of parameter max_worker_processes is not sufficient.
7335        InsufficientMaxWorkerProcesses,
7336        /// Extensions installed are either not supported or having unsupported
7337        /// versions.
7338        UnsupportedExtensions,
7339        /// The value of parameter rds.logical_replication is not set to 1.
7340        InvalidRdsLogicalReplication,
7341        /// The primary instance logging setup doesn't allow EM sync.
7342        InvalidLoggingSetup,
7343        /// The primary instance database parameter setup doesn't allow EM sync.
7344        InvalidDbParam,
7345        /// The gtid_mode is not supported, applicable for MySQL.
7346        UnsupportedGtidMode,
7347        /// SQL Server Agent is not running.
7348        SqlserverAgentNotRunning,
7349        /// The table definition is not support due to missing primary key or replica
7350        /// identity, applicable for postgres.
7351        UnsupportedTableDefinition,
7352        /// The customer has a definer that will break EM setup.
7353        UnsupportedDefiner,
7354        /// SQL Server @@SERVERNAME does not match actual host name.
7355        SqlserverServernameMismatch,
7356        /// The primary instance has been setup and will fail the setup.
7357        PrimaryAlreadySetup,
7358        /// The primary instance has unsupported binary log format.
7359        UnsupportedBinlogFormat,
7360        /// The primary instance's binary log retention setting.
7361        BinlogRetentionSetting,
7362        /// The primary instance has tables with unsupported storage engine.
7363        UnsupportedStorageEngine,
7364        /// Source has tables with limited support
7365        /// eg: PostgreSQL tables without primary keys.
7366        LimitedSupportTables,
7367        /// The replica instance contains existing data.
7368        ExistingDataInReplica,
7369        /// The replication user is missing privileges that are optional.
7370        MissingOptionalPrivileges,
7371        /// Additional BACKUP_ADMIN privilege is granted to the replication user
7372        /// which may lock source MySQL 8 instance for DDLs during initial sync.
7373        RiskyBackupAdminPrivilege,
7374        /// The Cloud Storage bucket is missing necessary permissions.
7375        InsufficientGcsPermissions,
7376        /// The Cloud Storage bucket has an error in the file or contains invalid
7377        /// file information.
7378        InvalidFileInfo,
7379        /// The source instance has unsupported database settings for migration.
7380        UnsupportedDatabaseSettings,
7381        /// The replication user is missing parallel import specific privileges.
7382        /// (e.g. LOCK TABLES) for MySQL.
7383        MysqlParallelImportInsufficientPrivilege,
7384        /// The global variable local_infile is off on external server replica.
7385        LocalInfileOff,
7386        /// This code instructs customers to turn on point-in-time recovery manually
7387        /// for the instance after promoting the Cloud SQL for PostgreSQL instance.
7388        TurnOnPitrAfterPromote,
7389        /// The minor version of replica database is incompatible with the source.
7390        IncompatibleDatabaseMinorVersion,
7391        /// This warning message indicates that Cloud SQL uses the maximum number of
7392        /// subscriptions to migrate data from the source to the destination.
7393        SourceMaxSubscriptions,
7394        /// Unable to verify definers on the source for MySQL.
7395        UnableToVerifyDefiners,
7396        /// If a time out occurs while the subscription counts are calculated, then
7397        /// this value is set to 1. Otherwise, this value is set to 2.
7398        SubscriptionCalculationStatus,
7399        /// Count of subscriptions needed to sync source data for PostgreSQL
7400        /// database.
7401        PgSubscriptionCount,
7402        /// Final parallel level that is used to do migration.
7403        PgSyncParallelLevel,
7404        /// The disk size of the replica instance is smaller than the data size of
7405        /// the source instance.
7406        InsufficientDiskSize,
7407        /// The data size of the source instance is greater than 1 TB, the number of
7408        /// cores of the replica instance is less than 8, and the memory of the
7409        /// replica is less than 32 GB.
7410        InsufficientMachineTier,
7411        /// The warning message indicates the unsupported extensions will not be
7412        /// migrated to the destination.
7413        UnsupportedExtensionsNotMigrated,
7414        /// The warning message indicates the pg_cron extension and settings will not
7415        /// be migrated to the destination.
7416        ExtensionsNotMigrated,
7417        /// The error message indicates that pg_cron flags are enabled on the
7418        /// destination which is not supported during the migration.
7419        PgCronFlagEnabledInReplica,
7420        /// This error message indicates that the specified extensions are not
7421        /// enabled on destination instance. For example, before you can migrate
7422        /// data to the destination instance, you must enable the PGAudit extension
7423        /// on the instance.
7424        ExtensionsNotEnabledInReplica,
7425        /// The source database has generated columns that can't be migrated. Please
7426        /// change them to regular columns before migration.
7427        UnsupportedColumns,
7428        /// If set, the enum was initialized with an unknown value.
7429        ///
7430        /// Applications can examine the value using [SqlExternalSyncSettingErrorType::value] or
7431        /// [SqlExternalSyncSettingErrorType::name].
7432        UnknownValue(sql_external_sync_setting_error_type::UnknownValue),
7433    }
7434
7435    #[doc(hidden)]
7436    pub mod sql_external_sync_setting_error_type {
7437        #[allow(unused_imports)]
7438        use super::*;
7439        #[derive(Clone, Debug, PartialEq)]
7440        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7441    }
7442
7443    impl SqlExternalSyncSettingErrorType {
7444        /// Gets the enum value.
7445        ///
7446        /// Returns `None` if the enum contains an unknown value deserialized from
7447        /// the string representation of enums.
7448        pub fn value(&self) -> std::option::Option<i32> {
7449            match self {
7450                Self::Unspecified => std::option::Option::Some(0),
7451                Self::ConnectionFailure => std::option::Option::Some(1),
7452                Self::BinlogNotEnabled => std::option::Option::Some(2),
7453                Self::IncompatibleDatabaseVersion => std::option::Option::Some(3),
7454                Self::ReplicaAlreadySetup => std::option::Option::Some(4),
7455                Self::InsufficientPrivilege => std::option::Option::Some(5),
7456                Self::UnsupportedMigrationType => std::option::Option::Some(6),
7457                Self::NoPglogicalInstalled => std::option::Option::Some(7),
7458                Self::PglogicalNodeAlreadyExists => std::option::Option::Some(8),
7459                Self::InvalidWalLevel => std::option::Option::Some(9),
7460                Self::InvalidSharedPreloadLibrary => std::option::Option::Some(10),
7461                Self::InsufficientMaxReplicationSlots => std::option::Option::Some(11),
7462                Self::InsufficientMaxWalSenders => std::option::Option::Some(12),
7463                Self::InsufficientMaxWorkerProcesses => std::option::Option::Some(13),
7464                Self::UnsupportedExtensions => std::option::Option::Some(14),
7465                Self::InvalidRdsLogicalReplication => std::option::Option::Some(15),
7466                Self::InvalidLoggingSetup => std::option::Option::Some(16),
7467                Self::InvalidDbParam => std::option::Option::Some(17),
7468                Self::UnsupportedGtidMode => std::option::Option::Some(18),
7469                Self::SqlserverAgentNotRunning => std::option::Option::Some(19),
7470                Self::UnsupportedTableDefinition => std::option::Option::Some(20),
7471                Self::UnsupportedDefiner => std::option::Option::Some(21),
7472                Self::SqlserverServernameMismatch => std::option::Option::Some(22),
7473                Self::PrimaryAlreadySetup => std::option::Option::Some(23),
7474                Self::UnsupportedBinlogFormat => std::option::Option::Some(24),
7475                Self::BinlogRetentionSetting => std::option::Option::Some(25),
7476                Self::UnsupportedStorageEngine => std::option::Option::Some(26),
7477                Self::LimitedSupportTables => std::option::Option::Some(27),
7478                Self::ExistingDataInReplica => std::option::Option::Some(28),
7479                Self::MissingOptionalPrivileges => std::option::Option::Some(29),
7480                Self::RiskyBackupAdminPrivilege => std::option::Option::Some(30),
7481                Self::InsufficientGcsPermissions => std::option::Option::Some(31),
7482                Self::InvalidFileInfo => std::option::Option::Some(32),
7483                Self::UnsupportedDatabaseSettings => std::option::Option::Some(33),
7484                Self::MysqlParallelImportInsufficientPrivilege => std::option::Option::Some(34),
7485                Self::LocalInfileOff => std::option::Option::Some(35),
7486                Self::TurnOnPitrAfterPromote => std::option::Option::Some(36),
7487                Self::IncompatibleDatabaseMinorVersion => std::option::Option::Some(37),
7488                Self::SourceMaxSubscriptions => std::option::Option::Some(38),
7489                Self::UnableToVerifyDefiners => std::option::Option::Some(39),
7490                Self::SubscriptionCalculationStatus => std::option::Option::Some(40),
7491                Self::PgSubscriptionCount => std::option::Option::Some(41),
7492                Self::PgSyncParallelLevel => std::option::Option::Some(42),
7493                Self::InsufficientDiskSize => std::option::Option::Some(43),
7494                Self::InsufficientMachineTier => std::option::Option::Some(44),
7495                Self::UnsupportedExtensionsNotMigrated => std::option::Option::Some(45),
7496                Self::ExtensionsNotMigrated => std::option::Option::Some(46),
7497                Self::PgCronFlagEnabledInReplica => std::option::Option::Some(47),
7498                Self::ExtensionsNotEnabledInReplica => std::option::Option::Some(48),
7499                Self::UnsupportedColumns => std::option::Option::Some(49),
7500                Self::UnknownValue(u) => u.0.value(),
7501            }
7502        }
7503
7504        /// Gets the enum value as a string.
7505        ///
7506        /// Returns `None` if the enum contains an unknown value deserialized from
7507        /// the integer representation of enums.
7508        pub fn name(&self) -> std::option::Option<&str> {
7509            match self {
7510                Self::Unspecified => {
7511                    std::option::Option::Some("SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED")
7512                }
7513                Self::ConnectionFailure => std::option::Option::Some("CONNECTION_FAILURE"),
7514                Self::BinlogNotEnabled => std::option::Option::Some("BINLOG_NOT_ENABLED"),
7515                Self::IncompatibleDatabaseVersion => {
7516                    std::option::Option::Some("INCOMPATIBLE_DATABASE_VERSION")
7517                }
7518                Self::ReplicaAlreadySetup => std::option::Option::Some("REPLICA_ALREADY_SETUP"),
7519                Self::InsufficientPrivilege => std::option::Option::Some("INSUFFICIENT_PRIVILEGE"),
7520                Self::UnsupportedMigrationType => {
7521                    std::option::Option::Some("UNSUPPORTED_MIGRATION_TYPE")
7522                }
7523                Self::NoPglogicalInstalled => std::option::Option::Some("NO_PGLOGICAL_INSTALLED"),
7524                Self::PglogicalNodeAlreadyExists => {
7525                    std::option::Option::Some("PGLOGICAL_NODE_ALREADY_EXISTS")
7526                }
7527                Self::InvalidWalLevel => std::option::Option::Some("INVALID_WAL_LEVEL"),
7528                Self::InvalidSharedPreloadLibrary => {
7529                    std::option::Option::Some("INVALID_SHARED_PRELOAD_LIBRARY")
7530                }
7531                Self::InsufficientMaxReplicationSlots => {
7532                    std::option::Option::Some("INSUFFICIENT_MAX_REPLICATION_SLOTS")
7533                }
7534                Self::InsufficientMaxWalSenders => {
7535                    std::option::Option::Some("INSUFFICIENT_MAX_WAL_SENDERS")
7536                }
7537                Self::InsufficientMaxWorkerProcesses => {
7538                    std::option::Option::Some("INSUFFICIENT_MAX_WORKER_PROCESSES")
7539                }
7540                Self::UnsupportedExtensions => std::option::Option::Some("UNSUPPORTED_EXTENSIONS"),
7541                Self::InvalidRdsLogicalReplication => {
7542                    std::option::Option::Some("INVALID_RDS_LOGICAL_REPLICATION")
7543                }
7544                Self::InvalidLoggingSetup => std::option::Option::Some("INVALID_LOGGING_SETUP"),
7545                Self::InvalidDbParam => std::option::Option::Some("INVALID_DB_PARAM"),
7546                Self::UnsupportedGtidMode => std::option::Option::Some("UNSUPPORTED_GTID_MODE"),
7547                Self::SqlserverAgentNotRunning => {
7548                    std::option::Option::Some("SQLSERVER_AGENT_NOT_RUNNING")
7549                }
7550                Self::UnsupportedTableDefinition => {
7551                    std::option::Option::Some("UNSUPPORTED_TABLE_DEFINITION")
7552                }
7553                Self::UnsupportedDefiner => std::option::Option::Some("UNSUPPORTED_DEFINER"),
7554                Self::SqlserverServernameMismatch => {
7555                    std::option::Option::Some("SQLSERVER_SERVERNAME_MISMATCH")
7556                }
7557                Self::PrimaryAlreadySetup => std::option::Option::Some("PRIMARY_ALREADY_SETUP"),
7558                Self::UnsupportedBinlogFormat => {
7559                    std::option::Option::Some("UNSUPPORTED_BINLOG_FORMAT")
7560                }
7561                Self::BinlogRetentionSetting => {
7562                    std::option::Option::Some("BINLOG_RETENTION_SETTING")
7563                }
7564                Self::UnsupportedStorageEngine => {
7565                    std::option::Option::Some("UNSUPPORTED_STORAGE_ENGINE")
7566                }
7567                Self::LimitedSupportTables => std::option::Option::Some("LIMITED_SUPPORT_TABLES"),
7568                Self::ExistingDataInReplica => {
7569                    std::option::Option::Some("EXISTING_DATA_IN_REPLICA")
7570                }
7571                Self::MissingOptionalPrivileges => {
7572                    std::option::Option::Some("MISSING_OPTIONAL_PRIVILEGES")
7573                }
7574                Self::RiskyBackupAdminPrivilege => {
7575                    std::option::Option::Some("RISKY_BACKUP_ADMIN_PRIVILEGE")
7576                }
7577                Self::InsufficientGcsPermissions => {
7578                    std::option::Option::Some("INSUFFICIENT_GCS_PERMISSIONS")
7579                }
7580                Self::InvalidFileInfo => std::option::Option::Some("INVALID_FILE_INFO"),
7581                Self::UnsupportedDatabaseSettings => {
7582                    std::option::Option::Some("UNSUPPORTED_DATABASE_SETTINGS")
7583                }
7584                Self::MysqlParallelImportInsufficientPrivilege => {
7585                    std::option::Option::Some("MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE")
7586                }
7587                Self::LocalInfileOff => std::option::Option::Some("LOCAL_INFILE_OFF"),
7588                Self::TurnOnPitrAfterPromote => {
7589                    std::option::Option::Some("TURN_ON_PITR_AFTER_PROMOTE")
7590                }
7591                Self::IncompatibleDatabaseMinorVersion => {
7592                    std::option::Option::Some("INCOMPATIBLE_DATABASE_MINOR_VERSION")
7593                }
7594                Self::SourceMaxSubscriptions => {
7595                    std::option::Option::Some("SOURCE_MAX_SUBSCRIPTIONS")
7596                }
7597                Self::UnableToVerifyDefiners => {
7598                    std::option::Option::Some("UNABLE_TO_VERIFY_DEFINERS")
7599                }
7600                Self::SubscriptionCalculationStatus => {
7601                    std::option::Option::Some("SUBSCRIPTION_CALCULATION_STATUS")
7602                }
7603                Self::PgSubscriptionCount => std::option::Option::Some("PG_SUBSCRIPTION_COUNT"),
7604                Self::PgSyncParallelLevel => std::option::Option::Some("PG_SYNC_PARALLEL_LEVEL"),
7605                Self::InsufficientDiskSize => std::option::Option::Some("INSUFFICIENT_DISK_SIZE"),
7606                Self::InsufficientMachineTier => {
7607                    std::option::Option::Some("INSUFFICIENT_MACHINE_TIER")
7608                }
7609                Self::UnsupportedExtensionsNotMigrated => {
7610                    std::option::Option::Some("UNSUPPORTED_EXTENSIONS_NOT_MIGRATED")
7611                }
7612                Self::ExtensionsNotMigrated => std::option::Option::Some("EXTENSIONS_NOT_MIGRATED"),
7613                Self::PgCronFlagEnabledInReplica => {
7614                    std::option::Option::Some("PG_CRON_FLAG_ENABLED_IN_REPLICA")
7615                }
7616                Self::ExtensionsNotEnabledInReplica => {
7617                    std::option::Option::Some("EXTENSIONS_NOT_ENABLED_IN_REPLICA")
7618                }
7619                Self::UnsupportedColumns => std::option::Option::Some("UNSUPPORTED_COLUMNS"),
7620                Self::UnknownValue(u) => u.0.name(),
7621            }
7622        }
7623    }
7624
7625    impl std::default::Default for SqlExternalSyncSettingErrorType {
7626        fn default() -> Self {
7627            use std::convert::From;
7628            Self::from(0)
7629        }
7630    }
7631
7632    impl std::fmt::Display for SqlExternalSyncSettingErrorType {
7633        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7634            wkt::internal::display_enum(f, self.name(), self.value())
7635        }
7636    }
7637
7638    impl std::convert::From<i32> for SqlExternalSyncSettingErrorType {
7639        fn from(value: i32) -> Self {
7640            match value {
7641                0 => Self::Unspecified,
7642                1 => Self::ConnectionFailure,
7643                2 => Self::BinlogNotEnabled,
7644                3 => Self::IncompatibleDatabaseVersion,
7645                4 => Self::ReplicaAlreadySetup,
7646                5 => Self::InsufficientPrivilege,
7647                6 => Self::UnsupportedMigrationType,
7648                7 => Self::NoPglogicalInstalled,
7649                8 => Self::PglogicalNodeAlreadyExists,
7650                9 => Self::InvalidWalLevel,
7651                10 => Self::InvalidSharedPreloadLibrary,
7652                11 => Self::InsufficientMaxReplicationSlots,
7653                12 => Self::InsufficientMaxWalSenders,
7654                13 => Self::InsufficientMaxWorkerProcesses,
7655                14 => Self::UnsupportedExtensions,
7656                15 => Self::InvalidRdsLogicalReplication,
7657                16 => Self::InvalidLoggingSetup,
7658                17 => Self::InvalidDbParam,
7659                18 => Self::UnsupportedGtidMode,
7660                19 => Self::SqlserverAgentNotRunning,
7661                20 => Self::UnsupportedTableDefinition,
7662                21 => Self::UnsupportedDefiner,
7663                22 => Self::SqlserverServernameMismatch,
7664                23 => Self::PrimaryAlreadySetup,
7665                24 => Self::UnsupportedBinlogFormat,
7666                25 => Self::BinlogRetentionSetting,
7667                26 => Self::UnsupportedStorageEngine,
7668                27 => Self::LimitedSupportTables,
7669                28 => Self::ExistingDataInReplica,
7670                29 => Self::MissingOptionalPrivileges,
7671                30 => Self::RiskyBackupAdminPrivilege,
7672                31 => Self::InsufficientGcsPermissions,
7673                32 => Self::InvalidFileInfo,
7674                33 => Self::UnsupportedDatabaseSettings,
7675                34 => Self::MysqlParallelImportInsufficientPrivilege,
7676                35 => Self::LocalInfileOff,
7677                36 => Self::TurnOnPitrAfterPromote,
7678                37 => Self::IncompatibleDatabaseMinorVersion,
7679                38 => Self::SourceMaxSubscriptions,
7680                39 => Self::UnableToVerifyDefiners,
7681                40 => Self::SubscriptionCalculationStatus,
7682                41 => Self::PgSubscriptionCount,
7683                42 => Self::PgSyncParallelLevel,
7684                43 => Self::InsufficientDiskSize,
7685                44 => Self::InsufficientMachineTier,
7686                45 => Self::UnsupportedExtensionsNotMigrated,
7687                46 => Self::ExtensionsNotMigrated,
7688                47 => Self::PgCronFlagEnabledInReplica,
7689                48 => Self::ExtensionsNotEnabledInReplica,
7690                49 => Self::UnsupportedColumns,
7691                _ => Self::UnknownValue(sql_external_sync_setting_error_type::UnknownValue(
7692                    wkt::internal::UnknownEnumValue::Integer(value),
7693                )),
7694            }
7695        }
7696    }
7697
7698    impl std::convert::From<&str> for SqlExternalSyncSettingErrorType {
7699        fn from(value: &str) -> Self {
7700            use std::string::ToString;
7701            match value {
7702                "SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED" => Self::Unspecified,
7703                "CONNECTION_FAILURE" => Self::ConnectionFailure,
7704                "BINLOG_NOT_ENABLED" => Self::BinlogNotEnabled,
7705                "INCOMPATIBLE_DATABASE_VERSION" => Self::IncompatibleDatabaseVersion,
7706                "REPLICA_ALREADY_SETUP" => Self::ReplicaAlreadySetup,
7707                "INSUFFICIENT_PRIVILEGE" => Self::InsufficientPrivilege,
7708                "UNSUPPORTED_MIGRATION_TYPE" => Self::UnsupportedMigrationType,
7709                "NO_PGLOGICAL_INSTALLED" => Self::NoPglogicalInstalled,
7710                "PGLOGICAL_NODE_ALREADY_EXISTS" => Self::PglogicalNodeAlreadyExists,
7711                "INVALID_WAL_LEVEL" => Self::InvalidWalLevel,
7712                "INVALID_SHARED_PRELOAD_LIBRARY" => Self::InvalidSharedPreloadLibrary,
7713                "INSUFFICIENT_MAX_REPLICATION_SLOTS" => Self::InsufficientMaxReplicationSlots,
7714                "INSUFFICIENT_MAX_WAL_SENDERS" => Self::InsufficientMaxWalSenders,
7715                "INSUFFICIENT_MAX_WORKER_PROCESSES" => Self::InsufficientMaxWorkerProcesses,
7716                "UNSUPPORTED_EXTENSIONS" => Self::UnsupportedExtensions,
7717                "INVALID_RDS_LOGICAL_REPLICATION" => Self::InvalidRdsLogicalReplication,
7718                "INVALID_LOGGING_SETUP" => Self::InvalidLoggingSetup,
7719                "INVALID_DB_PARAM" => Self::InvalidDbParam,
7720                "UNSUPPORTED_GTID_MODE" => Self::UnsupportedGtidMode,
7721                "SQLSERVER_AGENT_NOT_RUNNING" => Self::SqlserverAgentNotRunning,
7722                "UNSUPPORTED_TABLE_DEFINITION" => Self::UnsupportedTableDefinition,
7723                "UNSUPPORTED_DEFINER" => Self::UnsupportedDefiner,
7724                "SQLSERVER_SERVERNAME_MISMATCH" => Self::SqlserverServernameMismatch,
7725                "PRIMARY_ALREADY_SETUP" => Self::PrimaryAlreadySetup,
7726                "UNSUPPORTED_BINLOG_FORMAT" => Self::UnsupportedBinlogFormat,
7727                "BINLOG_RETENTION_SETTING" => Self::BinlogRetentionSetting,
7728                "UNSUPPORTED_STORAGE_ENGINE" => Self::UnsupportedStorageEngine,
7729                "LIMITED_SUPPORT_TABLES" => Self::LimitedSupportTables,
7730                "EXISTING_DATA_IN_REPLICA" => Self::ExistingDataInReplica,
7731                "MISSING_OPTIONAL_PRIVILEGES" => Self::MissingOptionalPrivileges,
7732                "RISKY_BACKUP_ADMIN_PRIVILEGE" => Self::RiskyBackupAdminPrivilege,
7733                "INSUFFICIENT_GCS_PERMISSIONS" => Self::InsufficientGcsPermissions,
7734                "INVALID_FILE_INFO" => Self::InvalidFileInfo,
7735                "UNSUPPORTED_DATABASE_SETTINGS" => Self::UnsupportedDatabaseSettings,
7736                "MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE" => {
7737                    Self::MysqlParallelImportInsufficientPrivilege
7738                }
7739                "LOCAL_INFILE_OFF" => Self::LocalInfileOff,
7740                "TURN_ON_PITR_AFTER_PROMOTE" => Self::TurnOnPitrAfterPromote,
7741                "INCOMPATIBLE_DATABASE_MINOR_VERSION" => Self::IncompatibleDatabaseMinorVersion,
7742                "SOURCE_MAX_SUBSCRIPTIONS" => Self::SourceMaxSubscriptions,
7743                "UNABLE_TO_VERIFY_DEFINERS" => Self::UnableToVerifyDefiners,
7744                "SUBSCRIPTION_CALCULATION_STATUS" => Self::SubscriptionCalculationStatus,
7745                "PG_SUBSCRIPTION_COUNT" => Self::PgSubscriptionCount,
7746                "PG_SYNC_PARALLEL_LEVEL" => Self::PgSyncParallelLevel,
7747                "INSUFFICIENT_DISK_SIZE" => Self::InsufficientDiskSize,
7748                "INSUFFICIENT_MACHINE_TIER" => Self::InsufficientMachineTier,
7749                "UNSUPPORTED_EXTENSIONS_NOT_MIGRATED" => Self::UnsupportedExtensionsNotMigrated,
7750                "EXTENSIONS_NOT_MIGRATED" => Self::ExtensionsNotMigrated,
7751                "PG_CRON_FLAG_ENABLED_IN_REPLICA" => Self::PgCronFlagEnabledInReplica,
7752                "EXTENSIONS_NOT_ENABLED_IN_REPLICA" => Self::ExtensionsNotEnabledInReplica,
7753                "UNSUPPORTED_COLUMNS" => Self::UnsupportedColumns,
7754                _ => Self::UnknownValue(sql_external_sync_setting_error_type::UnknownValue(
7755                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7756                )),
7757            }
7758        }
7759    }
7760
7761    impl serde::ser::Serialize for SqlExternalSyncSettingErrorType {
7762        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7763        where
7764            S: serde::Serializer,
7765        {
7766            match self {
7767                Self::Unspecified => serializer.serialize_i32(0),
7768                Self::ConnectionFailure => serializer.serialize_i32(1),
7769                Self::BinlogNotEnabled => serializer.serialize_i32(2),
7770                Self::IncompatibleDatabaseVersion => serializer.serialize_i32(3),
7771                Self::ReplicaAlreadySetup => serializer.serialize_i32(4),
7772                Self::InsufficientPrivilege => serializer.serialize_i32(5),
7773                Self::UnsupportedMigrationType => serializer.serialize_i32(6),
7774                Self::NoPglogicalInstalled => serializer.serialize_i32(7),
7775                Self::PglogicalNodeAlreadyExists => serializer.serialize_i32(8),
7776                Self::InvalidWalLevel => serializer.serialize_i32(9),
7777                Self::InvalidSharedPreloadLibrary => serializer.serialize_i32(10),
7778                Self::InsufficientMaxReplicationSlots => serializer.serialize_i32(11),
7779                Self::InsufficientMaxWalSenders => serializer.serialize_i32(12),
7780                Self::InsufficientMaxWorkerProcesses => serializer.serialize_i32(13),
7781                Self::UnsupportedExtensions => serializer.serialize_i32(14),
7782                Self::InvalidRdsLogicalReplication => serializer.serialize_i32(15),
7783                Self::InvalidLoggingSetup => serializer.serialize_i32(16),
7784                Self::InvalidDbParam => serializer.serialize_i32(17),
7785                Self::UnsupportedGtidMode => serializer.serialize_i32(18),
7786                Self::SqlserverAgentNotRunning => serializer.serialize_i32(19),
7787                Self::UnsupportedTableDefinition => serializer.serialize_i32(20),
7788                Self::UnsupportedDefiner => serializer.serialize_i32(21),
7789                Self::SqlserverServernameMismatch => serializer.serialize_i32(22),
7790                Self::PrimaryAlreadySetup => serializer.serialize_i32(23),
7791                Self::UnsupportedBinlogFormat => serializer.serialize_i32(24),
7792                Self::BinlogRetentionSetting => serializer.serialize_i32(25),
7793                Self::UnsupportedStorageEngine => serializer.serialize_i32(26),
7794                Self::LimitedSupportTables => serializer.serialize_i32(27),
7795                Self::ExistingDataInReplica => serializer.serialize_i32(28),
7796                Self::MissingOptionalPrivileges => serializer.serialize_i32(29),
7797                Self::RiskyBackupAdminPrivilege => serializer.serialize_i32(30),
7798                Self::InsufficientGcsPermissions => serializer.serialize_i32(31),
7799                Self::InvalidFileInfo => serializer.serialize_i32(32),
7800                Self::UnsupportedDatabaseSettings => serializer.serialize_i32(33),
7801                Self::MysqlParallelImportInsufficientPrivilege => serializer.serialize_i32(34),
7802                Self::LocalInfileOff => serializer.serialize_i32(35),
7803                Self::TurnOnPitrAfterPromote => serializer.serialize_i32(36),
7804                Self::IncompatibleDatabaseMinorVersion => serializer.serialize_i32(37),
7805                Self::SourceMaxSubscriptions => serializer.serialize_i32(38),
7806                Self::UnableToVerifyDefiners => serializer.serialize_i32(39),
7807                Self::SubscriptionCalculationStatus => serializer.serialize_i32(40),
7808                Self::PgSubscriptionCount => serializer.serialize_i32(41),
7809                Self::PgSyncParallelLevel => serializer.serialize_i32(42),
7810                Self::InsufficientDiskSize => serializer.serialize_i32(43),
7811                Self::InsufficientMachineTier => serializer.serialize_i32(44),
7812                Self::UnsupportedExtensionsNotMigrated => serializer.serialize_i32(45),
7813                Self::ExtensionsNotMigrated => serializer.serialize_i32(46),
7814                Self::PgCronFlagEnabledInReplica => serializer.serialize_i32(47),
7815                Self::ExtensionsNotEnabledInReplica => serializer.serialize_i32(48),
7816                Self::UnsupportedColumns => serializer.serialize_i32(49),
7817                Self::UnknownValue(u) => u.0.serialize(serializer),
7818            }
7819        }
7820    }
7821
7822    impl<'de> serde::de::Deserialize<'de> for SqlExternalSyncSettingErrorType {
7823        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7824        where
7825            D: serde::Deserializer<'de>,
7826        {
7827            deserializer.deserialize_any(wkt::internal::EnumVisitor::<
7828                SqlExternalSyncSettingErrorType,
7829            >::new(
7830                ".google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType",
7831            ))
7832        }
7833    }
7834}
7835
7836/// On-premises instance configuration.
7837#[derive(Clone, Default, PartialEq)]
7838#[non_exhaustive]
7839pub struct OnPremisesConfiguration {
7840    /// The host and port of the on-premises instance in host:port format
7841    pub host_port: std::string::String,
7842
7843    /// This is always `sql#onPremisesConfiguration`.
7844    pub kind: std::string::String,
7845
7846    /// The username for connecting to on-premises instance.
7847    pub username: std::string::String,
7848
7849    /// The password for connecting to on-premises instance.
7850    pub password: std::string::String,
7851
7852    /// PEM representation of the trusted CA's x509 certificate.
7853    pub ca_certificate: std::string::String,
7854
7855    /// PEM representation of the replica's x509 certificate.
7856    pub client_certificate: std::string::String,
7857
7858    /// PEM representation of the replica's private key. The corresponsing public
7859    /// key is encoded in the client's certificate.
7860    pub client_key: std::string::String,
7861
7862    /// The dump file to create the Cloud SQL replica.
7863    pub dump_file_path: std::string::String,
7864
7865    /// The reference to Cloud SQL instance if the source is Cloud SQL.
7866    pub source_instance: std::option::Option<crate::model::InstanceReference>,
7867
7868    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7869}
7870
7871impl OnPremisesConfiguration {
7872    pub fn new() -> Self {
7873        std::default::Default::default()
7874    }
7875
7876    /// Sets the value of [host_port][crate::model::OnPremisesConfiguration::host_port].
7877    pub fn set_host_port<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7878        self.host_port = v.into();
7879        self
7880    }
7881
7882    /// Sets the value of [kind][crate::model::OnPremisesConfiguration::kind].
7883    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7884        self.kind = v.into();
7885        self
7886    }
7887
7888    /// Sets the value of [username][crate::model::OnPremisesConfiguration::username].
7889    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7890        self.username = v.into();
7891        self
7892    }
7893
7894    /// Sets the value of [password][crate::model::OnPremisesConfiguration::password].
7895    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7896        self.password = v.into();
7897        self
7898    }
7899
7900    /// Sets the value of [ca_certificate][crate::model::OnPremisesConfiguration::ca_certificate].
7901    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7902        self.ca_certificate = v.into();
7903        self
7904    }
7905
7906    /// Sets the value of [client_certificate][crate::model::OnPremisesConfiguration::client_certificate].
7907    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
7908        mut self,
7909        v: T,
7910    ) -> Self {
7911        self.client_certificate = v.into();
7912        self
7913    }
7914
7915    /// Sets the value of [client_key][crate::model::OnPremisesConfiguration::client_key].
7916    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7917        self.client_key = v.into();
7918        self
7919    }
7920
7921    /// Sets the value of [dump_file_path][crate::model::OnPremisesConfiguration::dump_file_path].
7922    pub fn set_dump_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7923        self.dump_file_path = v.into();
7924        self
7925    }
7926
7927    /// Sets the value of [source_instance][crate::model::OnPremisesConfiguration::source_instance].
7928    pub fn set_source_instance<T>(mut self, v: T) -> Self
7929    where
7930        T: std::convert::Into<crate::model::InstanceReference>,
7931    {
7932        self.source_instance = std::option::Option::Some(v.into());
7933        self
7934    }
7935
7936    /// Sets or clears the value of [source_instance][crate::model::OnPremisesConfiguration::source_instance].
7937    pub fn set_or_clear_source_instance<T>(mut self, v: std::option::Option<T>) -> Self
7938    where
7939        T: std::convert::Into<crate::model::InstanceReference>,
7940    {
7941        self.source_instance = v.map(|x| x.into());
7942        self
7943    }
7944}
7945
7946impl wkt::message::Message for OnPremisesConfiguration {
7947    fn typename() -> &'static str {
7948        "type.googleapis.com/google.cloud.sql.v1.OnPremisesConfiguration"
7949    }
7950}
7951
7952/// Read-replica configuration for connecting to the primary instance.
7953#[derive(Clone, Default, PartialEq)]
7954#[non_exhaustive]
7955pub struct ReplicaConfiguration {
7956    /// This is always `sql#replicaConfiguration`.
7957    pub kind: std::string::String,
7958
7959    /// MySQL specific configuration when replicating from a MySQL on-premises
7960    /// primary instance. Replication configuration information such as the
7961    /// username, password, certificates, and keys are not stored in the instance
7962    /// metadata. The configuration information is used only to set up the
7963    /// replication connection and is stored by MySQL in a file named
7964    /// `master.info` in the data directory.
7965    pub mysql_replica_configuration: std::option::Option<crate::model::MySqlReplicaConfiguration>,
7966
7967    /// Specifies if the replica is the failover target. If the field is set to
7968    /// `true`, the replica will be designated as a failover replica. In case the
7969    /// primary instance fails, the replica instance will be promoted as the new
7970    /// primary instance. Only one replica can be specified as failover target, and
7971    /// the replica has to be in different zone with the primary instance.
7972    pub failover_target: std::option::Option<wkt::BoolValue>,
7973
7974    /// Optional. Specifies if a SQL Server replica is a cascadable replica. A
7975    /// cascadable replica is a SQL Server cross region replica that supports
7976    /// replica(s) under it.
7977    pub cascadable_replica: std::option::Option<wkt::BoolValue>,
7978
7979    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7980}
7981
7982impl ReplicaConfiguration {
7983    pub fn new() -> Self {
7984        std::default::Default::default()
7985    }
7986
7987    /// Sets the value of [kind][crate::model::ReplicaConfiguration::kind].
7988    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7989        self.kind = v.into();
7990        self
7991    }
7992
7993    /// Sets the value of [mysql_replica_configuration][crate::model::ReplicaConfiguration::mysql_replica_configuration].
7994    pub fn set_mysql_replica_configuration<T>(mut self, v: T) -> Self
7995    where
7996        T: std::convert::Into<crate::model::MySqlReplicaConfiguration>,
7997    {
7998        self.mysql_replica_configuration = std::option::Option::Some(v.into());
7999        self
8000    }
8001
8002    /// Sets or clears the value of [mysql_replica_configuration][crate::model::ReplicaConfiguration::mysql_replica_configuration].
8003    pub fn set_or_clear_mysql_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
8004    where
8005        T: std::convert::Into<crate::model::MySqlReplicaConfiguration>,
8006    {
8007        self.mysql_replica_configuration = v.map(|x| x.into());
8008        self
8009    }
8010
8011    /// Sets the value of [failover_target][crate::model::ReplicaConfiguration::failover_target].
8012    pub fn set_failover_target<T>(mut self, v: T) -> Self
8013    where
8014        T: std::convert::Into<wkt::BoolValue>,
8015    {
8016        self.failover_target = std::option::Option::Some(v.into());
8017        self
8018    }
8019
8020    /// Sets or clears the value of [failover_target][crate::model::ReplicaConfiguration::failover_target].
8021    pub fn set_or_clear_failover_target<T>(mut self, v: std::option::Option<T>) -> Self
8022    where
8023        T: std::convert::Into<wkt::BoolValue>,
8024    {
8025        self.failover_target = v.map(|x| x.into());
8026        self
8027    }
8028
8029    /// Sets the value of [cascadable_replica][crate::model::ReplicaConfiguration::cascadable_replica].
8030    pub fn set_cascadable_replica<T>(mut self, v: T) -> Self
8031    where
8032        T: std::convert::Into<wkt::BoolValue>,
8033    {
8034        self.cascadable_replica = std::option::Option::Some(v.into());
8035        self
8036    }
8037
8038    /// Sets or clears the value of [cascadable_replica][crate::model::ReplicaConfiguration::cascadable_replica].
8039    pub fn set_or_clear_cascadable_replica<T>(mut self, v: std::option::Option<T>) -> Self
8040    where
8041        T: std::convert::Into<wkt::BoolValue>,
8042    {
8043        self.cascadable_replica = v.map(|x| x.into());
8044        self
8045    }
8046}
8047
8048impl wkt::message::Message for ReplicaConfiguration {
8049    fn typename() -> &'static str {
8050        "type.googleapis.com/google.cloud.sql.v1.ReplicaConfiguration"
8051    }
8052}
8053
8054/// Request to acquire a lease for SSRS.
8055#[derive(Clone, Default, PartialEq)]
8056#[non_exhaustive]
8057pub struct SqlInstancesAcquireSsrsLeaseRequest {
8058    /// Required. Cloud SQL instance ID. This doesn't include the project ID. It's
8059    /// composed of lowercase letters, numbers, and hyphens, and it must start with
8060    /// a letter. The total length must be 98 characters or less (Example:
8061    /// instance-id).
8062    pub instance: std::string::String,
8063
8064    /// Required. Project ID of the project that contains the instance (Example:
8065    /// project-id).
8066    pub project: std::string::String,
8067
8068    /// Required. The request body.
8069    pub body: std::option::Option<crate::model::InstancesAcquireSsrsLeaseRequest>,
8070
8071    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8072}
8073
8074impl SqlInstancesAcquireSsrsLeaseRequest {
8075    pub fn new() -> Self {
8076        std::default::Default::default()
8077    }
8078
8079    /// Sets the value of [instance][crate::model::SqlInstancesAcquireSsrsLeaseRequest::instance].
8080    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8081        self.instance = v.into();
8082        self
8083    }
8084
8085    /// Sets the value of [project][crate::model::SqlInstancesAcquireSsrsLeaseRequest::project].
8086    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8087        self.project = v.into();
8088        self
8089    }
8090
8091    /// Sets the value of [body][crate::model::SqlInstancesAcquireSsrsLeaseRequest::body].
8092    pub fn set_body<T>(mut self, v: T) -> Self
8093    where
8094        T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
8095    {
8096        self.body = std::option::Option::Some(v.into());
8097        self
8098    }
8099
8100    /// Sets or clears the value of [body][crate::model::SqlInstancesAcquireSsrsLeaseRequest::body].
8101    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
8102    where
8103        T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
8104    {
8105        self.body = v.map(|x| x.into());
8106        self
8107    }
8108}
8109
8110impl wkt::message::Message for SqlInstancesAcquireSsrsLeaseRequest {
8111    fn typename() -> &'static str {
8112        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest"
8113    }
8114}
8115
8116/// Response for the acquire SSRS lease request.
8117#[derive(Clone, Default, PartialEq)]
8118#[non_exhaustive]
8119pub struct SqlInstancesAcquireSsrsLeaseResponse {
8120    /// The unique identifier for this operation.
8121    pub operation_id: std::string::String,
8122
8123    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8124}
8125
8126impl SqlInstancesAcquireSsrsLeaseResponse {
8127    pub fn new() -> Self {
8128        std::default::Default::default()
8129    }
8130
8131    /// Sets the value of [operation_id][crate::model::SqlInstancesAcquireSsrsLeaseResponse::operation_id].
8132    pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8133        self.operation_id = v.into();
8134        self
8135    }
8136}
8137
8138impl wkt::message::Message for SqlInstancesAcquireSsrsLeaseResponse {
8139    fn typename() -> &'static str {
8140        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse"
8141    }
8142}
8143
8144/// Request to release a lease for SSRS.
8145#[derive(Clone, Default, PartialEq)]
8146#[non_exhaustive]
8147pub struct SqlInstancesReleaseSsrsLeaseRequest {
8148    /// Required. The Cloud SQL instance ID. This doesn't include the project ID.
8149    /// The instance ID contains lowercase letters, numbers, and hyphens, and it
8150    /// must start with a letter. This ID can have a maximum length of 98
8151    /// characters.
8152    pub instance: std::string::String,
8153
8154    /// Required. The project ID that contains the instance.
8155    pub project: std::string::String,
8156
8157    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8158}
8159
8160impl SqlInstancesReleaseSsrsLeaseRequest {
8161    pub fn new() -> Self {
8162        std::default::Default::default()
8163    }
8164
8165    /// Sets the value of [instance][crate::model::SqlInstancesReleaseSsrsLeaseRequest::instance].
8166    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8167        self.instance = v.into();
8168        self
8169    }
8170
8171    /// Sets the value of [project][crate::model::SqlInstancesReleaseSsrsLeaseRequest::project].
8172    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8173        self.project = v.into();
8174        self
8175    }
8176}
8177
8178impl wkt::message::Message for SqlInstancesReleaseSsrsLeaseRequest {
8179    fn typename() -> &'static str {
8180        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest"
8181    }
8182}
8183
8184/// Response for the release SSRS lease request.
8185#[derive(Clone, Default, PartialEq)]
8186#[non_exhaustive]
8187pub struct SqlInstancesReleaseSsrsLeaseResponse {
8188    /// The unique identifier for this operation.
8189    pub operation_id: std::string::String,
8190
8191    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8192}
8193
8194impl SqlInstancesReleaseSsrsLeaseResponse {
8195    pub fn new() -> Self {
8196        std::default::Default::default()
8197    }
8198
8199    /// Sets the value of [operation_id][crate::model::SqlInstancesReleaseSsrsLeaseResponse::operation_id].
8200    pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8201        self.operation_id = v.into();
8202        self
8203    }
8204}
8205
8206impl wkt::message::Message for SqlInstancesReleaseSsrsLeaseResponse {
8207    fn typename() -> &'static str {
8208        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse"
8209    }
8210}
8211
8212/// Operations get request.
8213#[derive(Clone, Default, PartialEq)]
8214#[non_exhaustive]
8215pub struct SqlOperationsGetRequest {
8216    /// Instance operation ID.
8217    pub operation: std::string::String,
8218
8219    /// Project ID of the project that contains the instance.
8220    pub project: std::string::String,
8221
8222    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8223}
8224
8225impl SqlOperationsGetRequest {
8226    pub fn new() -> Self {
8227        std::default::Default::default()
8228    }
8229
8230    /// Sets the value of [operation][crate::model::SqlOperationsGetRequest::operation].
8231    pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8232        self.operation = v.into();
8233        self
8234    }
8235
8236    /// Sets the value of [project][crate::model::SqlOperationsGetRequest::project].
8237    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8238        self.project = v.into();
8239        self
8240    }
8241}
8242
8243impl wkt::message::Message for SqlOperationsGetRequest {
8244    fn typename() -> &'static str {
8245        "type.googleapis.com/google.cloud.sql.v1.SqlOperationsGetRequest"
8246    }
8247}
8248
8249/// Operations list request.
8250#[derive(Clone, Default, PartialEq)]
8251#[non_exhaustive]
8252pub struct SqlOperationsListRequest {
8253    /// Cloud SQL instance ID. This does not include the project ID.
8254    pub instance: std::string::String,
8255
8256    /// Maximum number of operations per response.
8257    pub max_results: u32,
8258
8259    /// A previously-returned page token representing part of the larger set of
8260    /// results to view.
8261    pub page_token: std::string::String,
8262
8263    /// Project ID of the project that contains the instance.
8264    pub project: std::string::String,
8265
8266    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8267}
8268
8269impl SqlOperationsListRequest {
8270    pub fn new() -> Self {
8271        std::default::Default::default()
8272    }
8273
8274    /// Sets the value of [instance][crate::model::SqlOperationsListRequest::instance].
8275    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8276        self.instance = v.into();
8277        self
8278    }
8279
8280    /// Sets the value of [max_results][crate::model::SqlOperationsListRequest::max_results].
8281    pub fn set_max_results<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
8282        self.max_results = v.into();
8283        self
8284    }
8285
8286    /// Sets the value of [page_token][crate::model::SqlOperationsListRequest::page_token].
8287    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8288        self.page_token = v.into();
8289        self
8290    }
8291
8292    /// Sets the value of [project][crate::model::SqlOperationsListRequest::project].
8293    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8294        self.project = v.into();
8295        self
8296    }
8297}
8298
8299impl wkt::message::Message for SqlOperationsListRequest {
8300    fn typename() -> &'static str {
8301        "type.googleapis.com/google.cloud.sql.v1.SqlOperationsListRequest"
8302    }
8303}
8304
8305/// Operations list response.
8306#[derive(Clone, Default, PartialEq)]
8307#[non_exhaustive]
8308pub struct OperationsListResponse {
8309    /// This is always `sql#operationsList`.
8310    pub kind: std::string::String,
8311
8312    /// List of operation resources.
8313    pub items: std::vec::Vec<crate::model::Operation>,
8314
8315    /// The continuation token, used to page through large result sets. Provide
8316    /// this value in a subsequent request to return the next page of results.
8317    pub next_page_token: std::string::String,
8318
8319    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8320}
8321
8322impl OperationsListResponse {
8323    pub fn new() -> Self {
8324        std::default::Default::default()
8325    }
8326
8327    /// Sets the value of [kind][crate::model::OperationsListResponse::kind].
8328    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8329        self.kind = v.into();
8330        self
8331    }
8332
8333    /// Sets the value of [items][crate::model::OperationsListResponse::items].
8334    pub fn set_items<T, V>(mut self, v: T) -> Self
8335    where
8336        T: std::iter::IntoIterator<Item = V>,
8337        V: std::convert::Into<crate::model::Operation>,
8338    {
8339        use std::iter::Iterator;
8340        self.items = v.into_iter().map(|i| i.into()).collect();
8341        self
8342    }
8343
8344    /// Sets the value of [next_page_token][crate::model::OperationsListResponse::next_page_token].
8345    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8346        self.next_page_token = v.into();
8347        self
8348    }
8349}
8350
8351impl wkt::message::Message for OperationsListResponse {
8352    fn typename() -> &'static str {
8353        "type.googleapis.com/google.cloud.sql.v1.OperationsListResponse"
8354    }
8355}
8356
8357#[doc(hidden)]
8358impl gax::paginator::internal::PageableResponse for OperationsListResponse {
8359    type PageItem = crate::model::Operation;
8360
8361    fn items(self) -> std::vec::Vec<Self::PageItem> {
8362        self.items
8363    }
8364
8365    fn next_page_token(&self) -> std::string::String {
8366        use std::clone::Clone;
8367        self.next_page_token.clone()
8368    }
8369}
8370
8371/// Operations cancel request.
8372#[derive(Clone, Default, PartialEq)]
8373#[non_exhaustive]
8374pub struct SqlOperationsCancelRequest {
8375    /// Instance operation ID.
8376    pub operation: std::string::String,
8377
8378    /// Project ID of the project that contains the instance.
8379    pub project: std::string::String,
8380
8381    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8382}
8383
8384impl SqlOperationsCancelRequest {
8385    pub fn new() -> Self {
8386        std::default::Default::default()
8387    }
8388
8389    /// Sets the value of [operation][crate::model::SqlOperationsCancelRequest::operation].
8390    pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8391        self.operation = v.into();
8392        self
8393    }
8394
8395    /// Sets the value of [project][crate::model::SqlOperationsCancelRequest::project].
8396    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8397        self.project = v.into();
8398        self
8399    }
8400}
8401
8402impl wkt::message::Message for SqlOperationsCancelRequest {
8403    fn typename() -> &'static str {
8404        "type.googleapis.com/google.cloud.sql.v1.SqlOperationsCancelRequest"
8405    }
8406}
8407
8408/// An entry for an Access Control list.
8409#[derive(Clone, Default, PartialEq)]
8410#[non_exhaustive]
8411pub struct AclEntry {
8412    /// The allowlisted value for the access control list.
8413    pub value: std::string::String,
8414
8415    /// The time when this access control entry expires in
8416    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
8417    /// `2012-11-15T16:19:00.094Z`.
8418    pub expiration_time: std::option::Option<wkt::Timestamp>,
8419
8420    /// Optional. A label to identify this entry.
8421    pub name: std::string::String,
8422
8423    /// This is always `sql#aclEntry`.
8424    pub kind: std::string::String,
8425
8426    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8427}
8428
8429impl AclEntry {
8430    pub fn new() -> Self {
8431        std::default::Default::default()
8432    }
8433
8434    /// Sets the value of [value][crate::model::AclEntry::value].
8435    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8436        self.value = v.into();
8437        self
8438    }
8439
8440    /// Sets the value of [expiration_time][crate::model::AclEntry::expiration_time].
8441    pub fn set_expiration_time<T>(mut self, v: T) -> Self
8442    where
8443        T: std::convert::Into<wkt::Timestamp>,
8444    {
8445        self.expiration_time = std::option::Option::Some(v.into());
8446        self
8447    }
8448
8449    /// Sets or clears the value of [expiration_time][crate::model::AclEntry::expiration_time].
8450    pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
8451    where
8452        T: std::convert::Into<wkt::Timestamp>,
8453    {
8454        self.expiration_time = v.map(|x| x.into());
8455        self
8456    }
8457
8458    /// Sets the value of [name][crate::model::AclEntry::name].
8459    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8460        self.name = v.into();
8461        self
8462    }
8463
8464    /// Sets the value of [kind][crate::model::AclEntry::kind].
8465    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8466        self.kind = v.into();
8467        self
8468    }
8469}
8470
8471impl wkt::message::Message for AclEntry {
8472    fn typename() -> &'static str {
8473        "type.googleapis.com/google.cloud.sql.v1.AclEntry"
8474    }
8475}
8476
8477/// An Admin API warning message.
8478#[derive(Clone, Default, PartialEq)]
8479#[non_exhaustive]
8480pub struct ApiWarning {
8481    /// Code to uniquely identify the warning type.
8482    pub code: crate::model::api_warning::SqlApiWarningCode,
8483
8484    /// The warning message.
8485    pub message: std::string::String,
8486
8487    /// The region name for REGION_UNREACHABLE warning.
8488    pub region: std::string::String,
8489
8490    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8491}
8492
8493impl ApiWarning {
8494    pub fn new() -> Self {
8495        std::default::Default::default()
8496    }
8497
8498    /// Sets the value of [code][crate::model::ApiWarning::code].
8499    pub fn set_code<T: std::convert::Into<crate::model::api_warning::SqlApiWarningCode>>(
8500        mut self,
8501        v: T,
8502    ) -> Self {
8503        self.code = v.into();
8504        self
8505    }
8506
8507    /// Sets the value of [message][crate::model::ApiWarning::message].
8508    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8509        self.message = v.into();
8510        self
8511    }
8512
8513    /// Sets the value of [region][crate::model::ApiWarning::region].
8514    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8515        self.region = v.into();
8516        self
8517    }
8518}
8519
8520impl wkt::message::Message for ApiWarning {
8521    fn typename() -> &'static str {
8522        "type.googleapis.com/google.cloud.sql.v1.ApiWarning"
8523    }
8524}
8525
8526/// Defines additional types related to [ApiWarning].
8527pub mod api_warning {
8528    #[allow(unused_imports)]
8529    use super::*;
8530
8531    ///
8532    /// # Working with unknown values
8533    ///
8534    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8535    /// additional enum variants at any time. Adding new variants is not considered
8536    /// a breaking change. Applications should write their code in anticipation of:
8537    ///
8538    /// - New values appearing in future releases of the client library, **and**
8539    /// - New values received dynamically, without application changes.
8540    ///
8541    /// Please consult the [Working with enums] section in the user guide for some
8542    /// guidelines.
8543    ///
8544    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8545    #[derive(Clone, Debug, PartialEq)]
8546    #[non_exhaustive]
8547    pub enum SqlApiWarningCode {
8548        /// An unknown or unset warning type from Cloud SQL API.
8549        Unspecified,
8550        /// Warning when one or more regions are not reachable.  The returned result
8551        /// set may be incomplete.
8552        RegionUnreachable,
8553        /// Warning when user provided maxResults parameter exceeds the limit.  The
8554        /// returned result set may be incomplete.
8555        MaxResultsExceedsLimit,
8556        /// Warning when user tries to create/update a user with credentials that
8557        /// have previously been compromised by a public data breach.
8558        CompromisedCredentials,
8559        /// Warning when the operation succeeds but some non-critical workflow state
8560        /// failed.
8561        InternalStateFailure,
8562        /// If set, the enum was initialized with an unknown value.
8563        ///
8564        /// Applications can examine the value using [SqlApiWarningCode::value] or
8565        /// [SqlApiWarningCode::name].
8566        UnknownValue(sql_api_warning_code::UnknownValue),
8567    }
8568
8569    #[doc(hidden)]
8570    pub mod sql_api_warning_code {
8571        #[allow(unused_imports)]
8572        use super::*;
8573        #[derive(Clone, Debug, PartialEq)]
8574        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8575    }
8576
8577    impl SqlApiWarningCode {
8578        /// Gets the enum value.
8579        ///
8580        /// Returns `None` if the enum contains an unknown value deserialized from
8581        /// the string representation of enums.
8582        pub fn value(&self) -> std::option::Option<i32> {
8583            match self {
8584                Self::Unspecified => std::option::Option::Some(0),
8585                Self::RegionUnreachable => std::option::Option::Some(1),
8586                Self::MaxResultsExceedsLimit => std::option::Option::Some(2),
8587                Self::CompromisedCredentials => std::option::Option::Some(3),
8588                Self::InternalStateFailure => std::option::Option::Some(4),
8589                Self::UnknownValue(u) => u.0.value(),
8590            }
8591        }
8592
8593        /// Gets the enum value as a string.
8594        ///
8595        /// Returns `None` if the enum contains an unknown value deserialized from
8596        /// the integer representation of enums.
8597        pub fn name(&self) -> std::option::Option<&str> {
8598            match self {
8599                Self::Unspecified => std::option::Option::Some("SQL_API_WARNING_CODE_UNSPECIFIED"),
8600                Self::RegionUnreachable => std::option::Option::Some("REGION_UNREACHABLE"),
8601                Self::MaxResultsExceedsLimit => {
8602                    std::option::Option::Some("MAX_RESULTS_EXCEEDS_LIMIT")
8603                }
8604                Self::CompromisedCredentials => {
8605                    std::option::Option::Some("COMPROMISED_CREDENTIALS")
8606                }
8607                Self::InternalStateFailure => std::option::Option::Some("INTERNAL_STATE_FAILURE"),
8608                Self::UnknownValue(u) => u.0.name(),
8609            }
8610        }
8611    }
8612
8613    impl std::default::Default for SqlApiWarningCode {
8614        fn default() -> Self {
8615            use std::convert::From;
8616            Self::from(0)
8617        }
8618    }
8619
8620    impl std::fmt::Display for SqlApiWarningCode {
8621        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8622            wkt::internal::display_enum(f, self.name(), self.value())
8623        }
8624    }
8625
8626    impl std::convert::From<i32> for SqlApiWarningCode {
8627        fn from(value: i32) -> Self {
8628            match value {
8629                0 => Self::Unspecified,
8630                1 => Self::RegionUnreachable,
8631                2 => Self::MaxResultsExceedsLimit,
8632                3 => Self::CompromisedCredentials,
8633                4 => Self::InternalStateFailure,
8634                _ => Self::UnknownValue(sql_api_warning_code::UnknownValue(
8635                    wkt::internal::UnknownEnumValue::Integer(value),
8636                )),
8637            }
8638        }
8639    }
8640
8641    impl std::convert::From<&str> for SqlApiWarningCode {
8642        fn from(value: &str) -> Self {
8643            use std::string::ToString;
8644            match value {
8645                "SQL_API_WARNING_CODE_UNSPECIFIED" => Self::Unspecified,
8646                "REGION_UNREACHABLE" => Self::RegionUnreachable,
8647                "MAX_RESULTS_EXCEEDS_LIMIT" => Self::MaxResultsExceedsLimit,
8648                "COMPROMISED_CREDENTIALS" => Self::CompromisedCredentials,
8649                "INTERNAL_STATE_FAILURE" => Self::InternalStateFailure,
8650                _ => Self::UnknownValue(sql_api_warning_code::UnknownValue(
8651                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8652                )),
8653            }
8654        }
8655    }
8656
8657    impl serde::ser::Serialize for SqlApiWarningCode {
8658        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8659        where
8660            S: serde::Serializer,
8661        {
8662            match self {
8663                Self::Unspecified => serializer.serialize_i32(0),
8664                Self::RegionUnreachable => serializer.serialize_i32(1),
8665                Self::MaxResultsExceedsLimit => serializer.serialize_i32(2),
8666                Self::CompromisedCredentials => serializer.serialize_i32(3),
8667                Self::InternalStateFailure => serializer.serialize_i32(4),
8668                Self::UnknownValue(u) => u.0.serialize(serializer),
8669            }
8670        }
8671    }
8672
8673    impl<'de> serde::de::Deserialize<'de> for SqlApiWarningCode {
8674        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8675        where
8676            D: serde::Deserializer<'de>,
8677        {
8678            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlApiWarningCode>::new(
8679                ".google.cloud.sql.v1.ApiWarning.SqlApiWarningCode",
8680            ))
8681        }
8682    }
8683}
8684
8685/// We currently only support backup retention by specifying the number
8686/// of backups we will retain.
8687#[derive(Clone, Default, PartialEq)]
8688#[non_exhaustive]
8689pub struct BackupRetentionSettings {
8690    /// The unit that 'retained_backups' represents.
8691    pub retention_unit: crate::model::backup_retention_settings::RetentionUnit,
8692
8693    /// Depending on the value of retention_unit, this is used to determine
8694    /// if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
8695    /// retain this many backups.
8696    pub retained_backups: std::option::Option<wkt::Int32Value>,
8697
8698    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8699}
8700
8701impl BackupRetentionSettings {
8702    pub fn new() -> Self {
8703        std::default::Default::default()
8704    }
8705
8706    /// Sets the value of [retention_unit][crate::model::BackupRetentionSettings::retention_unit].
8707    pub fn set_retention_unit<
8708        T: std::convert::Into<crate::model::backup_retention_settings::RetentionUnit>,
8709    >(
8710        mut self,
8711        v: T,
8712    ) -> Self {
8713        self.retention_unit = v.into();
8714        self
8715    }
8716
8717    /// Sets the value of [retained_backups][crate::model::BackupRetentionSettings::retained_backups].
8718    pub fn set_retained_backups<T>(mut self, v: T) -> Self
8719    where
8720        T: std::convert::Into<wkt::Int32Value>,
8721    {
8722        self.retained_backups = std::option::Option::Some(v.into());
8723        self
8724    }
8725
8726    /// Sets or clears the value of [retained_backups][crate::model::BackupRetentionSettings::retained_backups].
8727    pub fn set_or_clear_retained_backups<T>(mut self, v: std::option::Option<T>) -> Self
8728    where
8729        T: std::convert::Into<wkt::Int32Value>,
8730    {
8731        self.retained_backups = v.map(|x| x.into());
8732        self
8733    }
8734}
8735
8736impl wkt::message::Message for BackupRetentionSettings {
8737    fn typename() -> &'static str {
8738        "type.googleapis.com/google.cloud.sql.v1.BackupRetentionSettings"
8739    }
8740}
8741
8742/// Defines additional types related to [BackupRetentionSettings].
8743pub mod backup_retention_settings {
8744    #[allow(unused_imports)]
8745    use super::*;
8746
8747    /// The units that retained_backups specifies, we only support COUNT.
8748    ///
8749    /// # Working with unknown values
8750    ///
8751    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8752    /// additional enum variants at any time. Adding new variants is not considered
8753    /// a breaking change. Applications should write their code in anticipation of:
8754    ///
8755    /// - New values appearing in future releases of the client library, **and**
8756    /// - New values received dynamically, without application changes.
8757    ///
8758    /// Please consult the [Working with enums] section in the user guide for some
8759    /// guidelines.
8760    ///
8761    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8762    #[derive(Clone, Debug, PartialEq)]
8763    #[non_exhaustive]
8764    pub enum RetentionUnit {
8765        /// Backup retention unit is unspecified, will be treated as COUNT.
8766        Unspecified,
8767        /// Retention will be by count, eg. "retain the most recent 7 backups".
8768        Count,
8769        /// If set, the enum was initialized with an unknown value.
8770        ///
8771        /// Applications can examine the value using [RetentionUnit::value] or
8772        /// [RetentionUnit::name].
8773        UnknownValue(retention_unit::UnknownValue),
8774    }
8775
8776    #[doc(hidden)]
8777    pub mod retention_unit {
8778        #[allow(unused_imports)]
8779        use super::*;
8780        #[derive(Clone, Debug, PartialEq)]
8781        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8782    }
8783
8784    impl RetentionUnit {
8785        /// Gets the enum value.
8786        ///
8787        /// Returns `None` if the enum contains an unknown value deserialized from
8788        /// the string representation of enums.
8789        pub fn value(&self) -> std::option::Option<i32> {
8790            match self {
8791                Self::Unspecified => std::option::Option::Some(0),
8792                Self::Count => std::option::Option::Some(1),
8793                Self::UnknownValue(u) => u.0.value(),
8794            }
8795        }
8796
8797        /// Gets the enum value as a string.
8798        ///
8799        /// Returns `None` if the enum contains an unknown value deserialized from
8800        /// the integer representation of enums.
8801        pub fn name(&self) -> std::option::Option<&str> {
8802            match self {
8803                Self::Unspecified => std::option::Option::Some("RETENTION_UNIT_UNSPECIFIED"),
8804                Self::Count => std::option::Option::Some("COUNT"),
8805                Self::UnknownValue(u) => u.0.name(),
8806            }
8807        }
8808    }
8809
8810    impl std::default::Default for RetentionUnit {
8811        fn default() -> Self {
8812            use std::convert::From;
8813            Self::from(0)
8814        }
8815    }
8816
8817    impl std::fmt::Display for RetentionUnit {
8818        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8819            wkt::internal::display_enum(f, self.name(), self.value())
8820        }
8821    }
8822
8823    impl std::convert::From<i32> for RetentionUnit {
8824        fn from(value: i32) -> Self {
8825            match value {
8826                0 => Self::Unspecified,
8827                1 => Self::Count,
8828                _ => Self::UnknownValue(retention_unit::UnknownValue(
8829                    wkt::internal::UnknownEnumValue::Integer(value),
8830                )),
8831            }
8832        }
8833    }
8834
8835    impl std::convert::From<&str> for RetentionUnit {
8836        fn from(value: &str) -> Self {
8837            use std::string::ToString;
8838            match value {
8839                "RETENTION_UNIT_UNSPECIFIED" => Self::Unspecified,
8840                "COUNT" => Self::Count,
8841                _ => Self::UnknownValue(retention_unit::UnknownValue(
8842                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8843                )),
8844            }
8845        }
8846    }
8847
8848    impl serde::ser::Serialize for RetentionUnit {
8849        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8850        where
8851            S: serde::Serializer,
8852        {
8853            match self {
8854                Self::Unspecified => serializer.serialize_i32(0),
8855                Self::Count => serializer.serialize_i32(1),
8856                Self::UnknownValue(u) => u.0.serialize(serializer),
8857            }
8858        }
8859    }
8860
8861    impl<'de> serde::de::Deserialize<'de> for RetentionUnit {
8862        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8863        where
8864            D: serde::Deserializer<'de>,
8865        {
8866            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RetentionUnit>::new(
8867                ".google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit",
8868            ))
8869        }
8870    }
8871}
8872
8873/// Database instance backup configuration.
8874#[derive(Clone, Default, PartialEq)]
8875#[non_exhaustive]
8876pub struct BackupConfiguration {
8877    /// Start time for the daily backup configuration in UTC timezone in the 24
8878    /// hour format - `HH:MM`.
8879    pub start_time: std::string::String,
8880
8881    /// Whether this configuration is enabled.
8882    pub enabled: std::option::Option<wkt::BoolValue>,
8883
8884    /// This is always `sql#backupConfiguration`.
8885    pub kind: std::string::String,
8886
8887    /// (MySQL only) Whether binary log is enabled. If backup configuration is
8888    /// disabled, binarylog must be disabled as well.
8889    pub binary_log_enabled: std::option::Option<wkt::BoolValue>,
8890
8891    /// Reserved for future use.
8892    pub replication_log_archiving_enabled: std::option::Option<wkt::BoolValue>,
8893
8894    /// Location of the backup
8895    pub location: std::string::String,
8896
8897    /// Whether point in time recovery is enabled.
8898    pub point_in_time_recovery_enabled: std::option::Option<wkt::BoolValue>,
8899
8900    /// Backup retention settings.
8901    pub backup_retention_settings: std::option::Option<crate::model::BackupRetentionSettings>,
8902
8903    /// The number of days of transaction logs we retain for point in time
8904    /// restore, from 1-7.
8905    pub transaction_log_retention_days: std::option::Option<wkt::Int32Value>,
8906
8907    /// Output only. This value contains the storage location of transactional logs
8908    /// used to perform point-in-time recovery (PITR) for the database.
8909    pub transactional_log_storage_state:
8910        std::option::Option<crate::model::backup_configuration::TransactionalLogStorageState>,
8911
8912    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8913}
8914
8915impl BackupConfiguration {
8916    pub fn new() -> Self {
8917        std::default::Default::default()
8918    }
8919
8920    /// Sets the value of [start_time][crate::model::BackupConfiguration::start_time].
8921    pub fn set_start_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8922        self.start_time = v.into();
8923        self
8924    }
8925
8926    /// Sets the value of [enabled][crate::model::BackupConfiguration::enabled].
8927    pub fn set_enabled<T>(mut self, v: T) -> Self
8928    where
8929        T: std::convert::Into<wkt::BoolValue>,
8930    {
8931        self.enabled = std::option::Option::Some(v.into());
8932        self
8933    }
8934
8935    /// Sets or clears the value of [enabled][crate::model::BackupConfiguration::enabled].
8936    pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
8937    where
8938        T: std::convert::Into<wkt::BoolValue>,
8939    {
8940        self.enabled = v.map(|x| x.into());
8941        self
8942    }
8943
8944    /// Sets the value of [kind][crate::model::BackupConfiguration::kind].
8945    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8946        self.kind = v.into();
8947        self
8948    }
8949
8950    /// Sets the value of [binary_log_enabled][crate::model::BackupConfiguration::binary_log_enabled].
8951    pub fn set_binary_log_enabled<T>(mut self, v: T) -> Self
8952    where
8953        T: std::convert::Into<wkt::BoolValue>,
8954    {
8955        self.binary_log_enabled = std::option::Option::Some(v.into());
8956        self
8957    }
8958
8959    /// Sets or clears the value of [binary_log_enabled][crate::model::BackupConfiguration::binary_log_enabled].
8960    pub fn set_or_clear_binary_log_enabled<T>(mut self, v: std::option::Option<T>) -> Self
8961    where
8962        T: std::convert::Into<wkt::BoolValue>,
8963    {
8964        self.binary_log_enabled = v.map(|x| x.into());
8965        self
8966    }
8967
8968    /// Sets the value of [replication_log_archiving_enabled][crate::model::BackupConfiguration::replication_log_archiving_enabled].
8969    pub fn set_replication_log_archiving_enabled<T>(mut self, v: T) -> Self
8970    where
8971        T: std::convert::Into<wkt::BoolValue>,
8972    {
8973        self.replication_log_archiving_enabled = std::option::Option::Some(v.into());
8974        self
8975    }
8976
8977    /// Sets or clears the value of [replication_log_archiving_enabled][crate::model::BackupConfiguration::replication_log_archiving_enabled].
8978    pub fn set_or_clear_replication_log_archiving_enabled<T>(
8979        mut self,
8980        v: std::option::Option<T>,
8981    ) -> Self
8982    where
8983        T: std::convert::Into<wkt::BoolValue>,
8984    {
8985        self.replication_log_archiving_enabled = v.map(|x| x.into());
8986        self
8987    }
8988
8989    /// Sets the value of [location][crate::model::BackupConfiguration::location].
8990    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8991        self.location = v.into();
8992        self
8993    }
8994
8995    /// Sets the value of [point_in_time_recovery_enabled][crate::model::BackupConfiguration::point_in_time_recovery_enabled].
8996    pub fn set_point_in_time_recovery_enabled<T>(mut self, v: T) -> Self
8997    where
8998        T: std::convert::Into<wkt::BoolValue>,
8999    {
9000        self.point_in_time_recovery_enabled = std::option::Option::Some(v.into());
9001        self
9002    }
9003
9004    /// Sets or clears the value of [point_in_time_recovery_enabled][crate::model::BackupConfiguration::point_in_time_recovery_enabled].
9005    pub fn set_or_clear_point_in_time_recovery_enabled<T>(
9006        mut self,
9007        v: std::option::Option<T>,
9008    ) -> Self
9009    where
9010        T: std::convert::Into<wkt::BoolValue>,
9011    {
9012        self.point_in_time_recovery_enabled = v.map(|x| x.into());
9013        self
9014    }
9015
9016    /// Sets the value of [backup_retention_settings][crate::model::BackupConfiguration::backup_retention_settings].
9017    pub fn set_backup_retention_settings<T>(mut self, v: T) -> Self
9018    where
9019        T: std::convert::Into<crate::model::BackupRetentionSettings>,
9020    {
9021        self.backup_retention_settings = std::option::Option::Some(v.into());
9022        self
9023    }
9024
9025    /// Sets or clears the value of [backup_retention_settings][crate::model::BackupConfiguration::backup_retention_settings].
9026    pub fn set_or_clear_backup_retention_settings<T>(mut self, v: std::option::Option<T>) -> Self
9027    where
9028        T: std::convert::Into<crate::model::BackupRetentionSettings>,
9029    {
9030        self.backup_retention_settings = v.map(|x| x.into());
9031        self
9032    }
9033
9034    /// Sets the value of [transaction_log_retention_days][crate::model::BackupConfiguration::transaction_log_retention_days].
9035    pub fn set_transaction_log_retention_days<T>(mut self, v: T) -> Self
9036    where
9037        T: std::convert::Into<wkt::Int32Value>,
9038    {
9039        self.transaction_log_retention_days = std::option::Option::Some(v.into());
9040        self
9041    }
9042
9043    /// Sets or clears the value of [transaction_log_retention_days][crate::model::BackupConfiguration::transaction_log_retention_days].
9044    pub fn set_or_clear_transaction_log_retention_days<T>(
9045        mut self,
9046        v: std::option::Option<T>,
9047    ) -> Self
9048    where
9049        T: std::convert::Into<wkt::Int32Value>,
9050    {
9051        self.transaction_log_retention_days = v.map(|x| x.into());
9052        self
9053    }
9054
9055    /// Sets the value of [transactional_log_storage_state][crate::model::BackupConfiguration::transactional_log_storage_state].
9056    pub fn set_transactional_log_storage_state<T>(mut self, v: T) -> Self
9057    where
9058        T: std::convert::Into<crate::model::backup_configuration::TransactionalLogStorageState>,
9059    {
9060        self.transactional_log_storage_state = std::option::Option::Some(v.into());
9061        self
9062    }
9063
9064    /// Sets or clears the value of [transactional_log_storage_state][crate::model::BackupConfiguration::transactional_log_storage_state].
9065    pub fn set_or_clear_transactional_log_storage_state<T>(
9066        mut self,
9067        v: std::option::Option<T>,
9068    ) -> Self
9069    where
9070        T: std::convert::Into<crate::model::backup_configuration::TransactionalLogStorageState>,
9071    {
9072        self.transactional_log_storage_state = v.map(|x| x.into());
9073        self
9074    }
9075}
9076
9077impl wkt::message::Message for BackupConfiguration {
9078    fn typename() -> &'static str {
9079        "type.googleapis.com/google.cloud.sql.v1.BackupConfiguration"
9080    }
9081}
9082
9083/// Defines additional types related to [BackupConfiguration].
9084pub mod backup_configuration {
9085    #[allow(unused_imports)]
9086    use super::*;
9087
9088    /// This value contains the storage location of the transactional logs
9089    /// used to perform point-in-time recovery (PITR) for the database.
9090    ///
9091    /// # Working with unknown values
9092    ///
9093    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9094    /// additional enum variants at any time. Adding new variants is not considered
9095    /// a breaking change. Applications should write their code in anticipation of:
9096    ///
9097    /// - New values appearing in future releases of the client library, **and**
9098    /// - New values received dynamically, without application changes.
9099    ///
9100    /// Please consult the [Working with enums] section in the user guide for some
9101    /// guidelines.
9102    ///
9103    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9104    #[derive(Clone, Debug, PartialEq)]
9105    #[non_exhaustive]
9106    pub enum TransactionalLogStorageState {
9107        /// Unspecified.
9108        Unspecified,
9109        /// The transaction logs used for PITR for the instance are stored
9110        /// on a data disk.
9111        Disk,
9112        /// The transaction logs used for PITR for the instance are switching from
9113        /// being stored on a data disk to being stored in Cloud Storage.
9114        /// Only applicable to MySQL.
9115        SwitchingToCloudStorage,
9116        /// The transaction logs used for PITR for the instance are now stored
9117        /// in Cloud Storage. Previously, they were stored on a data disk.
9118        /// Only applicable to MySQL.
9119        SwitchedToCloudStorage,
9120        /// The transaction logs used for PITR for the instance are stored in
9121        /// Cloud Storage. Only applicable to MySQL and PostgreSQL.
9122        CloudStorage,
9123        /// If set, the enum was initialized with an unknown value.
9124        ///
9125        /// Applications can examine the value using [TransactionalLogStorageState::value] or
9126        /// [TransactionalLogStorageState::name].
9127        UnknownValue(transactional_log_storage_state::UnknownValue),
9128    }
9129
9130    #[doc(hidden)]
9131    pub mod transactional_log_storage_state {
9132        #[allow(unused_imports)]
9133        use super::*;
9134        #[derive(Clone, Debug, PartialEq)]
9135        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9136    }
9137
9138    impl TransactionalLogStorageState {
9139        /// Gets the enum value.
9140        ///
9141        /// Returns `None` if the enum contains an unknown value deserialized from
9142        /// the string representation of enums.
9143        pub fn value(&self) -> std::option::Option<i32> {
9144            match self {
9145                Self::Unspecified => std::option::Option::Some(0),
9146                Self::Disk => std::option::Option::Some(1),
9147                Self::SwitchingToCloudStorage => std::option::Option::Some(2),
9148                Self::SwitchedToCloudStorage => std::option::Option::Some(3),
9149                Self::CloudStorage => std::option::Option::Some(4),
9150                Self::UnknownValue(u) => u.0.value(),
9151            }
9152        }
9153
9154        /// Gets the enum value as a string.
9155        ///
9156        /// Returns `None` if the enum contains an unknown value deserialized from
9157        /// the integer representation of enums.
9158        pub fn name(&self) -> std::option::Option<&str> {
9159            match self {
9160                Self::Unspecified => {
9161                    std::option::Option::Some("TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED")
9162                }
9163                Self::Disk => std::option::Option::Some("DISK"),
9164                Self::SwitchingToCloudStorage => {
9165                    std::option::Option::Some("SWITCHING_TO_CLOUD_STORAGE")
9166                }
9167                Self::SwitchedToCloudStorage => {
9168                    std::option::Option::Some("SWITCHED_TO_CLOUD_STORAGE")
9169                }
9170                Self::CloudStorage => std::option::Option::Some("CLOUD_STORAGE"),
9171                Self::UnknownValue(u) => u.0.name(),
9172            }
9173        }
9174    }
9175
9176    impl std::default::Default for TransactionalLogStorageState {
9177        fn default() -> Self {
9178            use std::convert::From;
9179            Self::from(0)
9180        }
9181    }
9182
9183    impl std::fmt::Display for TransactionalLogStorageState {
9184        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9185            wkt::internal::display_enum(f, self.name(), self.value())
9186        }
9187    }
9188
9189    impl std::convert::From<i32> for TransactionalLogStorageState {
9190        fn from(value: i32) -> Self {
9191            match value {
9192                0 => Self::Unspecified,
9193                1 => Self::Disk,
9194                2 => Self::SwitchingToCloudStorage,
9195                3 => Self::SwitchedToCloudStorage,
9196                4 => Self::CloudStorage,
9197                _ => Self::UnknownValue(transactional_log_storage_state::UnknownValue(
9198                    wkt::internal::UnknownEnumValue::Integer(value),
9199                )),
9200            }
9201        }
9202    }
9203
9204    impl std::convert::From<&str> for TransactionalLogStorageState {
9205        fn from(value: &str) -> Self {
9206            use std::string::ToString;
9207            match value {
9208                "TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED" => Self::Unspecified,
9209                "DISK" => Self::Disk,
9210                "SWITCHING_TO_CLOUD_STORAGE" => Self::SwitchingToCloudStorage,
9211                "SWITCHED_TO_CLOUD_STORAGE" => Self::SwitchedToCloudStorage,
9212                "CLOUD_STORAGE" => Self::CloudStorage,
9213                _ => Self::UnknownValue(transactional_log_storage_state::UnknownValue(
9214                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9215                )),
9216            }
9217        }
9218    }
9219
9220    impl serde::ser::Serialize for TransactionalLogStorageState {
9221        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9222        where
9223            S: serde::Serializer,
9224        {
9225            match self {
9226                Self::Unspecified => serializer.serialize_i32(0),
9227                Self::Disk => serializer.serialize_i32(1),
9228                Self::SwitchingToCloudStorage => serializer.serialize_i32(2),
9229                Self::SwitchedToCloudStorage => serializer.serialize_i32(3),
9230                Self::CloudStorage => serializer.serialize_i32(4),
9231                Self::UnknownValue(u) => u.0.serialize(serializer),
9232            }
9233        }
9234    }
9235
9236    impl<'de> serde::de::Deserialize<'de> for TransactionalLogStorageState {
9237        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9238        where
9239            D: serde::Deserializer<'de>,
9240        {
9241            deserializer.deserialize_any(
9242                wkt::internal::EnumVisitor::<TransactionalLogStorageState>::new(
9243                    ".google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState",
9244                ),
9245            )
9246        }
9247    }
9248}
9249
9250/// Perform disk shrink context.
9251#[derive(Clone, Default, PartialEq)]
9252#[non_exhaustive]
9253pub struct PerformDiskShrinkContext {
9254    /// The target disk shrink size in GigaBytes.
9255    pub target_size_gb: i64,
9256
9257    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9258}
9259
9260impl PerformDiskShrinkContext {
9261    pub fn new() -> Self {
9262        std::default::Default::default()
9263    }
9264
9265    /// Sets the value of [target_size_gb][crate::model::PerformDiskShrinkContext::target_size_gb].
9266    pub fn set_target_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9267        self.target_size_gb = v.into();
9268        self
9269    }
9270}
9271
9272impl wkt::message::Message for PerformDiskShrinkContext {
9273    fn typename() -> &'static str {
9274        "type.googleapis.com/google.cloud.sql.v1.PerformDiskShrinkContext"
9275    }
9276}
9277
9278/// Backup context.
9279#[derive(Clone, Default, PartialEq)]
9280#[non_exhaustive]
9281pub struct BackupContext {
9282    /// The identifier of the backup.
9283    pub backup_id: i64,
9284
9285    /// This is always `sql#backupContext`.
9286    pub kind: std::string::String,
9287
9288    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9289}
9290
9291impl BackupContext {
9292    pub fn new() -> Self {
9293        std::default::Default::default()
9294    }
9295
9296    /// Sets the value of [backup_id][crate::model::BackupContext::backup_id].
9297    pub fn set_backup_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9298        self.backup_id = v.into();
9299        self
9300    }
9301
9302    /// Sets the value of [kind][crate::model::BackupContext::kind].
9303    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9304        self.kind = v.into();
9305        self
9306    }
9307}
9308
9309impl wkt::message::Message for BackupContext {
9310    fn typename() -> &'static str {
9311        "type.googleapis.com/google.cloud.sql.v1.BackupContext"
9312    }
9313}
9314
9315/// Represents a SQL database on the Cloud SQL instance.
9316#[derive(Clone, Default, PartialEq)]
9317#[non_exhaustive]
9318pub struct Database {
9319    /// This is always `sql#database`.
9320    pub kind: std::string::String,
9321
9322    /// The Cloud SQL charset value.
9323    pub charset: std::string::String,
9324
9325    /// The Cloud SQL collation value.
9326    pub collation: std::string::String,
9327
9328    /// This field is deprecated and will be removed from a future version of the
9329    /// API.
9330    pub etag: std::string::String,
9331
9332    /// The name of the database in the Cloud SQL instance. This does not include
9333    /// the project ID or instance name.
9334    pub name: std::string::String,
9335
9336    /// The name of the Cloud SQL instance. This does not include the project ID.
9337    pub instance: std::string::String,
9338
9339    /// The URI of this resource.
9340    pub self_link: std::string::String,
9341
9342    /// The project ID of the project containing the Cloud SQL database. The Google
9343    /// apps domain is prefixed if applicable.
9344    pub project: std::string::String,
9345
9346    pub database_details: std::option::Option<crate::model::database::DatabaseDetails>,
9347
9348    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9349}
9350
9351impl Database {
9352    pub fn new() -> Self {
9353        std::default::Default::default()
9354    }
9355
9356    /// Sets the value of [kind][crate::model::Database::kind].
9357    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9358        self.kind = v.into();
9359        self
9360    }
9361
9362    /// Sets the value of [charset][crate::model::Database::charset].
9363    pub fn set_charset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9364        self.charset = v.into();
9365        self
9366    }
9367
9368    /// Sets the value of [collation][crate::model::Database::collation].
9369    pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9370        self.collation = v.into();
9371        self
9372    }
9373
9374    /// Sets the value of [etag][crate::model::Database::etag].
9375    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9376        self.etag = v.into();
9377        self
9378    }
9379
9380    /// Sets the value of [name][crate::model::Database::name].
9381    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9382        self.name = v.into();
9383        self
9384    }
9385
9386    /// Sets the value of [instance][crate::model::Database::instance].
9387    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9388        self.instance = v.into();
9389        self
9390    }
9391
9392    /// Sets the value of [self_link][crate::model::Database::self_link].
9393    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9394        self.self_link = v.into();
9395        self
9396    }
9397
9398    /// Sets the value of [project][crate::model::Database::project].
9399    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9400        self.project = v.into();
9401        self
9402    }
9403
9404    /// Sets the value of [database_details][crate::model::Database::database_details].
9405    ///
9406    /// Note that all the setters affecting `database_details` are mutually
9407    /// exclusive.
9408    pub fn set_database_details<
9409        T: std::convert::Into<std::option::Option<crate::model::database::DatabaseDetails>>,
9410    >(
9411        mut self,
9412        v: T,
9413    ) -> Self {
9414        self.database_details = v.into();
9415        self
9416    }
9417
9418    /// The value of [database_details][crate::model::Database::database_details]
9419    /// if it holds a `SqlserverDatabaseDetails`, `None` if the field is not set or
9420    /// holds a different branch.
9421    pub fn sqlserver_database_details(
9422        &self,
9423    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerDatabaseDetails>> {
9424        #[allow(unreachable_patterns)]
9425        self.database_details.as_ref().and_then(|v| match v {
9426            crate::model::database::DatabaseDetails::SqlserverDatabaseDetails(v) => {
9427                std::option::Option::Some(v)
9428            }
9429            _ => std::option::Option::None,
9430        })
9431    }
9432
9433    /// Sets the value of [database_details][crate::model::Database::database_details]
9434    /// to hold a `SqlserverDatabaseDetails`.
9435    ///
9436    /// Note that all the setters affecting `database_details` are
9437    /// mutually exclusive.
9438    pub fn set_sqlserver_database_details<
9439        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerDatabaseDetails>>,
9440    >(
9441        mut self,
9442        v: T,
9443    ) -> Self {
9444        self.database_details = std::option::Option::Some(
9445            crate::model::database::DatabaseDetails::SqlserverDatabaseDetails(v.into()),
9446        );
9447        self
9448    }
9449}
9450
9451impl wkt::message::Message for Database {
9452    fn typename() -> &'static str {
9453        "type.googleapis.com/google.cloud.sql.v1.Database"
9454    }
9455}
9456
9457/// Defines additional types related to [Database].
9458pub mod database {
9459    #[allow(unused_imports)]
9460    use super::*;
9461
9462    #[derive(Clone, Debug, PartialEq)]
9463    #[non_exhaustive]
9464    pub enum DatabaseDetails {
9465        SqlserverDatabaseDetails(std::boxed::Box<crate::model::SqlServerDatabaseDetails>),
9466    }
9467}
9468
9469/// Represents a Sql Server database on the Cloud SQL instance.
9470#[derive(Clone, Default, PartialEq)]
9471#[non_exhaustive]
9472pub struct SqlServerDatabaseDetails {
9473    /// The version of SQL Server with which the database is to be made compatible
9474    pub compatibility_level: i32,
9475
9476    /// The recovery model of a SQL Server database
9477    pub recovery_model: std::string::String,
9478
9479    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9480}
9481
9482impl SqlServerDatabaseDetails {
9483    pub fn new() -> Self {
9484        std::default::Default::default()
9485    }
9486
9487    /// Sets the value of [compatibility_level][crate::model::SqlServerDatabaseDetails::compatibility_level].
9488    pub fn set_compatibility_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9489        self.compatibility_level = v.into();
9490        self
9491    }
9492
9493    /// Sets the value of [recovery_model][crate::model::SqlServerDatabaseDetails::recovery_model].
9494    pub fn set_recovery_model<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9495        self.recovery_model = v.into();
9496        self
9497    }
9498}
9499
9500impl wkt::message::Message for SqlServerDatabaseDetails {
9501    fn typename() -> &'static str {
9502        "type.googleapis.com/google.cloud.sql.v1.SqlServerDatabaseDetails"
9503    }
9504}
9505
9506/// Database flags for Cloud SQL instances.
9507#[derive(Clone, Default, PartialEq)]
9508#[non_exhaustive]
9509pub struct DatabaseFlags {
9510    /// The name of the flag. These flags are passed at instance startup, so
9511    /// include both server options and system variables. Flags are
9512    /// specified with underscores, not hyphens. For more information, see
9513    /// [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
9514    /// in the Cloud SQL documentation.
9515    pub name: std::string::String,
9516
9517    /// The value of the flag. Boolean flags are set to `on` for true
9518    /// and `off` for false. This field must be omitted if the flag
9519    /// doesn't take a value.
9520    pub value: std::string::String,
9521
9522    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9523}
9524
9525impl DatabaseFlags {
9526    pub fn new() -> Self {
9527        std::default::Default::default()
9528    }
9529
9530    /// Sets the value of [name][crate::model::DatabaseFlags::name].
9531    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9532        self.name = v.into();
9533        self
9534    }
9535
9536    /// Sets the value of [value][crate::model::DatabaseFlags::value].
9537    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9538        self.value = v.into();
9539        self
9540    }
9541}
9542
9543impl wkt::message::Message for DatabaseFlags {
9544    fn typename() -> &'static str {
9545        "type.googleapis.com/google.cloud.sql.v1.DatabaseFlags"
9546    }
9547}
9548
9549/// MySQL-specific external server sync settings.
9550#[derive(Clone, Default, PartialEq)]
9551#[non_exhaustive]
9552pub struct MySqlSyncConfig {
9553    /// Flags to use for the initial dump.
9554    pub initial_sync_flags: std::vec::Vec<crate::model::SyncFlags>,
9555
9556    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9557}
9558
9559impl MySqlSyncConfig {
9560    pub fn new() -> Self {
9561        std::default::Default::default()
9562    }
9563
9564    /// Sets the value of [initial_sync_flags][crate::model::MySqlSyncConfig::initial_sync_flags].
9565    pub fn set_initial_sync_flags<T, V>(mut self, v: T) -> Self
9566    where
9567        T: std::iter::IntoIterator<Item = V>,
9568        V: std::convert::Into<crate::model::SyncFlags>,
9569    {
9570        use std::iter::Iterator;
9571        self.initial_sync_flags = v.into_iter().map(|i| i.into()).collect();
9572        self
9573    }
9574}
9575
9576impl wkt::message::Message for MySqlSyncConfig {
9577    fn typename() -> &'static str {
9578        "type.googleapis.com/google.cloud.sql.v1.MySqlSyncConfig"
9579    }
9580}
9581
9582/// Initial sync flags for certain Cloud SQL APIs.
9583/// Currently used for the MySQL external server initial dump.
9584#[derive(Clone, Default, PartialEq)]
9585#[non_exhaustive]
9586pub struct SyncFlags {
9587    /// The name of the flag.
9588    pub name: std::string::String,
9589
9590    /// The value of the flag. This field must be omitted if the flag
9591    /// doesn't take a value.
9592    pub value: std::string::String,
9593
9594    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9595}
9596
9597impl SyncFlags {
9598    pub fn new() -> Self {
9599        std::default::Default::default()
9600    }
9601
9602    /// Sets the value of [name][crate::model::SyncFlags::name].
9603    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9604        self.name = v.into();
9605        self
9606    }
9607
9608    /// Sets the value of [value][crate::model::SyncFlags::value].
9609    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9610        self.value = v.into();
9611        self
9612    }
9613}
9614
9615impl wkt::message::Message for SyncFlags {
9616    fn typename() -> &'static str {
9617        "type.googleapis.com/google.cloud.sql.v1.SyncFlags"
9618    }
9619}
9620
9621/// Reference to another Cloud SQL instance.
9622#[derive(Clone, Default, PartialEq)]
9623#[non_exhaustive]
9624pub struct InstanceReference {
9625    /// The name of the Cloud SQL instance being referenced.
9626    /// This does not include the project ID.
9627    pub name: std::string::String,
9628
9629    /// The region of the Cloud SQL instance being referenced.
9630    pub region: std::string::String,
9631
9632    /// The project ID of the Cloud SQL instance being referenced.
9633    /// The default is the same project ID as the instance references it.
9634    pub project: std::string::String,
9635
9636    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9637}
9638
9639impl InstanceReference {
9640    pub fn new() -> Self {
9641        std::default::Default::default()
9642    }
9643
9644    /// Sets the value of [name][crate::model::InstanceReference::name].
9645    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9646        self.name = v.into();
9647        self
9648    }
9649
9650    /// Sets the value of [region][crate::model::InstanceReference::region].
9651    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9652        self.region = v.into();
9653        self
9654    }
9655
9656    /// Sets the value of [project][crate::model::InstanceReference::project].
9657    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9658        self.project = v.into();
9659        self
9660    }
9661}
9662
9663impl wkt::message::Message for InstanceReference {
9664    fn typename() -> &'static str {
9665        "type.googleapis.com/google.cloud.sql.v1.InstanceReference"
9666    }
9667}
9668
9669/// Read-replica configuration for connecting to the on-premises primary
9670/// instance.
9671#[derive(Clone, Default, PartialEq)]
9672#[non_exhaustive]
9673pub struct DemoteMasterConfiguration {
9674    /// This is always `sql#demoteMasterConfiguration`.
9675    pub kind: std::string::String,
9676
9677    /// MySQL specific configuration when replicating from a MySQL on-premises
9678    /// primary instance. Replication configuration information such as the
9679    /// username, password, certificates, and keys are not stored in the instance
9680    /// metadata. The configuration information is used only to set up the
9681    /// replication connection and is stored by MySQL in a file named
9682    /// `master.info` in the data directory.
9683    pub mysql_replica_configuration:
9684        std::option::Option<crate::model::DemoteMasterMySqlReplicaConfiguration>,
9685
9686    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9687}
9688
9689impl DemoteMasterConfiguration {
9690    pub fn new() -> Self {
9691        std::default::Default::default()
9692    }
9693
9694    /// Sets the value of [kind][crate::model::DemoteMasterConfiguration::kind].
9695    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9696        self.kind = v.into();
9697        self
9698    }
9699
9700    /// Sets the value of [mysql_replica_configuration][crate::model::DemoteMasterConfiguration::mysql_replica_configuration].
9701    pub fn set_mysql_replica_configuration<T>(mut self, v: T) -> Self
9702    where
9703        T: std::convert::Into<crate::model::DemoteMasterMySqlReplicaConfiguration>,
9704    {
9705        self.mysql_replica_configuration = std::option::Option::Some(v.into());
9706        self
9707    }
9708
9709    /// Sets or clears the value of [mysql_replica_configuration][crate::model::DemoteMasterConfiguration::mysql_replica_configuration].
9710    pub fn set_or_clear_mysql_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
9711    where
9712        T: std::convert::Into<crate::model::DemoteMasterMySqlReplicaConfiguration>,
9713    {
9714        self.mysql_replica_configuration = v.map(|x| x.into());
9715        self
9716    }
9717}
9718
9719impl wkt::message::Message for DemoteMasterConfiguration {
9720    fn typename() -> &'static str {
9721        "type.googleapis.com/google.cloud.sql.v1.DemoteMasterConfiguration"
9722    }
9723}
9724
9725/// Read-replica configuration specific to MySQL databases.
9726#[derive(Clone, Default, PartialEq)]
9727#[non_exhaustive]
9728pub struct DemoteMasterMySqlReplicaConfiguration {
9729    /// This is always `sql#demoteMasterMysqlReplicaConfiguration`.
9730    pub kind: std::string::String,
9731
9732    /// The username for the replication connection.
9733    pub username: std::string::String,
9734
9735    /// The password for the replication connection.
9736    pub password: std::string::String,
9737
9738    /// PEM representation of the replica's private key. The corresponsing public
9739    /// key is encoded in the client's certificate. The format of the replica's
9740    /// private key can be either PKCS #1 or PKCS #8.
9741    pub client_key: std::string::String,
9742
9743    /// PEM representation of the replica's x509 certificate.
9744    pub client_certificate: std::string::String,
9745
9746    /// PEM representation of the trusted CA's x509 certificate.
9747    pub ca_certificate: std::string::String,
9748
9749    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9750}
9751
9752impl DemoteMasterMySqlReplicaConfiguration {
9753    pub fn new() -> Self {
9754        std::default::Default::default()
9755    }
9756
9757    /// Sets the value of [kind][crate::model::DemoteMasterMySqlReplicaConfiguration::kind].
9758    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9759        self.kind = v.into();
9760        self
9761    }
9762
9763    /// Sets the value of [username][crate::model::DemoteMasterMySqlReplicaConfiguration::username].
9764    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9765        self.username = v.into();
9766        self
9767    }
9768
9769    /// Sets the value of [password][crate::model::DemoteMasterMySqlReplicaConfiguration::password].
9770    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9771        self.password = v.into();
9772        self
9773    }
9774
9775    /// Sets the value of [client_key][crate::model::DemoteMasterMySqlReplicaConfiguration::client_key].
9776    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9777        self.client_key = v.into();
9778        self
9779    }
9780
9781    /// Sets the value of [client_certificate][crate::model::DemoteMasterMySqlReplicaConfiguration::client_certificate].
9782    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
9783        mut self,
9784        v: T,
9785    ) -> Self {
9786        self.client_certificate = v.into();
9787        self
9788    }
9789
9790    /// Sets the value of [ca_certificate][crate::model::DemoteMasterMySqlReplicaConfiguration::ca_certificate].
9791    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9792        self.ca_certificate = v.into();
9793        self
9794    }
9795}
9796
9797impl wkt::message::Message for DemoteMasterMySqlReplicaConfiguration {
9798    fn typename() -> &'static str {
9799        "type.googleapis.com/google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration"
9800    }
9801}
9802
9803/// Database instance export context.
9804#[derive(Clone, Default, PartialEq)]
9805#[non_exhaustive]
9806pub struct ExportContext {
9807    /// The path to the file in Google Cloud Storage where the export will be
9808    /// stored. The URI is in the form `gs://bucketName/fileName`. If the file
9809    /// already exists, the request succeeds, but the operation fails. If
9810    /// `fileType` is `SQL` and the filename ends with .gz,
9811    /// the contents are compressed.
9812    pub uri: std::string::String,
9813
9814    /// Databases to be exported. <br /> `MySQL instances:` If
9815    /// `fileType` is `SQL` and no database is specified, all
9816    /// databases are exported, except for the `mysql` system database.
9817    /// If `fileType` is `CSV`, you can specify one database,
9818    /// either by using this property or by using the
9819    /// `csvExportOptions.selectQuery` property, which takes precedence
9820    /// over this property. <br /> `PostgreSQL instances:` You must specify
9821    /// one database to be exported. If `fileType` is `CSV`,
9822    /// this database must match the one specified in the
9823    /// `csvExportOptions.selectQuery` property. <br /> `SQL Server
9824    /// instances:` You must specify one database to be exported, and the
9825    /// `fileType` must be `BAK`.
9826    pub databases: std::vec::Vec<std::string::String>,
9827
9828    /// This is always `sql#exportContext`.
9829    pub kind: std::string::String,
9830
9831    /// Options for exporting data as SQL statements.
9832    pub sql_export_options: std::option::Option<crate::model::export_context::SqlExportOptions>,
9833
9834    /// Options for exporting data as CSV. `MySQL` and `PostgreSQL`
9835    /// instances only.
9836    pub csv_export_options: std::option::Option<crate::model::export_context::SqlCsvExportOptions>,
9837
9838    /// The file type for the specified uri.
9839    pub file_type: crate::model::SqlFileType,
9840
9841    /// Option for export offload.
9842    pub offload: std::option::Option<wkt::BoolValue>,
9843
9844    /// Options for exporting data as BAK files.
9845    pub bak_export_options: std::option::Option<crate::model::export_context::SqlBakExportOptions>,
9846
9847    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9848}
9849
9850impl ExportContext {
9851    pub fn new() -> Self {
9852        std::default::Default::default()
9853    }
9854
9855    /// Sets the value of [uri][crate::model::ExportContext::uri].
9856    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9857        self.uri = v.into();
9858        self
9859    }
9860
9861    /// Sets the value of [databases][crate::model::ExportContext::databases].
9862    pub fn set_databases<T, V>(mut self, v: T) -> Self
9863    where
9864        T: std::iter::IntoIterator<Item = V>,
9865        V: std::convert::Into<std::string::String>,
9866    {
9867        use std::iter::Iterator;
9868        self.databases = v.into_iter().map(|i| i.into()).collect();
9869        self
9870    }
9871
9872    /// Sets the value of [kind][crate::model::ExportContext::kind].
9873    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9874        self.kind = v.into();
9875        self
9876    }
9877
9878    /// Sets the value of [sql_export_options][crate::model::ExportContext::sql_export_options].
9879    pub fn set_sql_export_options<T>(mut self, v: T) -> Self
9880    where
9881        T: std::convert::Into<crate::model::export_context::SqlExportOptions>,
9882    {
9883        self.sql_export_options = std::option::Option::Some(v.into());
9884        self
9885    }
9886
9887    /// Sets or clears the value of [sql_export_options][crate::model::ExportContext::sql_export_options].
9888    pub fn set_or_clear_sql_export_options<T>(mut self, v: std::option::Option<T>) -> Self
9889    where
9890        T: std::convert::Into<crate::model::export_context::SqlExportOptions>,
9891    {
9892        self.sql_export_options = v.map(|x| x.into());
9893        self
9894    }
9895
9896    /// Sets the value of [csv_export_options][crate::model::ExportContext::csv_export_options].
9897    pub fn set_csv_export_options<T>(mut self, v: T) -> Self
9898    where
9899        T: std::convert::Into<crate::model::export_context::SqlCsvExportOptions>,
9900    {
9901        self.csv_export_options = std::option::Option::Some(v.into());
9902        self
9903    }
9904
9905    /// Sets or clears the value of [csv_export_options][crate::model::ExportContext::csv_export_options].
9906    pub fn set_or_clear_csv_export_options<T>(mut self, v: std::option::Option<T>) -> Self
9907    where
9908        T: std::convert::Into<crate::model::export_context::SqlCsvExportOptions>,
9909    {
9910        self.csv_export_options = v.map(|x| x.into());
9911        self
9912    }
9913
9914    /// Sets the value of [file_type][crate::model::ExportContext::file_type].
9915    pub fn set_file_type<T: std::convert::Into<crate::model::SqlFileType>>(mut self, v: T) -> Self {
9916        self.file_type = v.into();
9917        self
9918    }
9919
9920    /// Sets the value of [offload][crate::model::ExportContext::offload].
9921    pub fn set_offload<T>(mut self, v: T) -> Self
9922    where
9923        T: std::convert::Into<wkt::BoolValue>,
9924    {
9925        self.offload = std::option::Option::Some(v.into());
9926        self
9927    }
9928
9929    /// Sets or clears the value of [offload][crate::model::ExportContext::offload].
9930    pub fn set_or_clear_offload<T>(mut self, v: std::option::Option<T>) -> Self
9931    where
9932        T: std::convert::Into<wkt::BoolValue>,
9933    {
9934        self.offload = v.map(|x| x.into());
9935        self
9936    }
9937
9938    /// Sets the value of [bak_export_options][crate::model::ExportContext::bak_export_options].
9939    pub fn set_bak_export_options<T>(mut self, v: T) -> Self
9940    where
9941        T: std::convert::Into<crate::model::export_context::SqlBakExportOptions>,
9942    {
9943        self.bak_export_options = std::option::Option::Some(v.into());
9944        self
9945    }
9946
9947    /// Sets or clears the value of [bak_export_options][crate::model::ExportContext::bak_export_options].
9948    pub fn set_or_clear_bak_export_options<T>(mut self, v: std::option::Option<T>) -> Self
9949    where
9950        T: std::convert::Into<crate::model::export_context::SqlBakExportOptions>,
9951    {
9952        self.bak_export_options = v.map(|x| x.into());
9953        self
9954    }
9955}
9956
9957impl wkt::message::Message for ExportContext {
9958    fn typename() -> &'static str {
9959        "type.googleapis.com/google.cloud.sql.v1.ExportContext"
9960    }
9961}
9962
9963/// Defines additional types related to [ExportContext].
9964pub mod export_context {
9965    #[allow(unused_imports)]
9966    use super::*;
9967
9968    #[derive(Clone, Default, PartialEq)]
9969    #[non_exhaustive]
9970    pub struct SqlCsvExportOptions {
9971        /// The select query used to extract the data.
9972        pub select_query: std::string::String,
9973
9974        /// Specifies the character that should appear before a data character that
9975        /// needs to be escaped.
9976        pub escape_character: std::string::String,
9977
9978        /// Specifies the quoting character to be used when a data value is quoted.
9979        pub quote_character: std::string::String,
9980
9981        /// Specifies the character that separates columns within each row (line) of
9982        /// the file.
9983        pub fields_terminated_by: std::string::String,
9984
9985        /// This is used to separate lines. If a line does not contain all fields,
9986        /// the rest of the columns are set to their default values.
9987        pub lines_terminated_by: std::string::String,
9988
9989        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9990    }
9991
9992    impl SqlCsvExportOptions {
9993        pub fn new() -> Self {
9994            std::default::Default::default()
9995        }
9996
9997        /// Sets the value of [select_query][crate::model::export_context::SqlCsvExportOptions::select_query].
9998        pub fn set_select_query<T: std::convert::Into<std::string::String>>(
9999            mut self,
10000            v: T,
10001        ) -> Self {
10002            self.select_query = v.into();
10003            self
10004        }
10005
10006        /// Sets the value of [escape_character][crate::model::export_context::SqlCsvExportOptions::escape_character].
10007        pub fn set_escape_character<T: std::convert::Into<std::string::String>>(
10008            mut self,
10009            v: T,
10010        ) -> Self {
10011            self.escape_character = v.into();
10012            self
10013        }
10014
10015        /// Sets the value of [quote_character][crate::model::export_context::SqlCsvExportOptions::quote_character].
10016        pub fn set_quote_character<T: std::convert::Into<std::string::String>>(
10017            mut self,
10018            v: T,
10019        ) -> Self {
10020            self.quote_character = v.into();
10021            self
10022        }
10023
10024        /// Sets the value of [fields_terminated_by][crate::model::export_context::SqlCsvExportOptions::fields_terminated_by].
10025        pub fn set_fields_terminated_by<T: std::convert::Into<std::string::String>>(
10026            mut self,
10027            v: T,
10028        ) -> Self {
10029            self.fields_terminated_by = v.into();
10030            self
10031        }
10032
10033        /// Sets the value of [lines_terminated_by][crate::model::export_context::SqlCsvExportOptions::lines_terminated_by].
10034        pub fn set_lines_terminated_by<T: std::convert::Into<std::string::String>>(
10035            mut self,
10036            v: T,
10037        ) -> Self {
10038            self.lines_terminated_by = v.into();
10039            self
10040        }
10041    }
10042
10043    impl wkt::message::Message for SqlCsvExportOptions {
10044        fn typename() -> &'static str {
10045            "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlCsvExportOptions"
10046        }
10047    }
10048
10049    #[derive(Clone, Default, PartialEq)]
10050    #[non_exhaustive]
10051    pub struct SqlExportOptions {
10052        /// Tables to export, or that were exported, from the specified database. If
10053        /// you specify tables, specify one and only one database. For PostgreSQL
10054        /// instances, you can specify only one table.
10055        pub tables: std::vec::Vec<std::string::String>,
10056
10057        /// Export only schemas.
10058        pub schema_only: std::option::Option<wkt::BoolValue>,
10059
10060        pub mysql_export_options: std::option::Option<
10061            crate::model::export_context::sql_export_options::MysqlExportOptions,
10062        >,
10063
10064        /// Optional. The number of threads to use for parallel export.
10065        pub threads: std::option::Option<wkt::Int32Value>,
10066
10067        /// Optional. Whether or not the export should be parallel.
10068        pub parallel: std::option::Option<wkt::BoolValue>,
10069
10070        /// Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
10071        pub postgres_export_options: std::option::Option<
10072            crate::model::export_context::sql_export_options::PostgresExportOptions,
10073        >,
10074
10075        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10076    }
10077
10078    impl SqlExportOptions {
10079        pub fn new() -> Self {
10080            std::default::Default::default()
10081        }
10082
10083        /// Sets the value of [tables][crate::model::export_context::SqlExportOptions::tables].
10084        pub fn set_tables<T, V>(mut self, v: T) -> Self
10085        where
10086            T: std::iter::IntoIterator<Item = V>,
10087            V: std::convert::Into<std::string::String>,
10088        {
10089            use std::iter::Iterator;
10090            self.tables = v.into_iter().map(|i| i.into()).collect();
10091            self
10092        }
10093
10094        /// Sets the value of [schema_only][crate::model::export_context::SqlExportOptions::schema_only].
10095        pub fn set_schema_only<T>(mut self, v: T) -> Self
10096        where
10097            T: std::convert::Into<wkt::BoolValue>,
10098        {
10099            self.schema_only = std::option::Option::Some(v.into());
10100            self
10101        }
10102
10103        /// Sets or clears the value of [schema_only][crate::model::export_context::SqlExportOptions::schema_only].
10104        pub fn set_or_clear_schema_only<T>(mut self, v: std::option::Option<T>) -> Self
10105        where
10106            T: std::convert::Into<wkt::BoolValue>,
10107        {
10108            self.schema_only = v.map(|x| x.into());
10109            self
10110        }
10111
10112        /// Sets the value of [mysql_export_options][crate::model::export_context::SqlExportOptions::mysql_export_options].
10113        pub fn set_mysql_export_options<T>(mut self, v: T) -> Self
10114        where
10115            T: std::convert::Into<
10116                    crate::model::export_context::sql_export_options::MysqlExportOptions,
10117                >,
10118        {
10119            self.mysql_export_options = std::option::Option::Some(v.into());
10120            self
10121        }
10122
10123        /// Sets or clears the value of [mysql_export_options][crate::model::export_context::SqlExportOptions::mysql_export_options].
10124        pub fn set_or_clear_mysql_export_options<T>(mut self, v: std::option::Option<T>) -> Self
10125        where
10126            T: std::convert::Into<
10127                    crate::model::export_context::sql_export_options::MysqlExportOptions,
10128                >,
10129        {
10130            self.mysql_export_options = v.map(|x| x.into());
10131            self
10132        }
10133
10134        /// Sets the value of [threads][crate::model::export_context::SqlExportOptions::threads].
10135        pub fn set_threads<T>(mut self, v: T) -> Self
10136        where
10137            T: std::convert::Into<wkt::Int32Value>,
10138        {
10139            self.threads = std::option::Option::Some(v.into());
10140            self
10141        }
10142
10143        /// Sets or clears the value of [threads][crate::model::export_context::SqlExportOptions::threads].
10144        pub fn set_or_clear_threads<T>(mut self, v: std::option::Option<T>) -> Self
10145        where
10146            T: std::convert::Into<wkt::Int32Value>,
10147        {
10148            self.threads = v.map(|x| x.into());
10149            self
10150        }
10151
10152        /// Sets the value of [parallel][crate::model::export_context::SqlExportOptions::parallel].
10153        pub fn set_parallel<T>(mut self, v: T) -> Self
10154        where
10155            T: std::convert::Into<wkt::BoolValue>,
10156        {
10157            self.parallel = std::option::Option::Some(v.into());
10158            self
10159        }
10160
10161        /// Sets or clears the value of [parallel][crate::model::export_context::SqlExportOptions::parallel].
10162        pub fn set_or_clear_parallel<T>(mut self, v: std::option::Option<T>) -> Self
10163        where
10164            T: std::convert::Into<wkt::BoolValue>,
10165        {
10166            self.parallel = v.map(|x| x.into());
10167            self
10168        }
10169
10170        /// Sets the value of [postgres_export_options][crate::model::export_context::SqlExportOptions::postgres_export_options].
10171        pub fn set_postgres_export_options<T>(mut self, v: T) -> Self
10172        where
10173            T: std::convert::Into<
10174                    crate::model::export_context::sql_export_options::PostgresExportOptions,
10175                >,
10176        {
10177            self.postgres_export_options = std::option::Option::Some(v.into());
10178            self
10179        }
10180
10181        /// Sets or clears the value of [postgres_export_options][crate::model::export_context::SqlExportOptions::postgres_export_options].
10182        pub fn set_or_clear_postgres_export_options<T>(mut self, v: std::option::Option<T>) -> Self
10183        where
10184            T: std::convert::Into<
10185                    crate::model::export_context::sql_export_options::PostgresExportOptions,
10186                >,
10187        {
10188            self.postgres_export_options = v.map(|x| x.into());
10189            self
10190        }
10191    }
10192
10193    impl wkt::message::Message for SqlExportOptions {
10194        fn typename() -> &'static str {
10195            "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions"
10196        }
10197    }
10198
10199    /// Defines additional types related to [SqlExportOptions].
10200    pub mod sql_export_options {
10201        #[allow(unused_imports)]
10202        use super::*;
10203
10204        /// Options for exporting from MySQL.
10205        #[derive(Clone, Default, PartialEq)]
10206        #[non_exhaustive]
10207        pub struct MysqlExportOptions {
10208            /// Option to include SQL statement required to set up replication. If set
10209            /// to `1`, the dump file includes a CHANGE MASTER TO statement with the
10210            /// binary log coordinates, and --set-gtid-purged is set to ON. If set to
10211            /// `2`, the CHANGE MASTER TO statement is written as a SQL comment and
10212            /// has no effect. If set to any value other than `1`, --set-gtid-purged
10213            /// is set to OFF.
10214            pub master_data: std::option::Option<wkt::Int32Value>,
10215
10216            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10217        }
10218
10219        impl MysqlExportOptions {
10220            pub fn new() -> Self {
10221                std::default::Default::default()
10222            }
10223
10224            /// Sets the value of [master_data][crate::model::export_context::sql_export_options::MysqlExportOptions::master_data].
10225            pub fn set_master_data<T>(mut self, v: T) -> Self
10226            where
10227                T: std::convert::Into<wkt::Int32Value>,
10228            {
10229                self.master_data = std::option::Option::Some(v.into());
10230                self
10231            }
10232
10233            /// Sets or clears the value of [master_data][crate::model::export_context::sql_export_options::MysqlExportOptions::master_data].
10234            pub fn set_or_clear_master_data<T>(mut self, v: std::option::Option<T>) -> Self
10235            where
10236                T: std::convert::Into<wkt::Int32Value>,
10237            {
10238                self.master_data = v.map(|x| x.into());
10239                self
10240            }
10241        }
10242
10243        impl wkt::message::Message for MysqlExportOptions {
10244            fn typename() -> &'static str {
10245                "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions"
10246            }
10247        }
10248
10249        /// Options for exporting from a Cloud SQL for PostgreSQL instance.
10250        #[derive(Clone, Default, PartialEq)]
10251        #[non_exhaustive]
10252        pub struct PostgresExportOptions {
10253            /// Optional. Use this option to include DROP \<object\> SQL statements.
10254            /// These statements are used to delete database objects before running the
10255            /// import operation.
10256            pub clean: std::option::Option<wkt::BoolValue>,
10257
10258            /// Optional. Option to include an IF EXISTS SQL statement with each DROP
10259            /// statement produced by clean.
10260            pub if_exists: std::option::Option<wkt::BoolValue>,
10261
10262            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10263        }
10264
10265        impl PostgresExportOptions {
10266            pub fn new() -> Self {
10267                std::default::Default::default()
10268            }
10269
10270            /// Sets the value of [clean][crate::model::export_context::sql_export_options::PostgresExportOptions::clean].
10271            pub fn set_clean<T>(mut self, v: T) -> Self
10272            where
10273                T: std::convert::Into<wkt::BoolValue>,
10274            {
10275                self.clean = std::option::Option::Some(v.into());
10276                self
10277            }
10278
10279            /// Sets or clears the value of [clean][crate::model::export_context::sql_export_options::PostgresExportOptions::clean].
10280            pub fn set_or_clear_clean<T>(mut self, v: std::option::Option<T>) -> Self
10281            where
10282                T: std::convert::Into<wkt::BoolValue>,
10283            {
10284                self.clean = v.map(|x| x.into());
10285                self
10286            }
10287
10288            /// Sets the value of [if_exists][crate::model::export_context::sql_export_options::PostgresExportOptions::if_exists].
10289            pub fn set_if_exists<T>(mut self, v: T) -> Self
10290            where
10291                T: std::convert::Into<wkt::BoolValue>,
10292            {
10293                self.if_exists = std::option::Option::Some(v.into());
10294                self
10295            }
10296
10297            /// Sets or clears the value of [if_exists][crate::model::export_context::sql_export_options::PostgresExportOptions::if_exists].
10298            pub fn set_or_clear_if_exists<T>(mut self, v: std::option::Option<T>) -> Self
10299            where
10300                T: std::convert::Into<wkt::BoolValue>,
10301            {
10302                self.if_exists = v.map(|x| x.into());
10303                self
10304            }
10305        }
10306
10307        impl wkt::message::Message for PostgresExportOptions {
10308            fn typename() -> &'static str {
10309                "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions"
10310            }
10311        }
10312    }
10313
10314    /// Options for exporting BAK files (SQL Server-only)
10315    #[derive(Clone, Default, PartialEq)]
10316    #[non_exhaustive]
10317    pub struct SqlBakExportOptions {
10318        /// Whether or not the export should be striped.
10319        pub striped: std::option::Option<wkt::BoolValue>,
10320
10321        /// Option for specifying how many stripes to use for the export.
10322        /// If blank, and the value of the striped field is true,
10323        /// the number of stripes is automatically chosen.
10324        pub stripe_count: std::option::Option<wkt::Int32Value>,
10325
10326        /// Type of this bak file will be export, FULL or DIFF, SQL Server only
10327        pub bak_type: crate::model::BakType,
10328
10329        /// Deprecated: copy_only is deprecated. Use differential_base instead
10330        #[deprecated]
10331        pub copy_only: std::option::Option<wkt::BoolValue>,
10332
10333        /// Whether or not the backup can be used as a differential base
10334        /// copy_only backup can not be served as differential base
10335        pub differential_base: std::option::Option<wkt::BoolValue>,
10336
10337        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10338    }
10339
10340    impl SqlBakExportOptions {
10341        pub fn new() -> Self {
10342            std::default::Default::default()
10343        }
10344
10345        /// Sets the value of [striped][crate::model::export_context::SqlBakExportOptions::striped].
10346        pub fn set_striped<T>(mut self, v: T) -> Self
10347        where
10348            T: std::convert::Into<wkt::BoolValue>,
10349        {
10350            self.striped = std::option::Option::Some(v.into());
10351            self
10352        }
10353
10354        /// Sets or clears the value of [striped][crate::model::export_context::SqlBakExportOptions::striped].
10355        pub fn set_or_clear_striped<T>(mut self, v: std::option::Option<T>) -> Self
10356        where
10357            T: std::convert::Into<wkt::BoolValue>,
10358        {
10359            self.striped = v.map(|x| x.into());
10360            self
10361        }
10362
10363        /// Sets the value of [stripe_count][crate::model::export_context::SqlBakExportOptions::stripe_count].
10364        pub fn set_stripe_count<T>(mut self, v: T) -> Self
10365        where
10366            T: std::convert::Into<wkt::Int32Value>,
10367        {
10368            self.stripe_count = std::option::Option::Some(v.into());
10369            self
10370        }
10371
10372        /// Sets or clears the value of [stripe_count][crate::model::export_context::SqlBakExportOptions::stripe_count].
10373        pub fn set_or_clear_stripe_count<T>(mut self, v: std::option::Option<T>) -> Self
10374        where
10375            T: std::convert::Into<wkt::Int32Value>,
10376        {
10377            self.stripe_count = v.map(|x| x.into());
10378            self
10379        }
10380
10381        /// Sets the value of [bak_type][crate::model::export_context::SqlBakExportOptions::bak_type].
10382        pub fn set_bak_type<T: std::convert::Into<crate::model::BakType>>(mut self, v: T) -> Self {
10383            self.bak_type = v.into();
10384            self
10385        }
10386
10387        /// Sets the value of [copy_only][crate::model::export_context::SqlBakExportOptions::copy_only].
10388        #[deprecated]
10389        pub fn set_copy_only<T>(mut self, v: T) -> Self
10390        where
10391            T: std::convert::Into<wkt::BoolValue>,
10392        {
10393            self.copy_only = std::option::Option::Some(v.into());
10394            self
10395        }
10396
10397        /// Sets or clears the value of [copy_only][crate::model::export_context::SqlBakExportOptions::copy_only].
10398        #[deprecated]
10399        pub fn set_or_clear_copy_only<T>(mut self, v: std::option::Option<T>) -> Self
10400        where
10401            T: std::convert::Into<wkt::BoolValue>,
10402        {
10403            self.copy_only = v.map(|x| x.into());
10404            self
10405        }
10406
10407        /// Sets the value of [differential_base][crate::model::export_context::SqlBakExportOptions::differential_base].
10408        pub fn set_differential_base<T>(mut self, v: T) -> Self
10409        where
10410            T: std::convert::Into<wkt::BoolValue>,
10411        {
10412            self.differential_base = std::option::Option::Some(v.into());
10413            self
10414        }
10415
10416        /// Sets or clears the value of [differential_base][crate::model::export_context::SqlBakExportOptions::differential_base].
10417        pub fn set_or_clear_differential_base<T>(mut self, v: std::option::Option<T>) -> Self
10418        where
10419            T: std::convert::Into<wkt::BoolValue>,
10420        {
10421            self.differential_base = v.map(|x| x.into());
10422            self
10423        }
10424    }
10425
10426    impl wkt::message::Message for SqlBakExportOptions {
10427        fn typename() -> &'static str {
10428            "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlBakExportOptions"
10429        }
10430    }
10431}
10432
10433/// Database instance import context.
10434#[derive(Clone, Default, PartialEq)]
10435#[non_exhaustive]
10436pub struct ImportContext {
10437    /// Path to the import file in Cloud Storage, in the form
10438    /// `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
10439    /// when `fileType` is `SQL`. The instance must have
10440    /// write permissions to the bucket and read access to the file.
10441    pub uri: std::string::String,
10442
10443    /// The target database for the import. If `fileType` is `SQL`, this field
10444    /// is required only if the import file does not specify a database, and is
10445    /// overridden by any database specification in the import file. If
10446    /// `fileType` is `CSV`, one database must be specified.
10447    pub database: std::string::String,
10448
10449    /// This is always `sql#importContext`.
10450    pub kind: std::string::String,
10451
10452    /// The file type for the specified uri.\`SQL`: The file
10453    /// contains SQL statements. \`CSV`: The file contains CSV data.
10454    pub file_type: crate::model::SqlFileType,
10455
10456    /// Options for importing data as CSV.
10457    pub csv_import_options: std::option::Option<crate::model::import_context::SqlCsvImportOptions>,
10458
10459    /// The PostgreSQL user for this import operation. PostgreSQL instances only.
10460    pub import_user: std::string::String,
10461
10462    /// Import parameters specific to SQL Server .BAK files
10463    pub bak_import_options: std::option::Option<crate::model::import_context::SqlBakImportOptions>,
10464
10465    /// Optional. Options for importing data from SQL statements.
10466    pub sql_import_options: std::option::Option<crate::model::import_context::SqlImportOptions>,
10467
10468    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10469}
10470
10471impl ImportContext {
10472    pub fn new() -> Self {
10473        std::default::Default::default()
10474    }
10475
10476    /// Sets the value of [uri][crate::model::ImportContext::uri].
10477    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10478        self.uri = v.into();
10479        self
10480    }
10481
10482    /// Sets the value of [database][crate::model::ImportContext::database].
10483    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10484        self.database = v.into();
10485        self
10486    }
10487
10488    /// Sets the value of [kind][crate::model::ImportContext::kind].
10489    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10490        self.kind = v.into();
10491        self
10492    }
10493
10494    /// Sets the value of [file_type][crate::model::ImportContext::file_type].
10495    pub fn set_file_type<T: std::convert::Into<crate::model::SqlFileType>>(mut self, v: T) -> Self {
10496        self.file_type = v.into();
10497        self
10498    }
10499
10500    /// Sets the value of [csv_import_options][crate::model::ImportContext::csv_import_options].
10501    pub fn set_csv_import_options<T>(mut self, v: T) -> Self
10502    where
10503        T: std::convert::Into<crate::model::import_context::SqlCsvImportOptions>,
10504    {
10505        self.csv_import_options = std::option::Option::Some(v.into());
10506        self
10507    }
10508
10509    /// Sets or clears the value of [csv_import_options][crate::model::ImportContext::csv_import_options].
10510    pub fn set_or_clear_csv_import_options<T>(mut self, v: std::option::Option<T>) -> Self
10511    where
10512        T: std::convert::Into<crate::model::import_context::SqlCsvImportOptions>,
10513    {
10514        self.csv_import_options = v.map(|x| x.into());
10515        self
10516    }
10517
10518    /// Sets the value of [import_user][crate::model::ImportContext::import_user].
10519    pub fn set_import_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10520        self.import_user = v.into();
10521        self
10522    }
10523
10524    /// Sets the value of [bak_import_options][crate::model::ImportContext::bak_import_options].
10525    pub fn set_bak_import_options<T>(mut self, v: T) -> Self
10526    where
10527        T: std::convert::Into<crate::model::import_context::SqlBakImportOptions>,
10528    {
10529        self.bak_import_options = std::option::Option::Some(v.into());
10530        self
10531    }
10532
10533    /// Sets or clears the value of [bak_import_options][crate::model::ImportContext::bak_import_options].
10534    pub fn set_or_clear_bak_import_options<T>(mut self, v: std::option::Option<T>) -> Self
10535    where
10536        T: std::convert::Into<crate::model::import_context::SqlBakImportOptions>,
10537    {
10538        self.bak_import_options = v.map(|x| x.into());
10539        self
10540    }
10541
10542    /// Sets the value of [sql_import_options][crate::model::ImportContext::sql_import_options].
10543    pub fn set_sql_import_options<T>(mut self, v: T) -> Self
10544    where
10545        T: std::convert::Into<crate::model::import_context::SqlImportOptions>,
10546    {
10547        self.sql_import_options = std::option::Option::Some(v.into());
10548        self
10549    }
10550
10551    /// Sets or clears the value of [sql_import_options][crate::model::ImportContext::sql_import_options].
10552    pub fn set_or_clear_sql_import_options<T>(mut self, v: std::option::Option<T>) -> Self
10553    where
10554        T: std::convert::Into<crate::model::import_context::SqlImportOptions>,
10555    {
10556        self.sql_import_options = v.map(|x| x.into());
10557        self
10558    }
10559}
10560
10561impl wkt::message::Message for ImportContext {
10562    fn typename() -> &'static str {
10563        "type.googleapis.com/google.cloud.sql.v1.ImportContext"
10564    }
10565}
10566
10567/// Defines additional types related to [ImportContext].
10568pub mod import_context {
10569    #[allow(unused_imports)]
10570    use super::*;
10571
10572    #[derive(Clone, Default, PartialEq)]
10573    #[non_exhaustive]
10574    pub struct SqlImportOptions {
10575        /// Optional. The number of threads to use for parallel import.
10576        pub threads: std::option::Option<wkt::Int32Value>,
10577
10578        /// Optional. Whether or not the import should be parallel.
10579        pub parallel: std::option::Option<wkt::BoolValue>,
10580
10581        /// Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
10582        pub postgres_import_options: std::option::Option<
10583            crate::model::import_context::sql_import_options::PostgresImportOptions,
10584        >,
10585
10586        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10587    }
10588
10589    impl SqlImportOptions {
10590        pub fn new() -> Self {
10591            std::default::Default::default()
10592        }
10593
10594        /// Sets the value of [threads][crate::model::import_context::SqlImportOptions::threads].
10595        pub fn set_threads<T>(mut self, v: T) -> Self
10596        where
10597            T: std::convert::Into<wkt::Int32Value>,
10598        {
10599            self.threads = std::option::Option::Some(v.into());
10600            self
10601        }
10602
10603        /// Sets or clears the value of [threads][crate::model::import_context::SqlImportOptions::threads].
10604        pub fn set_or_clear_threads<T>(mut self, v: std::option::Option<T>) -> Self
10605        where
10606            T: std::convert::Into<wkt::Int32Value>,
10607        {
10608            self.threads = v.map(|x| x.into());
10609            self
10610        }
10611
10612        /// Sets the value of [parallel][crate::model::import_context::SqlImportOptions::parallel].
10613        pub fn set_parallel<T>(mut self, v: T) -> Self
10614        where
10615            T: std::convert::Into<wkt::BoolValue>,
10616        {
10617            self.parallel = std::option::Option::Some(v.into());
10618            self
10619        }
10620
10621        /// Sets or clears the value of [parallel][crate::model::import_context::SqlImportOptions::parallel].
10622        pub fn set_or_clear_parallel<T>(mut self, v: std::option::Option<T>) -> Self
10623        where
10624            T: std::convert::Into<wkt::BoolValue>,
10625        {
10626            self.parallel = v.map(|x| x.into());
10627            self
10628        }
10629
10630        /// Sets the value of [postgres_import_options][crate::model::import_context::SqlImportOptions::postgres_import_options].
10631        pub fn set_postgres_import_options<T>(mut self, v: T) -> Self
10632        where
10633            T: std::convert::Into<
10634                    crate::model::import_context::sql_import_options::PostgresImportOptions,
10635                >,
10636        {
10637            self.postgres_import_options = std::option::Option::Some(v.into());
10638            self
10639        }
10640
10641        /// Sets or clears the value of [postgres_import_options][crate::model::import_context::SqlImportOptions::postgres_import_options].
10642        pub fn set_or_clear_postgres_import_options<T>(mut self, v: std::option::Option<T>) -> Self
10643        where
10644            T: std::convert::Into<
10645                    crate::model::import_context::sql_import_options::PostgresImportOptions,
10646                >,
10647        {
10648            self.postgres_import_options = v.map(|x| x.into());
10649            self
10650        }
10651    }
10652
10653    impl wkt::message::Message for SqlImportOptions {
10654        fn typename() -> &'static str {
10655            "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlImportOptions"
10656        }
10657    }
10658
10659    /// Defines additional types related to [SqlImportOptions].
10660    pub mod sql_import_options {
10661        #[allow(unused_imports)]
10662        use super::*;
10663
10664        #[derive(Clone, Default, PartialEq)]
10665        #[non_exhaustive]
10666        pub struct PostgresImportOptions {
10667            /// Optional. The --clean flag for the pg_restore utility. This flag
10668            /// applies only if you enabled Cloud SQL to import files in parallel.
10669            pub clean: std::option::Option<wkt::BoolValue>,
10670
10671            /// Optional. The --if-exists flag for the pg_restore utility. This flag
10672            /// applies only if you enabled Cloud SQL to import files in parallel.
10673            pub if_exists: std::option::Option<wkt::BoolValue>,
10674
10675            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10676        }
10677
10678        impl PostgresImportOptions {
10679            pub fn new() -> Self {
10680                std::default::Default::default()
10681            }
10682
10683            /// Sets the value of [clean][crate::model::import_context::sql_import_options::PostgresImportOptions::clean].
10684            pub fn set_clean<T>(mut self, v: T) -> Self
10685            where
10686                T: std::convert::Into<wkt::BoolValue>,
10687            {
10688                self.clean = std::option::Option::Some(v.into());
10689                self
10690            }
10691
10692            /// Sets or clears the value of [clean][crate::model::import_context::sql_import_options::PostgresImportOptions::clean].
10693            pub fn set_or_clear_clean<T>(mut self, v: std::option::Option<T>) -> Self
10694            where
10695                T: std::convert::Into<wkt::BoolValue>,
10696            {
10697                self.clean = v.map(|x| x.into());
10698                self
10699            }
10700
10701            /// Sets the value of [if_exists][crate::model::import_context::sql_import_options::PostgresImportOptions::if_exists].
10702            pub fn set_if_exists<T>(mut self, v: T) -> Self
10703            where
10704                T: std::convert::Into<wkt::BoolValue>,
10705            {
10706                self.if_exists = std::option::Option::Some(v.into());
10707                self
10708            }
10709
10710            /// Sets or clears the value of [if_exists][crate::model::import_context::sql_import_options::PostgresImportOptions::if_exists].
10711            pub fn set_or_clear_if_exists<T>(mut self, v: std::option::Option<T>) -> Self
10712            where
10713                T: std::convert::Into<wkt::BoolValue>,
10714            {
10715                self.if_exists = v.map(|x| x.into());
10716                self
10717            }
10718        }
10719
10720        impl wkt::message::Message for PostgresImportOptions {
10721            fn typename() -> &'static str {
10722                "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions"
10723            }
10724        }
10725    }
10726
10727    #[derive(Clone, Default, PartialEq)]
10728    #[non_exhaustive]
10729    pub struct SqlCsvImportOptions {
10730        /// The table to which CSV data is imported.
10731        pub table: std::string::String,
10732
10733        /// The columns to which CSV data is imported. If not specified, all columns
10734        /// of the database table are loaded with CSV data.
10735        pub columns: std::vec::Vec<std::string::String>,
10736
10737        /// Specifies the character that should appear before a data character that
10738        /// needs to be escaped.
10739        pub escape_character: std::string::String,
10740
10741        /// Specifies the quoting character to be used when a data value is quoted.
10742        pub quote_character: std::string::String,
10743
10744        /// Specifies the character that separates columns within each row (line) of
10745        /// the file.
10746        pub fields_terminated_by: std::string::String,
10747
10748        /// This is used to separate lines. If a line does not contain all fields,
10749        /// the rest of the columns are set to their default values.
10750        pub lines_terminated_by: std::string::String,
10751
10752        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10753    }
10754
10755    impl SqlCsvImportOptions {
10756        pub fn new() -> Self {
10757            std::default::Default::default()
10758        }
10759
10760        /// Sets the value of [table][crate::model::import_context::SqlCsvImportOptions::table].
10761        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10762            self.table = v.into();
10763            self
10764        }
10765
10766        /// Sets the value of [columns][crate::model::import_context::SqlCsvImportOptions::columns].
10767        pub fn set_columns<T, V>(mut self, v: T) -> Self
10768        where
10769            T: std::iter::IntoIterator<Item = V>,
10770            V: std::convert::Into<std::string::String>,
10771        {
10772            use std::iter::Iterator;
10773            self.columns = v.into_iter().map(|i| i.into()).collect();
10774            self
10775        }
10776
10777        /// Sets the value of [escape_character][crate::model::import_context::SqlCsvImportOptions::escape_character].
10778        pub fn set_escape_character<T: std::convert::Into<std::string::String>>(
10779            mut self,
10780            v: T,
10781        ) -> Self {
10782            self.escape_character = v.into();
10783            self
10784        }
10785
10786        /// Sets the value of [quote_character][crate::model::import_context::SqlCsvImportOptions::quote_character].
10787        pub fn set_quote_character<T: std::convert::Into<std::string::String>>(
10788            mut self,
10789            v: T,
10790        ) -> Self {
10791            self.quote_character = v.into();
10792            self
10793        }
10794
10795        /// Sets the value of [fields_terminated_by][crate::model::import_context::SqlCsvImportOptions::fields_terminated_by].
10796        pub fn set_fields_terminated_by<T: std::convert::Into<std::string::String>>(
10797            mut self,
10798            v: T,
10799        ) -> Self {
10800            self.fields_terminated_by = v.into();
10801            self
10802        }
10803
10804        /// Sets the value of [lines_terminated_by][crate::model::import_context::SqlCsvImportOptions::lines_terminated_by].
10805        pub fn set_lines_terminated_by<T: std::convert::Into<std::string::String>>(
10806            mut self,
10807            v: T,
10808        ) -> Self {
10809            self.lines_terminated_by = v.into();
10810            self
10811        }
10812    }
10813
10814    impl wkt::message::Message for SqlCsvImportOptions {
10815        fn typename() -> &'static str {
10816            "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlCsvImportOptions"
10817        }
10818    }
10819
10820    #[derive(Clone, Default, PartialEq)]
10821    #[non_exhaustive]
10822    pub struct SqlBakImportOptions {
10823        pub encryption_options: std::option::Option<
10824            crate::model::import_context::sql_bak_import_options::EncryptionOptions,
10825        >,
10826
10827        /// Whether or not the backup set being restored is striped.
10828        /// Applies only to Cloud SQL for SQL Server.
10829        pub striped: std::option::Option<wkt::BoolValue>,
10830
10831        /// Whether or not the backup importing will restore database
10832        /// with NORECOVERY option
10833        /// Applies only to Cloud SQL for SQL Server.
10834        pub no_recovery: std::option::Option<wkt::BoolValue>,
10835
10836        /// Whether or not the backup importing request will just bring database
10837        /// online without downloading Bak content only one of "no_recovery" and
10838        /// "recovery_only" can be true otherwise error will return. Applies only to
10839        /// Cloud SQL for SQL Server.
10840        pub recovery_only: std::option::Option<wkt::BoolValue>,
10841
10842        /// Type of the bak content, FULL or DIFF
10843        pub bak_type: crate::model::BakType,
10844
10845        /// Optional. The timestamp when the import should stop. This timestamp is in
10846        /// the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
10847        /// `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
10848        /// keyword and applies to Cloud SQL for SQL Server only.
10849        pub stop_at: std::option::Option<wkt::Timestamp>,
10850
10851        /// Optional. The marked transaction where the import should stop. This field
10852        /// is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
10853        /// Server only.
10854        pub stop_at_mark: std::string::String,
10855
10856        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10857    }
10858
10859    impl SqlBakImportOptions {
10860        pub fn new() -> Self {
10861            std::default::Default::default()
10862        }
10863
10864        /// Sets the value of [encryption_options][crate::model::import_context::SqlBakImportOptions::encryption_options].
10865        pub fn set_encryption_options<T>(mut self, v: T) -> Self
10866        where
10867            T: std::convert::Into<
10868                    crate::model::import_context::sql_bak_import_options::EncryptionOptions,
10869                >,
10870        {
10871            self.encryption_options = std::option::Option::Some(v.into());
10872            self
10873        }
10874
10875        /// Sets or clears the value of [encryption_options][crate::model::import_context::SqlBakImportOptions::encryption_options].
10876        pub fn set_or_clear_encryption_options<T>(mut self, v: std::option::Option<T>) -> Self
10877        where
10878            T: std::convert::Into<
10879                    crate::model::import_context::sql_bak_import_options::EncryptionOptions,
10880                >,
10881        {
10882            self.encryption_options = v.map(|x| x.into());
10883            self
10884        }
10885
10886        /// Sets the value of [striped][crate::model::import_context::SqlBakImportOptions::striped].
10887        pub fn set_striped<T>(mut self, v: T) -> Self
10888        where
10889            T: std::convert::Into<wkt::BoolValue>,
10890        {
10891            self.striped = std::option::Option::Some(v.into());
10892            self
10893        }
10894
10895        /// Sets or clears the value of [striped][crate::model::import_context::SqlBakImportOptions::striped].
10896        pub fn set_or_clear_striped<T>(mut self, v: std::option::Option<T>) -> Self
10897        where
10898            T: std::convert::Into<wkt::BoolValue>,
10899        {
10900            self.striped = v.map(|x| x.into());
10901            self
10902        }
10903
10904        /// Sets the value of [no_recovery][crate::model::import_context::SqlBakImportOptions::no_recovery].
10905        pub fn set_no_recovery<T>(mut self, v: T) -> Self
10906        where
10907            T: std::convert::Into<wkt::BoolValue>,
10908        {
10909            self.no_recovery = std::option::Option::Some(v.into());
10910            self
10911        }
10912
10913        /// Sets or clears the value of [no_recovery][crate::model::import_context::SqlBakImportOptions::no_recovery].
10914        pub fn set_or_clear_no_recovery<T>(mut self, v: std::option::Option<T>) -> Self
10915        where
10916            T: std::convert::Into<wkt::BoolValue>,
10917        {
10918            self.no_recovery = v.map(|x| x.into());
10919            self
10920        }
10921
10922        /// Sets the value of [recovery_only][crate::model::import_context::SqlBakImportOptions::recovery_only].
10923        pub fn set_recovery_only<T>(mut self, v: T) -> Self
10924        where
10925            T: std::convert::Into<wkt::BoolValue>,
10926        {
10927            self.recovery_only = std::option::Option::Some(v.into());
10928            self
10929        }
10930
10931        /// Sets or clears the value of [recovery_only][crate::model::import_context::SqlBakImportOptions::recovery_only].
10932        pub fn set_or_clear_recovery_only<T>(mut self, v: std::option::Option<T>) -> Self
10933        where
10934            T: std::convert::Into<wkt::BoolValue>,
10935        {
10936            self.recovery_only = v.map(|x| x.into());
10937            self
10938        }
10939
10940        /// Sets the value of [bak_type][crate::model::import_context::SqlBakImportOptions::bak_type].
10941        pub fn set_bak_type<T: std::convert::Into<crate::model::BakType>>(mut self, v: T) -> Self {
10942            self.bak_type = v.into();
10943            self
10944        }
10945
10946        /// Sets the value of [stop_at][crate::model::import_context::SqlBakImportOptions::stop_at].
10947        pub fn set_stop_at<T>(mut self, v: T) -> Self
10948        where
10949            T: std::convert::Into<wkt::Timestamp>,
10950        {
10951            self.stop_at = std::option::Option::Some(v.into());
10952            self
10953        }
10954
10955        /// Sets or clears the value of [stop_at][crate::model::import_context::SqlBakImportOptions::stop_at].
10956        pub fn set_or_clear_stop_at<T>(mut self, v: std::option::Option<T>) -> Self
10957        where
10958            T: std::convert::Into<wkt::Timestamp>,
10959        {
10960            self.stop_at = v.map(|x| x.into());
10961            self
10962        }
10963
10964        /// Sets the value of [stop_at_mark][crate::model::import_context::SqlBakImportOptions::stop_at_mark].
10965        pub fn set_stop_at_mark<T: std::convert::Into<std::string::String>>(
10966            mut self,
10967            v: T,
10968        ) -> Self {
10969            self.stop_at_mark = v.into();
10970            self
10971        }
10972    }
10973
10974    impl wkt::message::Message for SqlBakImportOptions {
10975        fn typename() -> &'static str {
10976            "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlBakImportOptions"
10977        }
10978    }
10979
10980    /// Defines additional types related to [SqlBakImportOptions].
10981    pub mod sql_bak_import_options {
10982        #[allow(unused_imports)]
10983        use super::*;
10984
10985        #[derive(Clone, Default, PartialEq)]
10986        #[non_exhaustive]
10987        pub struct EncryptionOptions {
10988            /// Path to the Certificate (.cer) in Cloud Storage, in the form
10989            /// `gs://bucketName/fileName`. The instance must have
10990            /// write permissions to the bucket and read access to the file.
10991            pub cert_path: std::string::String,
10992
10993            /// Path to the Certificate Private Key (.pvk)  in Cloud Storage, in the
10994            /// form `gs://bucketName/fileName`. The instance must have
10995            /// write permissions to the bucket and read access to the file.
10996            pub pvk_path: std::string::String,
10997
10998            /// Password that encrypts the private key
10999            pub pvk_password: std::string::String,
11000
11001            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11002        }
11003
11004        impl EncryptionOptions {
11005            pub fn new() -> Self {
11006                std::default::Default::default()
11007            }
11008
11009            /// Sets the value of [cert_path][crate::model::import_context::sql_bak_import_options::EncryptionOptions::cert_path].
11010            pub fn set_cert_path<T: std::convert::Into<std::string::String>>(
11011                mut self,
11012                v: T,
11013            ) -> Self {
11014                self.cert_path = v.into();
11015                self
11016            }
11017
11018            /// Sets the value of [pvk_path][crate::model::import_context::sql_bak_import_options::EncryptionOptions::pvk_path].
11019            pub fn set_pvk_path<T: std::convert::Into<std::string::String>>(
11020                mut self,
11021                v: T,
11022            ) -> Self {
11023                self.pvk_path = v.into();
11024                self
11025            }
11026
11027            /// Sets the value of [pvk_password][crate::model::import_context::sql_bak_import_options::EncryptionOptions::pvk_password].
11028            pub fn set_pvk_password<T: std::convert::Into<std::string::String>>(
11029                mut self,
11030                v: T,
11031            ) -> Self {
11032                self.pvk_password = v.into();
11033                self
11034            }
11035        }
11036
11037        impl wkt::message::Message for EncryptionOptions {
11038            fn typename() -> &'static str {
11039                "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions"
11040            }
11041        }
11042    }
11043}
11044
11045/// IP Management configuration.
11046#[derive(Clone, Default, PartialEq)]
11047#[non_exhaustive]
11048pub struct IpConfiguration {
11049    /// Whether the instance is assigned a public IP address or not.
11050    pub ipv4_enabled: std::option::Option<wkt::BoolValue>,
11051
11052    /// The resource link for the VPC network from which the Cloud SQL instance is
11053    /// accessible for private IP. For example,
11054    /// `/projects/myProject/global/networks/default`. This setting can
11055    /// be updated, but it cannot be removed after it is set.
11056    pub private_network: std::string::String,
11057
11058    /// Use `ssl_mode` instead.
11059    ///
11060    /// Whether SSL/TLS connections over IP are enforced.
11061    /// If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
11062    /// For SSL/TLS connections, the client certificate won't be verified. If
11063    /// set to true, then only allow connections encrypted with SSL/TLS and with
11064    /// valid client certificates. If you want to enforce SSL/TLS without enforcing
11065    /// the requirement for valid client certificates, then use the `ssl_mode` flag
11066    /// instead of the `require_ssl` flag.
11067    pub require_ssl: std::option::Option<wkt::BoolValue>,
11068
11069    /// The list of external networks that are allowed to connect to the instance
11070    /// using the IP. In 'CIDR' notation, also known as 'slash' notation (for
11071    /// example: `157.197.200.0/24`).
11072    pub authorized_networks: std::vec::Vec<crate::model::AclEntry>,
11073
11074    /// The name of the allocated ip range for the private ip Cloud SQL instance.
11075    /// For example: "google-managed-services-default". If set, the instance ip
11076    /// will be created in the allocated range. The range name must comply with
11077    /// [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
11078    /// must be 1-63 characters long and match the regular expression
11079    /// `[a-z]([-a-z0-9]*[a-z0-9])?.`
11080    pub allocated_ip_range: std::string::String,
11081
11082    /// Controls connectivity to private IP instances from Google services,
11083    /// such as BigQuery.
11084    pub enable_private_path_for_google_cloud_services: std::option::Option<wkt::BoolValue>,
11085
11086    /// Specify how SSL/TLS is enforced in database connections. If you must use
11087    /// the `require_ssl` flag for backward compatibility, then only the following
11088    /// value pairs are valid:
11089    ///
11090    /// For PostgreSQL and MySQL:
11091    ///
11092    /// * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
11093    /// * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
11094    /// * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
11095    ///
11096    /// For SQL Server:
11097    ///
11098    /// * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
11099    /// * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
11100    ///
11101    /// The value of `ssl_mode` has priority over the value of `require_ssl`.
11102    ///
11103    /// For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
11104    /// `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
11105    /// connections, while `require_ssl=false` means accept both non-SSL
11106    /// and SSL connections. In this case, MySQL and PostgreSQL databases respect
11107    /// `ssl_mode` and accepts only SSL connections.
11108    pub ssl_mode: crate::model::ip_configuration::SslMode,
11109
11110    /// PSC settings for this instance.
11111    pub psc_config: std::option::Option<crate::model::PscConfig>,
11112
11113    /// Specify what type of CA is used for the server certificate.
11114    pub server_ca_mode: std::option::Option<crate::model::ip_configuration::CaMode>,
11115
11116    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11117}
11118
11119impl IpConfiguration {
11120    pub fn new() -> Self {
11121        std::default::Default::default()
11122    }
11123
11124    /// Sets the value of [ipv4_enabled][crate::model::IpConfiguration::ipv4_enabled].
11125    pub fn set_ipv4_enabled<T>(mut self, v: T) -> Self
11126    where
11127        T: std::convert::Into<wkt::BoolValue>,
11128    {
11129        self.ipv4_enabled = std::option::Option::Some(v.into());
11130        self
11131    }
11132
11133    /// Sets or clears the value of [ipv4_enabled][crate::model::IpConfiguration::ipv4_enabled].
11134    pub fn set_or_clear_ipv4_enabled<T>(mut self, v: std::option::Option<T>) -> Self
11135    where
11136        T: std::convert::Into<wkt::BoolValue>,
11137    {
11138        self.ipv4_enabled = v.map(|x| x.into());
11139        self
11140    }
11141
11142    /// Sets the value of [private_network][crate::model::IpConfiguration::private_network].
11143    pub fn set_private_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11144        self.private_network = v.into();
11145        self
11146    }
11147
11148    /// Sets the value of [require_ssl][crate::model::IpConfiguration::require_ssl].
11149    pub fn set_require_ssl<T>(mut self, v: T) -> Self
11150    where
11151        T: std::convert::Into<wkt::BoolValue>,
11152    {
11153        self.require_ssl = std::option::Option::Some(v.into());
11154        self
11155    }
11156
11157    /// Sets or clears the value of [require_ssl][crate::model::IpConfiguration::require_ssl].
11158    pub fn set_or_clear_require_ssl<T>(mut self, v: std::option::Option<T>) -> Self
11159    where
11160        T: std::convert::Into<wkt::BoolValue>,
11161    {
11162        self.require_ssl = v.map(|x| x.into());
11163        self
11164    }
11165
11166    /// Sets the value of [authorized_networks][crate::model::IpConfiguration::authorized_networks].
11167    pub fn set_authorized_networks<T, V>(mut self, v: T) -> Self
11168    where
11169        T: std::iter::IntoIterator<Item = V>,
11170        V: std::convert::Into<crate::model::AclEntry>,
11171    {
11172        use std::iter::Iterator;
11173        self.authorized_networks = v.into_iter().map(|i| i.into()).collect();
11174        self
11175    }
11176
11177    /// Sets the value of [allocated_ip_range][crate::model::IpConfiguration::allocated_ip_range].
11178    pub fn set_allocated_ip_range<T: std::convert::Into<std::string::String>>(
11179        mut self,
11180        v: T,
11181    ) -> Self {
11182        self.allocated_ip_range = v.into();
11183        self
11184    }
11185
11186    /// Sets the value of [enable_private_path_for_google_cloud_services][crate::model::IpConfiguration::enable_private_path_for_google_cloud_services].
11187    pub fn set_enable_private_path_for_google_cloud_services<T>(mut self, v: T) -> Self
11188    where
11189        T: std::convert::Into<wkt::BoolValue>,
11190    {
11191        self.enable_private_path_for_google_cloud_services = std::option::Option::Some(v.into());
11192        self
11193    }
11194
11195    /// Sets or clears the value of [enable_private_path_for_google_cloud_services][crate::model::IpConfiguration::enable_private_path_for_google_cloud_services].
11196    pub fn set_or_clear_enable_private_path_for_google_cloud_services<T>(
11197        mut self,
11198        v: std::option::Option<T>,
11199    ) -> Self
11200    where
11201        T: std::convert::Into<wkt::BoolValue>,
11202    {
11203        self.enable_private_path_for_google_cloud_services = v.map(|x| x.into());
11204        self
11205    }
11206
11207    /// Sets the value of [ssl_mode][crate::model::IpConfiguration::ssl_mode].
11208    pub fn set_ssl_mode<T: std::convert::Into<crate::model::ip_configuration::SslMode>>(
11209        mut self,
11210        v: T,
11211    ) -> Self {
11212        self.ssl_mode = v.into();
11213        self
11214    }
11215
11216    /// Sets the value of [psc_config][crate::model::IpConfiguration::psc_config].
11217    pub fn set_psc_config<T>(mut self, v: T) -> Self
11218    where
11219        T: std::convert::Into<crate::model::PscConfig>,
11220    {
11221        self.psc_config = std::option::Option::Some(v.into());
11222        self
11223    }
11224
11225    /// Sets or clears the value of [psc_config][crate::model::IpConfiguration::psc_config].
11226    pub fn set_or_clear_psc_config<T>(mut self, v: std::option::Option<T>) -> Self
11227    where
11228        T: std::convert::Into<crate::model::PscConfig>,
11229    {
11230        self.psc_config = v.map(|x| x.into());
11231        self
11232    }
11233
11234    /// Sets the value of [server_ca_mode][crate::model::IpConfiguration::server_ca_mode].
11235    pub fn set_server_ca_mode<T>(mut self, v: T) -> Self
11236    where
11237        T: std::convert::Into<crate::model::ip_configuration::CaMode>,
11238    {
11239        self.server_ca_mode = std::option::Option::Some(v.into());
11240        self
11241    }
11242
11243    /// Sets or clears the value of [server_ca_mode][crate::model::IpConfiguration::server_ca_mode].
11244    pub fn set_or_clear_server_ca_mode<T>(mut self, v: std::option::Option<T>) -> Self
11245    where
11246        T: std::convert::Into<crate::model::ip_configuration::CaMode>,
11247    {
11248        self.server_ca_mode = v.map(|x| x.into());
11249        self
11250    }
11251}
11252
11253impl wkt::message::Message for IpConfiguration {
11254    fn typename() -> &'static str {
11255        "type.googleapis.com/google.cloud.sql.v1.IpConfiguration"
11256    }
11257}
11258
11259/// Defines additional types related to [IpConfiguration].
11260pub mod ip_configuration {
11261    #[allow(unused_imports)]
11262    use super::*;
11263
11264    /// The SSL options for database connections.
11265    ///
11266    /// # Working with unknown values
11267    ///
11268    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11269    /// additional enum variants at any time. Adding new variants is not considered
11270    /// a breaking change. Applications should write their code in anticipation of:
11271    ///
11272    /// - New values appearing in future releases of the client library, **and**
11273    /// - New values received dynamically, without application changes.
11274    ///
11275    /// Please consult the [Working with enums] section in the user guide for some
11276    /// guidelines.
11277    ///
11278    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11279    #[derive(Clone, Debug, PartialEq)]
11280    #[non_exhaustive]
11281    pub enum SslMode {
11282        /// The SSL mode is unknown.
11283        Unspecified,
11284        /// Allow non-SSL/non-TLS and SSL/TLS connections.
11285        /// For SSL connections to MySQL and PostgreSQL, the client certificate
11286        /// isn't verified.
11287        ///
11288        /// When this value is used, the legacy `require_ssl` flag must be false or
11289        /// cleared to avoid a conflict between the values of the two flags.
11290        AllowUnencryptedAndEncrypted,
11291        /// Only allow connections encrypted with SSL/TLS.
11292        /// For SSL connections to MySQL and PostgreSQL, the client certificate
11293        /// isn't verified.
11294        ///
11295        /// When this value is used, the legacy `require_ssl` flag must be false or
11296        /// cleared to avoid a conflict between the values of the two flags.
11297        EncryptedOnly,
11298        /// Only allow connections encrypted with SSL/TLS and with valid
11299        /// client certificates.
11300        ///
11301        /// When this value is used, the legacy `require_ssl` flag must be true or
11302        /// cleared to avoid the conflict between values of two flags.
11303        /// PostgreSQL clients or users that connect using IAM database
11304        /// authentication must use either the
11305        /// [Cloud SQL Auth
11306        /// Proxy](https://cloud.google.com/sql/docs/postgres/connect-auth-proxy) or
11307        /// [Cloud SQL
11308        /// Connectors](https://cloud.google.com/sql/docs/postgres/connect-connectors)
11309        /// to enforce client identity verification.
11310        ///
11311        /// Only applicable to MySQL and PostgreSQL. Not applicable to SQL Server.
11312        TrustedClientCertificateRequired,
11313        /// If set, the enum was initialized with an unknown value.
11314        ///
11315        /// Applications can examine the value using [SslMode::value] or
11316        /// [SslMode::name].
11317        UnknownValue(ssl_mode::UnknownValue),
11318    }
11319
11320    #[doc(hidden)]
11321    pub mod ssl_mode {
11322        #[allow(unused_imports)]
11323        use super::*;
11324        #[derive(Clone, Debug, PartialEq)]
11325        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11326    }
11327
11328    impl SslMode {
11329        /// Gets the enum value.
11330        ///
11331        /// Returns `None` if the enum contains an unknown value deserialized from
11332        /// the string representation of enums.
11333        pub fn value(&self) -> std::option::Option<i32> {
11334            match self {
11335                Self::Unspecified => std::option::Option::Some(0),
11336                Self::AllowUnencryptedAndEncrypted => std::option::Option::Some(1),
11337                Self::EncryptedOnly => std::option::Option::Some(2),
11338                Self::TrustedClientCertificateRequired => std::option::Option::Some(3),
11339                Self::UnknownValue(u) => u.0.value(),
11340            }
11341        }
11342
11343        /// Gets the enum value as a string.
11344        ///
11345        /// Returns `None` if the enum contains an unknown value deserialized from
11346        /// the integer representation of enums.
11347        pub fn name(&self) -> std::option::Option<&str> {
11348            match self {
11349                Self::Unspecified => std::option::Option::Some("SSL_MODE_UNSPECIFIED"),
11350                Self::AllowUnencryptedAndEncrypted => {
11351                    std::option::Option::Some("ALLOW_UNENCRYPTED_AND_ENCRYPTED")
11352                }
11353                Self::EncryptedOnly => std::option::Option::Some("ENCRYPTED_ONLY"),
11354                Self::TrustedClientCertificateRequired => {
11355                    std::option::Option::Some("TRUSTED_CLIENT_CERTIFICATE_REQUIRED")
11356                }
11357                Self::UnknownValue(u) => u.0.name(),
11358            }
11359        }
11360    }
11361
11362    impl std::default::Default for SslMode {
11363        fn default() -> Self {
11364            use std::convert::From;
11365            Self::from(0)
11366        }
11367    }
11368
11369    impl std::fmt::Display for SslMode {
11370        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11371            wkt::internal::display_enum(f, self.name(), self.value())
11372        }
11373    }
11374
11375    impl std::convert::From<i32> for SslMode {
11376        fn from(value: i32) -> Self {
11377            match value {
11378                0 => Self::Unspecified,
11379                1 => Self::AllowUnencryptedAndEncrypted,
11380                2 => Self::EncryptedOnly,
11381                3 => Self::TrustedClientCertificateRequired,
11382                _ => Self::UnknownValue(ssl_mode::UnknownValue(
11383                    wkt::internal::UnknownEnumValue::Integer(value),
11384                )),
11385            }
11386        }
11387    }
11388
11389    impl std::convert::From<&str> for SslMode {
11390        fn from(value: &str) -> Self {
11391            use std::string::ToString;
11392            match value {
11393                "SSL_MODE_UNSPECIFIED" => Self::Unspecified,
11394                "ALLOW_UNENCRYPTED_AND_ENCRYPTED" => Self::AllowUnencryptedAndEncrypted,
11395                "ENCRYPTED_ONLY" => Self::EncryptedOnly,
11396                "TRUSTED_CLIENT_CERTIFICATE_REQUIRED" => Self::TrustedClientCertificateRequired,
11397                _ => Self::UnknownValue(ssl_mode::UnknownValue(
11398                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11399                )),
11400            }
11401        }
11402    }
11403
11404    impl serde::ser::Serialize for SslMode {
11405        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11406        where
11407            S: serde::Serializer,
11408        {
11409            match self {
11410                Self::Unspecified => serializer.serialize_i32(0),
11411                Self::AllowUnencryptedAndEncrypted => serializer.serialize_i32(1),
11412                Self::EncryptedOnly => serializer.serialize_i32(2),
11413                Self::TrustedClientCertificateRequired => serializer.serialize_i32(3),
11414                Self::UnknownValue(u) => u.0.serialize(serializer),
11415            }
11416        }
11417    }
11418
11419    impl<'de> serde::de::Deserialize<'de> for SslMode {
11420        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11421        where
11422            D: serde::Deserializer<'de>,
11423        {
11424            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslMode>::new(
11425                ".google.cloud.sql.v1.IpConfiguration.SslMode",
11426            ))
11427        }
11428    }
11429
11430    /// Various Certificate Authority (CA) modes for certificate signing.
11431    ///
11432    /// # Working with unknown values
11433    ///
11434    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11435    /// additional enum variants at any time. Adding new variants is not considered
11436    /// a breaking change. Applications should write their code in anticipation of:
11437    ///
11438    /// - New values appearing in future releases of the client library, **and**
11439    /// - New values received dynamically, without application changes.
11440    ///
11441    /// Please consult the [Working with enums] section in the user guide for some
11442    /// guidelines.
11443    ///
11444    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11445    #[derive(Clone, Debug, PartialEq)]
11446    #[non_exhaustive]
11447    pub enum CaMode {
11448        /// CA mode is unknown.
11449        Unspecified,
11450        /// Google-managed self-signed internal CA.
11451        GoogleManagedInternalCa,
11452        /// Google-managed regional CA part of root CA hierarchy hosted on Google
11453        /// Cloud's Certificate Authority Service (CAS).
11454        GoogleManagedCasCa,
11455        /// If set, the enum was initialized with an unknown value.
11456        ///
11457        /// Applications can examine the value using [CaMode::value] or
11458        /// [CaMode::name].
11459        UnknownValue(ca_mode::UnknownValue),
11460    }
11461
11462    #[doc(hidden)]
11463    pub mod ca_mode {
11464        #[allow(unused_imports)]
11465        use super::*;
11466        #[derive(Clone, Debug, PartialEq)]
11467        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11468    }
11469
11470    impl CaMode {
11471        /// Gets the enum value.
11472        ///
11473        /// Returns `None` if the enum contains an unknown value deserialized from
11474        /// the string representation of enums.
11475        pub fn value(&self) -> std::option::Option<i32> {
11476            match self {
11477                Self::Unspecified => std::option::Option::Some(0),
11478                Self::GoogleManagedInternalCa => std::option::Option::Some(1),
11479                Self::GoogleManagedCasCa => std::option::Option::Some(2),
11480                Self::UnknownValue(u) => u.0.value(),
11481            }
11482        }
11483
11484        /// Gets the enum value as a string.
11485        ///
11486        /// Returns `None` if the enum contains an unknown value deserialized from
11487        /// the integer representation of enums.
11488        pub fn name(&self) -> std::option::Option<&str> {
11489            match self {
11490                Self::Unspecified => std::option::Option::Some("CA_MODE_UNSPECIFIED"),
11491                Self::GoogleManagedInternalCa => {
11492                    std::option::Option::Some("GOOGLE_MANAGED_INTERNAL_CA")
11493                }
11494                Self::GoogleManagedCasCa => std::option::Option::Some("GOOGLE_MANAGED_CAS_CA"),
11495                Self::UnknownValue(u) => u.0.name(),
11496            }
11497        }
11498    }
11499
11500    impl std::default::Default for CaMode {
11501        fn default() -> Self {
11502            use std::convert::From;
11503            Self::from(0)
11504        }
11505    }
11506
11507    impl std::fmt::Display for CaMode {
11508        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11509            wkt::internal::display_enum(f, self.name(), self.value())
11510        }
11511    }
11512
11513    impl std::convert::From<i32> for CaMode {
11514        fn from(value: i32) -> Self {
11515            match value {
11516                0 => Self::Unspecified,
11517                1 => Self::GoogleManagedInternalCa,
11518                2 => Self::GoogleManagedCasCa,
11519                _ => Self::UnknownValue(ca_mode::UnknownValue(
11520                    wkt::internal::UnknownEnumValue::Integer(value),
11521                )),
11522            }
11523        }
11524    }
11525
11526    impl std::convert::From<&str> for CaMode {
11527        fn from(value: &str) -> Self {
11528            use std::string::ToString;
11529            match value {
11530                "CA_MODE_UNSPECIFIED" => Self::Unspecified,
11531                "GOOGLE_MANAGED_INTERNAL_CA" => Self::GoogleManagedInternalCa,
11532                "GOOGLE_MANAGED_CAS_CA" => Self::GoogleManagedCasCa,
11533                _ => Self::UnknownValue(ca_mode::UnknownValue(
11534                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11535                )),
11536            }
11537        }
11538    }
11539
11540    impl serde::ser::Serialize for CaMode {
11541        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11542        where
11543            S: serde::Serializer,
11544        {
11545            match self {
11546                Self::Unspecified => serializer.serialize_i32(0),
11547                Self::GoogleManagedInternalCa => serializer.serialize_i32(1),
11548                Self::GoogleManagedCasCa => serializer.serialize_i32(2),
11549                Self::UnknownValue(u) => u.0.serialize(serializer),
11550            }
11551        }
11552    }
11553
11554    impl<'de> serde::de::Deserialize<'de> for CaMode {
11555        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11556        where
11557            D: serde::Deserializer<'de>,
11558        {
11559            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CaMode>::new(
11560                ".google.cloud.sql.v1.IpConfiguration.CaMode",
11561            ))
11562        }
11563    }
11564}
11565
11566/// PSC settings for a Cloud SQL instance.
11567#[derive(Clone, Default, PartialEq)]
11568#[non_exhaustive]
11569pub struct PscConfig {
11570    /// Whether PSC connectivity is enabled for this instance.
11571    pub psc_enabled: std::option::Option<bool>,
11572
11573    /// Optional. The list of consumer projects that are allow-listed for PSC
11574    /// connections to this instance. This instance can be connected to with PSC
11575    /// from any network in these projects.
11576    ///
11577    /// Each consumer project in this list may be represented by a project number
11578    /// (numeric) or by a project id (alphanumeric).
11579    pub allowed_consumer_projects: std::vec::Vec<std::string::String>,
11580
11581    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11582}
11583
11584impl PscConfig {
11585    pub fn new() -> Self {
11586        std::default::Default::default()
11587    }
11588
11589    /// Sets the value of [psc_enabled][crate::model::PscConfig::psc_enabled].
11590    pub fn set_psc_enabled<T>(mut self, v: T) -> Self
11591    where
11592        T: std::convert::Into<bool>,
11593    {
11594        self.psc_enabled = std::option::Option::Some(v.into());
11595        self
11596    }
11597
11598    /// Sets or clears the value of [psc_enabled][crate::model::PscConfig::psc_enabled].
11599    pub fn set_or_clear_psc_enabled<T>(mut self, v: std::option::Option<T>) -> Self
11600    where
11601        T: std::convert::Into<bool>,
11602    {
11603        self.psc_enabled = v.map(|x| x.into());
11604        self
11605    }
11606
11607    /// Sets the value of [allowed_consumer_projects][crate::model::PscConfig::allowed_consumer_projects].
11608    pub fn set_allowed_consumer_projects<T, V>(mut self, v: T) -> Self
11609    where
11610        T: std::iter::IntoIterator<Item = V>,
11611        V: std::convert::Into<std::string::String>,
11612    {
11613        use std::iter::Iterator;
11614        self.allowed_consumer_projects = v.into_iter().map(|i| i.into()).collect();
11615        self
11616    }
11617}
11618
11619impl wkt::message::Message for PscConfig {
11620    fn typename() -> &'static str {
11621        "type.googleapis.com/google.cloud.sql.v1.PscConfig"
11622    }
11623}
11624
11625/// Preferred location. This specifies where a Cloud SQL instance is located.
11626/// Note that if the preferred location is not available, the instance will be
11627/// located as close as possible within the region. Only one location may be
11628/// specified.
11629#[derive(Clone, Default, PartialEq)]
11630#[non_exhaustive]
11631pub struct LocationPreference {
11632    /// The App Engine application to follow, it must be in the same region as the
11633    /// Cloud SQL instance. WARNING: Changing this might restart the instance.
11634    #[deprecated]
11635    pub follow_gae_application: std::string::String,
11636
11637    /// The preferred Compute Engine zone (for example: us-central1-a,
11638    /// us-central1-b, etc.). WARNING: Changing this might restart the instance.
11639    pub zone: std::string::String,
11640
11641    /// The preferred Compute Engine zone for the secondary/failover
11642    /// (for example: us-central1-a, us-central1-b, etc.).
11643    /// To disable this field, set it to 'no_secondary_zone'.
11644    pub secondary_zone: std::string::String,
11645
11646    /// This is always `sql#locationPreference`.
11647    pub kind: std::string::String,
11648
11649    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11650}
11651
11652impl LocationPreference {
11653    pub fn new() -> Self {
11654        std::default::Default::default()
11655    }
11656
11657    /// Sets the value of [follow_gae_application][crate::model::LocationPreference::follow_gae_application].
11658    #[deprecated]
11659    pub fn set_follow_gae_application<T: std::convert::Into<std::string::String>>(
11660        mut self,
11661        v: T,
11662    ) -> Self {
11663        self.follow_gae_application = v.into();
11664        self
11665    }
11666
11667    /// Sets the value of [zone][crate::model::LocationPreference::zone].
11668    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11669        self.zone = v.into();
11670        self
11671    }
11672
11673    /// Sets the value of [secondary_zone][crate::model::LocationPreference::secondary_zone].
11674    pub fn set_secondary_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11675        self.secondary_zone = v.into();
11676        self
11677    }
11678
11679    /// Sets the value of [kind][crate::model::LocationPreference::kind].
11680    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11681        self.kind = v.into();
11682        self
11683    }
11684}
11685
11686impl wkt::message::Message for LocationPreference {
11687    fn typename() -> &'static str {
11688        "type.googleapis.com/google.cloud.sql.v1.LocationPreference"
11689    }
11690}
11691
11692/// Maintenance window. This specifies when a Cloud SQL instance is
11693/// restarted for system maintenance purposes.
11694#[derive(Clone, Default, PartialEq)]
11695#[non_exhaustive]
11696pub struct MaintenanceWindow {
11697    /// Hour of day - 0 to 23. Specify in the UTC time zone.
11698    pub hour: std::option::Option<wkt::Int32Value>,
11699
11700    /// Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
11701    /// `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
11702    /// Returned in output as an integer, 1 to 7, where `1` equals Monday.
11703    pub day: std::option::Option<wkt::Int32Value>,
11704
11705    /// Maintenance timing settings: `canary`, `stable`, or `week5`.
11706    /// For more information, see [About maintenance on Cloud SQL
11707    /// instances](https://cloud.google.com/sql/docs/mysql/maintenance).
11708    pub update_track: crate::model::SqlUpdateTrack,
11709
11710    /// This is always `sql#maintenanceWindow`.
11711    pub kind: std::string::String,
11712
11713    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11714}
11715
11716impl MaintenanceWindow {
11717    pub fn new() -> Self {
11718        std::default::Default::default()
11719    }
11720
11721    /// Sets the value of [hour][crate::model::MaintenanceWindow::hour].
11722    pub fn set_hour<T>(mut self, v: T) -> Self
11723    where
11724        T: std::convert::Into<wkt::Int32Value>,
11725    {
11726        self.hour = std::option::Option::Some(v.into());
11727        self
11728    }
11729
11730    /// Sets or clears the value of [hour][crate::model::MaintenanceWindow::hour].
11731    pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
11732    where
11733        T: std::convert::Into<wkt::Int32Value>,
11734    {
11735        self.hour = v.map(|x| x.into());
11736        self
11737    }
11738
11739    /// Sets the value of [day][crate::model::MaintenanceWindow::day].
11740    pub fn set_day<T>(mut self, v: T) -> Self
11741    where
11742        T: std::convert::Into<wkt::Int32Value>,
11743    {
11744        self.day = std::option::Option::Some(v.into());
11745        self
11746    }
11747
11748    /// Sets or clears the value of [day][crate::model::MaintenanceWindow::day].
11749    pub fn set_or_clear_day<T>(mut self, v: std::option::Option<T>) -> Self
11750    where
11751        T: std::convert::Into<wkt::Int32Value>,
11752    {
11753        self.day = v.map(|x| x.into());
11754        self
11755    }
11756
11757    /// Sets the value of [update_track][crate::model::MaintenanceWindow::update_track].
11758    pub fn set_update_track<T: std::convert::Into<crate::model::SqlUpdateTrack>>(
11759        mut self,
11760        v: T,
11761    ) -> Self {
11762        self.update_track = v.into();
11763        self
11764    }
11765
11766    /// Sets the value of [kind][crate::model::MaintenanceWindow::kind].
11767    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11768        self.kind = v.into();
11769        self
11770    }
11771}
11772
11773impl wkt::message::Message for MaintenanceWindow {
11774    fn typename() -> &'static str {
11775        "type.googleapis.com/google.cloud.sql.v1.MaintenanceWindow"
11776    }
11777}
11778
11779/// Deny maintenance Periods. This specifies a date range during when all CSA
11780/// rollout will be denied.
11781#[derive(Clone, Default, PartialEq)]
11782#[non_exhaustive]
11783pub struct DenyMaintenancePeriod {
11784    /// "deny maintenance period" start date. If the year of the start date is
11785    /// empty, the year of the end date also must be empty. In this case, it means
11786    /// the deny maintenance period recurs every year. The date is in format
11787    /// yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
11788    pub start_date: std::string::String,
11789
11790    /// "deny maintenance period" end date. If the year of the end date is empty,
11791    /// the year of the start date also must be empty. In this case, it means the
11792    /// no maintenance interval recurs every year. The date is in format yyyy-mm-dd
11793    /// i.e., 2020-11-01, or mm-dd, i.e., 11-01
11794    pub end_date: std::string::String,
11795
11796    /// Time in UTC when the "deny maintenance period" starts on start_date and
11797    /// ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
11798    pub time: std::string::String,
11799
11800    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11801}
11802
11803impl DenyMaintenancePeriod {
11804    pub fn new() -> Self {
11805        std::default::Default::default()
11806    }
11807
11808    /// Sets the value of [start_date][crate::model::DenyMaintenancePeriod::start_date].
11809    pub fn set_start_date<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11810        self.start_date = v.into();
11811        self
11812    }
11813
11814    /// Sets the value of [end_date][crate::model::DenyMaintenancePeriod::end_date].
11815    pub fn set_end_date<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11816        self.end_date = v.into();
11817        self
11818    }
11819
11820    /// Sets the value of [time][crate::model::DenyMaintenancePeriod::time].
11821    pub fn set_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11822        self.time = v.into();
11823        self
11824    }
11825}
11826
11827impl wkt::message::Message for DenyMaintenancePeriod {
11828    fn typename() -> &'static str {
11829        "type.googleapis.com/google.cloud.sql.v1.DenyMaintenancePeriod"
11830    }
11831}
11832
11833/// Insights configuration. This specifies when Cloud SQL Insights feature is
11834/// enabled and optional configuration.
11835#[derive(Clone, Default, PartialEq)]
11836#[non_exhaustive]
11837pub struct InsightsConfig {
11838    /// Whether Query Insights feature is enabled.
11839    pub query_insights_enabled: bool,
11840
11841    /// Whether Query Insights will record client address when enabled.
11842    pub record_client_address: bool,
11843
11844    /// Whether Query Insights will record application tags from query when
11845    /// enabled.
11846    pub record_application_tags: bool,
11847
11848    /// Maximum query length stored in bytes. Default value: 1024 bytes.
11849    /// Range: 256-4500 bytes. Query length more than this field value will be
11850    /// truncated to this value. When unset, query length will be the default
11851    /// value. Changing query length will restart the database.
11852    pub query_string_length: std::option::Option<wkt::Int32Value>,
11853
11854    /// Number of query execution plans captured by Insights per minute
11855    /// for all queries combined. Default is 5.
11856    pub query_plans_per_minute: std::option::Option<wkt::Int32Value>,
11857
11858    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11859}
11860
11861impl InsightsConfig {
11862    pub fn new() -> Self {
11863        std::default::Default::default()
11864    }
11865
11866    /// Sets the value of [query_insights_enabled][crate::model::InsightsConfig::query_insights_enabled].
11867    pub fn set_query_insights_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11868        self.query_insights_enabled = v.into();
11869        self
11870    }
11871
11872    /// Sets the value of [record_client_address][crate::model::InsightsConfig::record_client_address].
11873    pub fn set_record_client_address<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11874        self.record_client_address = v.into();
11875        self
11876    }
11877
11878    /// Sets the value of [record_application_tags][crate::model::InsightsConfig::record_application_tags].
11879    pub fn set_record_application_tags<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11880        self.record_application_tags = v.into();
11881        self
11882    }
11883
11884    /// Sets the value of [query_string_length][crate::model::InsightsConfig::query_string_length].
11885    pub fn set_query_string_length<T>(mut self, v: T) -> Self
11886    where
11887        T: std::convert::Into<wkt::Int32Value>,
11888    {
11889        self.query_string_length = std::option::Option::Some(v.into());
11890        self
11891    }
11892
11893    /// Sets or clears the value of [query_string_length][crate::model::InsightsConfig::query_string_length].
11894    pub fn set_or_clear_query_string_length<T>(mut self, v: std::option::Option<T>) -> Self
11895    where
11896        T: std::convert::Into<wkt::Int32Value>,
11897    {
11898        self.query_string_length = v.map(|x| x.into());
11899        self
11900    }
11901
11902    /// Sets the value of [query_plans_per_minute][crate::model::InsightsConfig::query_plans_per_minute].
11903    pub fn set_query_plans_per_minute<T>(mut self, v: T) -> Self
11904    where
11905        T: std::convert::Into<wkt::Int32Value>,
11906    {
11907        self.query_plans_per_minute = std::option::Option::Some(v.into());
11908        self
11909    }
11910
11911    /// Sets or clears the value of [query_plans_per_minute][crate::model::InsightsConfig::query_plans_per_minute].
11912    pub fn set_or_clear_query_plans_per_minute<T>(mut self, v: std::option::Option<T>) -> Self
11913    where
11914        T: std::convert::Into<wkt::Int32Value>,
11915    {
11916        self.query_plans_per_minute = v.map(|x| x.into());
11917        self
11918    }
11919}
11920
11921impl wkt::message::Message for InsightsConfig {
11922    fn typename() -> &'static str {
11923        "type.googleapis.com/google.cloud.sql.v1.InsightsConfig"
11924    }
11925}
11926
11927/// Read-replica configuration specific to MySQL databases.
11928#[derive(Clone, Default, PartialEq)]
11929#[non_exhaustive]
11930pub struct MySqlReplicaConfiguration {
11931    /// Path to a SQL dump file in Google Cloud Storage from which the replica
11932    /// instance is to be created. The URI is in the form gs://bucketName/fileName.
11933    /// Compressed gzip files (.gz) are also supported.
11934    /// Dumps have the binlog co-ordinates from which replication
11935    /// begins. This can be accomplished by setting --master-data to 1 when using
11936    /// mysqldump.
11937    pub dump_file_path: std::string::String,
11938
11939    /// The username for the replication connection.
11940    pub username: std::string::String,
11941
11942    /// The password for the replication connection.
11943    pub password: std::string::String,
11944
11945    /// Seconds to wait between connect retries. MySQL's default is 60 seconds.
11946    pub connect_retry_interval: std::option::Option<wkt::Int32Value>,
11947
11948    /// Interval in milliseconds between replication heartbeats.
11949    pub master_heartbeat_period: std::option::Option<wkt::Int64Value>,
11950
11951    /// PEM representation of the trusted CA's x509 certificate.
11952    pub ca_certificate: std::string::String,
11953
11954    /// PEM representation of the replica's x509 certificate.
11955    pub client_certificate: std::string::String,
11956
11957    /// PEM representation of the replica's private key. The corresponsing public
11958    /// key is encoded in the client's certificate.
11959    pub client_key: std::string::String,
11960
11961    /// A list of permissible ciphers to use for SSL encryption.
11962    pub ssl_cipher: std::string::String,
11963
11964    /// Whether or not to check the primary instance's Common Name value in the
11965    /// certificate that it sends during the SSL handshake.
11966    pub verify_server_certificate: std::option::Option<wkt::BoolValue>,
11967
11968    /// This is always `sql#mysqlReplicaConfiguration`.
11969    pub kind: std::string::String,
11970
11971    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11972}
11973
11974impl MySqlReplicaConfiguration {
11975    pub fn new() -> Self {
11976        std::default::Default::default()
11977    }
11978
11979    /// Sets the value of [dump_file_path][crate::model::MySqlReplicaConfiguration::dump_file_path].
11980    pub fn set_dump_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11981        self.dump_file_path = v.into();
11982        self
11983    }
11984
11985    /// Sets the value of [username][crate::model::MySqlReplicaConfiguration::username].
11986    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11987        self.username = v.into();
11988        self
11989    }
11990
11991    /// Sets the value of [password][crate::model::MySqlReplicaConfiguration::password].
11992    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11993        self.password = v.into();
11994        self
11995    }
11996
11997    /// Sets the value of [connect_retry_interval][crate::model::MySqlReplicaConfiguration::connect_retry_interval].
11998    pub fn set_connect_retry_interval<T>(mut self, v: T) -> Self
11999    where
12000        T: std::convert::Into<wkt::Int32Value>,
12001    {
12002        self.connect_retry_interval = std::option::Option::Some(v.into());
12003        self
12004    }
12005
12006    /// Sets or clears the value of [connect_retry_interval][crate::model::MySqlReplicaConfiguration::connect_retry_interval].
12007    pub fn set_or_clear_connect_retry_interval<T>(mut self, v: std::option::Option<T>) -> Self
12008    where
12009        T: std::convert::Into<wkt::Int32Value>,
12010    {
12011        self.connect_retry_interval = v.map(|x| x.into());
12012        self
12013    }
12014
12015    /// Sets the value of [master_heartbeat_period][crate::model::MySqlReplicaConfiguration::master_heartbeat_period].
12016    pub fn set_master_heartbeat_period<T>(mut self, v: T) -> Self
12017    where
12018        T: std::convert::Into<wkt::Int64Value>,
12019    {
12020        self.master_heartbeat_period = std::option::Option::Some(v.into());
12021        self
12022    }
12023
12024    /// Sets or clears the value of [master_heartbeat_period][crate::model::MySqlReplicaConfiguration::master_heartbeat_period].
12025    pub fn set_or_clear_master_heartbeat_period<T>(mut self, v: std::option::Option<T>) -> Self
12026    where
12027        T: std::convert::Into<wkt::Int64Value>,
12028    {
12029        self.master_heartbeat_period = v.map(|x| x.into());
12030        self
12031    }
12032
12033    /// Sets the value of [ca_certificate][crate::model::MySqlReplicaConfiguration::ca_certificate].
12034    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12035        self.ca_certificate = v.into();
12036        self
12037    }
12038
12039    /// Sets the value of [client_certificate][crate::model::MySqlReplicaConfiguration::client_certificate].
12040    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
12041        mut self,
12042        v: T,
12043    ) -> Self {
12044        self.client_certificate = v.into();
12045        self
12046    }
12047
12048    /// Sets the value of [client_key][crate::model::MySqlReplicaConfiguration::client_key].
12049    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12050        self.client_key = v.into();
12051        self
12052    }
12053
12054    /// Sets the value of [ssl_cipher][crate::model::MySqlReplicaConfiguration::ssl_cipher].
12055    pub fn set_ssl_cipher<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12056        self.ssl_cipher = v.into();
12057        self
12058    }
12059
12060    /// Sets the value of [verify_server_certificate][crate::model::MySqlReplicaConfiguration::verify_server_certificate].
12061    pub fn set_verify_server_certificate<T>(mut self, v: T) -> Self
12062    where
12063        T: std::convert::Into<wkt::BoolValue>,
12064    {
12065        self.verify_server_certificate = std::option::Option::Some(v.into());
12066        self
12067    }
12068
12069    /// Sets or clears the value of [verify_server_certificate][crate::model::MySqlReplicaConfiguration::verify_server_certificate].
12070    pub fn set_or_clear_verify_server_certificate<T>(mut self, v: std::option::Option<T>) -> Self
12071    where
12072        T: std::convert::Into<wkt::BoolValue>,
12073    {
12074        self.verify_server_certificate = v.map(|x| x.into());
12075        self
12076    }
12077
12078    /// Sets the value of [kind][crate::model::MySqlReplicaConfiguration::kind].
12079    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12080        self.kind = v.into();
12081        self
12082    }
12083}
12084
12085impl wkt::message::Message for MySqlReplicaConfiguration {
12086    fn typename() -> &'static str {
12087        "type.googleapis.com/google.cloud.sql.v1.MySqlReplicaConfiguration"
12088    }
12089}
12090
12091/// Disk encryption configuration for an instance.
12092#[derive(Clone, Default, PartialEq)]
12093#[non_exhaustive]
12094pub struct DiskEncryptionConfiguration {
12095    /// Resource name of KMS key for disk encryption
12096    pub kms_key_name: std::string::String,
12097
12098    /// This is always `sql#diskEncryptionConfiguration`.
12099    pub kind: std::string::String,
12100
12101    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12102}
12103
12104impl DiskEncryptionConfiguration {
12105    pub fn new() -> Self {
12106        std::default::Default::default()
12107    }
12108
12109    /// Sets the value of [kms_key_name][crate::model::DiskEncryptionConfiguration::kms_key_name].
12110    pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12111        self.kms_key_name = v.into();
12112        self
12113    }
12114
12115    /// Sets the value of [kind][crate::model::DiskEncryptionConfiguration::kind].
12116    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12117        self.kind = v.into();
12118        self
12119    }
12120}
12121
12122impl wkt::message::Message for DiskEncryptionConfiguration {
12123    fn typename() -> &'static str {
12124        "type.googleapis.com/google.cloud.sql.v1.DiskEncryptionConfiguration"
12125    }
12126}
12127
12128/// Disk encryption status for an instance.
12129#[derive(Clone, Default, PartialEq)]
12130#[non_exhaustive]
12131pub struct DiskEncryptionStatus {
12132    /// KMS key version used to encrypt the Cloud SQL instance resource
12133    pub kms_key_version_name: std::string::String,
12134
12135    /// This is always `sql#diskEncryptionStatus`.
12136    pub kind: std::string::String,
12137
12138    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12139}
12140
12141impl DiskEncryptionStatus {
12142    pub fn new() -> Self {
12143        std::default::Default::default()
12144    }
12145
12146    /// Sets the value of [kms_key_version_name][crate::model::DiskEncryptionStatus::kms_key_version_name].
12147    pub fn set_kms_key_version_name<T: std::convert::Into<std::string::String>>(
12148        mut self,
12149        v: T,
12150    ) -> Self {
12151        self.kms_key_version_name = v.into();
12152        self
12153    }
12154
12155    /// Sets the value of [kind][crate::model::DiskEncryptionStatus::kind].
12156    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12157        self.kind = v.into();
12158        self
12159    }
12160}
12161
12162impl wkt::message::Message for DiskEncryptionStatus {
12163    fn typename() -> &'static str {
12164        "type.googleapis.com/google.cloud.sql.v1.DiskEncryptionStatus"
12165    }
12166}
12167
12168/// Database instance IP mapping
12169#[derive(Clone, Default, PartialEq)]
12170#[non_exhaustive]
12171pub struct IpMapping {
12172    /// The type of this IP address. A `PRIMARY` address is a public address that
12173    /// can accept incoming connections. A `PRIVATE` address is a private address
12174    /// that can accept incoming connections. An `OUTGOING` address is the source
12175    /// address of connections originating from the instance, if supported.
12176    pub r#type: crate::model::SqlIpAddressType,
12177
12178    /// The IP address assigned.
12179    pub ip_address: std::string::String,
12180
12181    /// The due time for this IP to be retired in
12182    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
12183    /// `2012-11-15T16:19:00.094Z`. This field is only available when
12184    /// the IP is scheduled to be retired.
12185    pub time_to_retire: std::option::Option<wkt::Timestamp>,
12186
12187    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12188}
12189
12190impl IpMapping {
12191    pub fn new() -> Self {
12192        std::default::Default::default()
12193    }
12194
12195    /// Sets the value of [r#type][crate::model::IpMapping::type].
12196    pub fn set_type<T: std::convert::Into<crate::model::SqlIpAddressType>>(mut self, v: T) -> Self {
12197        self.r#type = v.into();
12198        self
12199    }
12200
12201    /// Sets the value of [ip_address][crate::model::IpMapping::ip_address].
12202    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12203        self.ip_address = v.into();
12204        self
12205    }
12206
12207    /// Sets the value of [time_to_retire][crate::model::IpMapping::time_to_retire].
12208    pub fn set_time_to_retire<T>(mut self, v: T) -> Self
12209    where
12210        T: std::convert::Into<wkt::Timestamp>,
12211    {
12212        self.time_to_retire = std::option::Option::Some(v.into());
12213        self
12214    }
12215
12216    /// Sets or clears the value of [time_to_retire][crate::model::IpMapping::time_to_retire].
12217    pub fn set_or_clear_time_to_retire<T>(mut self, v: std::option::Option<T>) -> Self
12218    where
12219        T: std::convert::Into<wkt::Timestamp>,
12220    {
12221        self.time_to_retire = v.map(|x| x.into());
12222        self
12223    }
12224}
12225
12226impl wkt::message::Message for IpMapping {
12227    fn typename() -> &'static str {
12228        "type.googleapis.com/google.cloud.sql.v1.IpMapping"
12229    }
12230}
12231
12232/// An Operation resource.&nbsp;For successful operations that return an
12233/// Operation resource, only the fields relevant to the operation are populated
12234/// in the resource.
12235#[derive(Clone, Default, PartialEq)]
12236#[non_exhaustive]
12237pub struct Operation {
12238    /// This is always `sql#operation`.
12239    pub kind: std::string::String,
12240
12241    pub target_link: std::string::String,
12242
12243    /// The status of an operation.
12244    pub status: crate::model::operation::SqlOperationStatus,
12245
12246    /// The email address of the user who initiated this operation.
12247    pub user: std::string::String,
12248
12249    /// The time this operation was enqueued in UTC timezone in [RFC
12250    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
12251    /// `2012-11-15T16:19:00.094Z`.
12252    pub insert_time: std::option::Option<wkt::Timestamp>,
12253
12254    /// The time this operation actually started in UTC timezone in [RFC
12255    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
12256    /// `2012-11-15T16:19:00.094Z`.
12257    pub start_time: std::option::Option<wkt::Timestamp>,
12258
12259    /// The time this operation finished in UTC timezone in [RFC
12260    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
12261    /// `2012-11-15T16:19:00.094Z`.
12262    pub end_time: std::option::Option<wkt::Timestamp>,
12263
12264    /// If errors occurred during processing of this operation, this field will be
12265    /// populated.
12266    pub error: std::option::Option<crate::model::OperationErrors>,
12267
12268    /// An Admin API warning message.
12269    pub api_warning: std::option::Option<crate::model::ApiWarning>,
12270
12271    /// The type of the operation. Valid values are:
12272    ///
12273    /// * `CREATE`
12274    /// * `DELETE`
12275    /// * `UPDATE`
12276    /// * `RESTART`
12277    /// * `IMPORT`
12278    /// * `EXPORT`
12279    /// * `BACKUP_VOLUME`
12280    /// * `RESTORE_VOLUME`
12281    /// * `CREATE_USER`
12282    /// * `DELETE_USER`
12283    /// * `CREATE_DATABASE`
12284    /// * `DELETE_DATABASE`
12285    pub operation_type: crate::model::operation::SqlOperationType,
12286
12287    /// The context for import operation, if applicable.
12288    pub import_context: std::option::Option<crate::model::ImportContext>,
12289
12290    /// The context for export operation, if applicable.
12291    pub export_context: std::option::Option<crate::model::ExportContext>,
12292
12293    /// The context for backup operation, if applicable.
12294    pub backup_context: std::option::Option<crate::model::BackupContext>,
12295
12296    /// An identifier that uniquely identifies the operation. You can use this
12297    /// identifier to retrieve the Operations resource that has information about
12298    /// the operation.
12299    pub name: std::string::String,
12300
12301    /// Name of the database instance related to this operation.
12302    pub target_id: std::string::String,
12303
12304    /// The URI of this resource.
12305    pub self_link: std::string::String,
12306
12307    /// The project ID of the target instance related to this operation.
12308    pub target_project: std::string::String,
12309
12310    /// The context for acquire SSRS lease operation, if applicable.
12311    pub acquire_ssrs_lease_context: std::option::Option<crate::model::AcquireSsrsLeaseContext>,
12312
12313    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12314}
12315
12316impl Operation {
12317    pub fn new() -> Self {
12318        std::default::Default::default()
12319    }
12320
12321    /// Sets the value of [kind][crate::model::Operation::kind].
12322    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12323        self.kind = v.into();
12324        self
12325    }
12326
12327    /// Sets the value of [target_link][crate::model::Operation::target_link].
12328    pub fn set_target_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12329        self.target_link = v.into();
12330        self
12331    }
12332
12333    /// Sets the value of [status][crate::model::Operation::status].
12334    pub fn set_status<T: std::convert::Into<crate::model::operation::SqlOperationStatus>>(
12335        mut self,
12336        v: T,
12337    ) -> Self {
12338        self.status = v.into();
12339        self
12340    }
12341
12342    /// Sets the value of [user][crate::model::Operation::user].
12343    pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12344        self.user = v.into();
12345        self
12346    }
12347
12348    /// Sets the value of [insert_time][crate::model::Operation::insert_time].
12349    pub fn set_insert_time<T>(mut self, v: T) -> Self
12350    where
12351        T: std::convert::Into<wkt::Timestamp>,
12352    {
12353        self.insert_time = std::option::Option::Some(v.into());
12354        self
12355    }
12356
12357    /// Sets or clears the value of [insert_time][crate::model::Operation::insert_time].
12358    pub fn set_or_clear_insert_time<T>(mut self, v: std::option::Option<T>) -> Self
12359    where
12360        T: std::convert::Into<wkt::Timestamp>,
12361    {
12362        self.insert_time = v.map(|x| x.into());
12363        self
12364    }
12365
12366    /// Sets the value of [start_time][crate::model::Operation::start_time].
12367    pub fn set_start_time<T>(mut self, v: T) -> Self
12368    where
12369        T: std::convert::Into<wkt::Timestamp>,
12370    {
12371        self.start_time = std::option::Option::Some(v.into());
12372        self
12373    }
12374
12375    /// Sets or clears the value of [start_time][crate::model::Operation::start_time].
12376    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
12377    where
12378        T: std::convert::Into<wkt::Timestamp>,
12379    {
12380        self.start_time = v.map(|x| x.into());
12381        self
12382    }
12383
12384    /// Sets the value of [end_time][crate::model::Operation::end_time].
12385    pub fn set_end_time<T>(mut self, v: T) -> Self
12386    where
12387        T: std::convert::Into<wkt::Timestamp>,
12388    {
12389        self.end_time = std::option::Option::Some(v.into());
12390        self
12391    }
12392
12393    /// Sets or clears the value of [end_time][crate::model::Operation::end_time].
12394    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
12395    where
12396        T: std::convert::Into<wkt::Timestamp>,
12397    {
12398        self.end_time = v.map(|x| x.into());
12399        self
12400    }
12401
12402    /// Sets the value of [error][crate::model::Operation::error].
12403    pub fn set_error<T>(mut self, v: T) -> Self
12404    where
12405        T: std::convert::Into<crate::model::OperationErrors>,
12406    {
12407        self.error = std::option::Option::Some(v.into());
12408        self
12409    }
12410
12411    /// Sets or clears the value of [error][crate::model::Operation::error].
12412    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
12413    where
12414        T: std::convert::Into<crate::model::OperationErrors>,
12415    {
12416        self.error = v.map(|x| x.into());
12417        self
12418    }
12419
12420    /// Sets the value of [api_warning][crate::model::Operation::api_warning].
12421    pub fn set_api_warning<T>(mut self, v: T) -> Self
12422    where
12423        T: std::convert::Into<crate::model::ApiWarning>,
12424    {
12425        self.api_warning = std::option::Option::Some(v.into());
12426        self
12427    }
12428
12429    /// Sets or clears the value of [api_warning][crate::model::Operation::api_warning].
12430    pub fn set_or_clear_api_warning<T>(mut self, v: std::option::Option<T>) -> Self
12431    where
12432        T: std::convert::Into<crate::model::ApiWarning>,
12433    {
12434        self.api_warning = v.map(|x| x.into());
12435        self
12436    }
12437
12438    /// Sets the value of [operation_type][crate::model::Operation::operation_type].
12439    pub fn set_operation_type<T: std::convert::Into<crate::model::operation::SqlOperationType>>(
12440        mut self,
12441        v: T,
12442    ) -> Self {
12443        self.operation_type = v.into();
12444        self
12445    }
12446
12447    /// Sets the value of [import_context][crate::model::Operation::import_context].
12448    pub fn set_import_context<T>(mut self, v: T) -> Self
12449    where
12450        T: std::convert::Into<crate::model::ImportContext>,
12451    {
12452        self.import_context = std::option::Option::Some(v.into());
12453        self
12454    }
12455
12456    /// Sets or clears the value of [import_context][crate::model::Operation::import_context].
12457    pub fn set_or_clear_import_context<T>(mut self, v: std::option::Option<T>) -> Self
12458    where
12459        T: std::convert::Into<crate::model::ImportContext>,
12460    {
12461        self.import_context = v.map(|x| x.into());
12462        self
12463    }
12464
12465    /// Sets the value of [export_context][crate::model::Operation::export_context].
12466    pub fn set_export_context<T>(mut self, v: T) -> Self
12467    where
12468        T: std::convert::Into<crate::model::ExportContext>,
12469    {
12470        self.export_context = std::option::Option::Some(v.into());
12471        self
12472    }
12473
12474    /// Sets or clears the value of [export_context][crate::model::Operation::export_context].
12475    pub fn set_or_clear_export_context<T>(mut self, v: std::option::Option<T>) -> Self
12476    where
12477        T: std::convert::Into<crate::model::ExportContext>,
12478    {
12479        self.export_context = v.map(|x| x.into());
12480        self
12481    }
12482
12483    /// Sets the value of [backup_context][crate::model::Operation::backup_context].
12484    pub fn set_backup_context<T>(mut self, v: T) -> Self
12485    where
12486        T: std::convert::Into<crate::model::BackupContext>,
12487    {
12488        self.backup_context = std::option::Option::Some(v.into());
12489        self
12490    }
12491
12492    /// Sets or clears the value of [backup_context][crate::model::Operation::backup_context].
12493    pub fn set_or_clear_backup_context<T>(mut self, v: std::option::Option<T>) -> Self
12494    where
12495        T: std::convert::Into<crate::model::BackupContext>,
12496    {
12497        self.backup_context = v.map(|x| x.into());
12498        self
12499    }
12500
12501    /// Sets the value of [name][crate::model::Operation::name].
12502    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12503        self.name = v.into();
12504        self
12505    }
12506
12507    /// Sets the value of [target_id][crate::model::Operation::target_id].
12508    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12509        self.target_id = v.into();
12510        self
12511    }
12512
12513    /// Sets the value of [self_link][crate::model::Operation::self_link].
12514    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12515        self.self_link = v.into();
12516        self
12517    }
12518
12519    /// Sets the value of [target_project][crate::model::Operation::target_project].
12520    pub fn set_target_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12521        self.target_project = v.into();
12522        self
12523    }
12524
12525    /// Sets the value of [acquire_ssrs_lease_context][crate::model::Operation::acquire_ssrs_lease_context].
12526    pub fn set_acquire_ssrs_lease_context<T>(mut self, v: T) -> Self
12527    where
12528        T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
12529    {
12530        self.acquire_ssrs_lease_context = std::option::Option::Some(v.into());
12531        self
12532    }
12533
12534    /// Sets or clears the value of [acquire_ssrs_lease_context][crate::model::Operation::acquire_ssrs_lease_context].
12535    pub fn set_or_clear_acquire_ssrs_lease_context<T>(mut self, v: std::option::Option<T>) -> Self
12536    where
12537        T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
12538    {
12539        self.acquire_ssrs_lease_context = v.map(|x| x.into());
12540        self
12541    }
12542}
12543
12544impl wkt::message::Message for Operation {
12545    fn typename() -> &'static str {
12546        "type.googleapis.com/google.cloud.sql.v1.Operation"
12547    }
12548}
12549
12550/// Defines additional types related to [Operation].
12551pub mod operation {
12552    #[allow(unused_imports)]
12553    use super::*;
12554
12555    /// The type of Cloud SQL operation.
12556    ///
12557    /// # Working with unknown values
12558    ///
12559    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12560    /// additional enum variants at any time. Adding new variants is not considered
12561    /// a breaking change. Applications should write their code in anticipation of:
12562    ///
12563    /// - New values appearing in future releases of the client library, **and**
12564    /// - New values received dynamically, without application changes.
12565    ///
12566    /// Please consult the [Working with enums] section in the user guide for some
12567    /// guidelines.
12568    ///
12569    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12570    #[derive(Clone, Debug, PartialEq)]
12571    #[non_exhaustive]
12572    pub enum SqlOperationType {
12573        /// Unknown operation type.
12574        Unspecified,
12575        /// Imports data into a Cloud SQL instance.
12576        Import,
12577        /// Exports data from a Cloud SQL instance to a Cloud Storage
12578        /// bucket.
12579        Export,
12580        /// Creates a new Cloud SQL instance.
12581        Create,
12582        /// Updates the settings of a Cloud SQL instance.
12583        Update,
12584        /// Deletes a Cloud SQL instance.
12585        Delete,
12586        /// Restarts the Cloud SQL instance.
12587        Restart,
12588        #[deprecated]
12589        Backup,
12590        #[deprecated]
12591        Snapshot,
12592        /// Performs instance backup.
12593        BackupVolume,
12594        /// Deletes an instance backup.
12595        DeleteVolume,
12596        /// Restores an instance backup.
12597        RestoreVolume,
12598        /// Injects a privileged user in mysql for MOB instances.
12599        InjectUser,
12600        /// Clones a Cloud SQL instance.
12601        Clone,
12602        /// Stops replication on a Cloud SQL read replica instance.
12603        StopReplica,
12604        /// Starts replication on a Cloud SQL read replica instance.
12605        StartReplica,
12606        /// Promotes a Cloud SQL replica instance.
12607        PromoteReplica,
12608        /// Creates a Cloud SQL replica instance.
12609        CreateReplica,
12610        /// Creates a new user in a Cloud SQL instance.
12611        CreateUser,
12612        /// Deletes a user from a Cloud SQL instance.
12613        DeleteUser,
12614        /// Updates an existing user in a Cloud SQL instance.
12615        UpdateUser,
12616        /// Creates a database in the Cloud SQL instance.
12617        CreateDatabase,
12618        /// Deletes a database in the Cloud SQL instance.
12619        DeleteDatabase,
12620        /// Updates a database in the Cloud SQL instance.
12621        UpdateDatabase,
12622        /// Performs failover of an HA-enabled Cloud SQL
12623        /// failover replica.
12624        Failover,
12625        /// Deletes the backup taken by a backup run.
12626        DeleteBackup,
12627        RecreateReplica,
12628        /// Truncates a general or slow log table in MySQL.
12629        TruncateLog,
12630        /// Demotes the stand-alone instance to be a Cloud SQL
12631        /// read replica for an external database server.
12632        DemoteMaster,
12633        /// Indicates that the instance is currently in maintenance. Maintenance
12634        /// typically causes the instance to be unavailable for 1-3 minutes.
12635        Maintenance,
12636        /// This field is deprecated, and will be removed in future version of API.
12637        #[deprecated]
12638        EnablePrivateIp,
12639        #[deprecated]
12640        DeferMaintenance,
12641        /// Creates clone instance.
12642        #[deprecated]
12643        CreateClone,
12644        /// Reschedule maintenance to another time.
12645        RescheduleMaintenance,
12646        /// Starts external sync of a Cloud SQL EM replica to an external primary
12647        /// instance.
12648        StartExternalSync,
12649        /// Recovers logs from an instance's old data disk.
12650        LogCleanup,
12651        /// Performs auto-restart of an HA-enabled Cloud SQL database for auto
12652        /// recovery.
12653        AutoRestart,
12654        /// Re-encrypts CMEK instances with latest key version.
12655        Reencrypt,
12656        /// Switches the roles of the primary and replica pair. The target instance
12657        /// should be the replica.
12658        Switchover,
12659        /// Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
12660        AcquireSsrsLease,
12661        /// Release a lease for the setup of SQL Server Reporting Services (SSRS).
12662        ReleaseSsrsLease,
12663        /// Reconfigures old primary after a promote replica operation. Effect of a
12664        /// promote operation to the old primary is executed in this operation,
12665        /// asynchronously from the promote replica operation executed to the
12666        /// replica.
12667        ReconfigureOldPrimary,
12668        /// Indicates that the instance, its read replicas, and its cascading
12669        /// replicas are in maintenance. Maintenance typically gets initiated on
12670        /// groups of replicas first, followed by the primary instance. For each
12671        /// instance, maintenance typically causes the instance to be unavailable for
12672        /// 1-3 minutes.
12673        ClusterMaintenance,
12674        /// Indicates that the instance (and any of its replicas) are currently in
12675        /// maintenance. This is initiated as a self-service request by using SSM.
12676        /// Maintenance typically causes the instance to be unavailable for 1-3
12677        /// minutes.
12678        SelfServiceMaintenance,
12679        /// Switches a primary instance to a replica. This operation runs as part of
12680        /// a switchover operation to the original primary instance.
12681        SwitchoverToReplica,
12682        /// Updates the major version of a Cloud SQL instance.
12683        MajorVersionUpgrade,
12684        /// If set, the enum was initialized with an unknown value.
12685        ///
12686        /// Applications can examine the value using [SqlOperationType::value] or
12687        /// [SqlOperationType::name].
12688        UnknownValue(sql_operation_type::UnknownValue),
12689    }
12690
12691    #[doc(hidden)]
12692    pub mod sql_operation_type {
12693        #[allow(unused_imports)]
12694        use super::*;
12695        #[derive(Clone, Debug, PartialEq)]
12696        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12697    }
12698
12699    impl SqlOperationType {
12700        /// Gets the enum value.
12701        ///
12702        /// Returns `None` if the enum contains an unknown value deserialized from
12703        /// the string representation of enums.
12704        pub fn value(&self) -> std::option::Option<i32> {
12705            match self {
12706                Self::Unspecified => std::option::Option::Some(0),
12707                Self::Import => std::option::Option::Some(1),
12708                Self::Export => std::option::Option::Some(2),
12709                Self::Create => std::option::Option::Some(3),
12710                Self::Update => std::option::Option::Some(4),
12711                Self::Delete => std::option::Option::Some(5),
12712                Self::Restart => std::option::Option::Some(6),
12713                Self::Backup => std::option::Option::Some(7),
12714                Self::Snapshot => std::option::Option::Some(8),
12715                Self::BackupVolume => std::option::Option::Some(9),
12716                Self::DeleteVolume => std::option::Option::Some(10),
12717                Self::RestoreVolume => std::option::Option::Some(11),
12718                Self::InjectUser => std::option::Option::Some(12),
12719                Self::Clone => std::option::Option::Some(14),
12720                Self::StopReplica => std::option::Option::Some(15),
12721                Self::StartReplica => std::option::Option::Some(16),
12722                Self::PromoteReplica => std::option::Option::Some(17),
12723                Self::CreateReplica => std::option::Option::Some(18),
12724                Self::CreateUser => std::option::Option::Some(19),
12725                Self::DeleteUser => std::option::Option::Some(20),
12726                Self::UpdateUser => std::option::Option::Some(21),
12727                Self::CreateDatabase => std::option::Option::Some(22),
12728                Self::DeleteDatabase => std::option::Option::Some(23),
12729                Self::UpdateDatabase => std::option::Option::Some(24),
12730                Self::Failover => std::option::Option::Some(25),
12731                Self::DeleteBackup => std::option::Option::Some(26),
12732                Self::RecreateReplica => std::option::Option::Some(27),
12733                Self::TruncateLog => std::option::Option::Some(28),
12734                Self::DemoteMaster => std::option::Option::Some(29),
12735                Self::Maintenance => std::option::Option::Some(30),
12736                Self::EnablePrivateIp => std::option::Option::Some(31),
12737                Self::DeferMaintenance => std::option::Option::Some(32),
12738                Self::CreateClone => std::option::Option::Some(33),
12739                Self::RescheduleMaintenance => std::option::Option::Some(34),
12740                Self::StartExternalSync => std::option::Option::Some(35),
12741                Self::LogCleanup => std::option::Option::Some(36),
12742                Self::AutoRestart => std::option::Option::Some(37),
12743                Self::Reencrypt => std::option::Option::Some(38),
12744                Self::Switchover => std::option::Option::Some(39),
12745                Self::AcquireSsrsLease => std::option::Option::Some(42),
12746                Self::ReleaseSsrsLease => std::option::Option::Some(43),
12747                Self::ReconfigureOldPrimary => std::option::Option::Some(44),
12748                Self::ClusterMaintenance => std::option::Option::Some(45),
12749                Self::SelfServiceMaintenance => std::option::Option::Some(46),
12750                Self::SwitchoverToReplica => std::option::Option::Some(47),
12751                Self::MajorVersionUpgrade => std::option::Option::Some(48),
12752                Self::UnknownValue(u) => u.0.value(),
12753            }
12754        }
12755
12756        /// Gets the enum value as a string.
12757        ///
12758        /// Returns `None` if the enum contains an unknown value deserialized from
12759        /// the integer representation of enums.
12760        pub fn name(&self) -> std::option::Option<&str> {
12761            match self {
12762                Self::Unspecified => std::option::Option::Some("SQL_OPERATION_TYPE_UNSPECIFIED"),
12763                Self::Import => std::option::Option::Some("IMPORT"),
12764                Self::Export => std::option::Option::Some("EXPORT"),
12765                Self::Create => std::option::Option::Some("CREATE"),
12766                Self::Update => std::option::Option::Some("UPDATE"),
12767                Self::Delete => std::option::Option::Some("DELETE"),
12768                Self::Restart => std::option::Option::Some("RESTART"),
12769                Self::Backup => std::option::Option::Some("BACKUP"),
12770                Self::Snapshot => std::option::Option::Some("SNAPSHOT"),
12771                Self::BackupVolume => std::option::Option::Some("BACKUP_VOLUME"),
12772                Self::DeleteVolume => std::option::Option::Some("DELETE_VOLUME"),
12773                Self::RestoreVolume => std::option::Option::Some("RESTORE_VOLUME"),
12774                Self::InjectUser => std::option::Option::Some("INJECT_USER"),
12775                Self::Clone => std::option::Option::Some("CLONE"),
12776                Self::StopReplica => std::option::Option::Some("STOP_REPLICA"),
12777                Self::StartReplica => std::option::Option::Some("START_REPLICA"),
12778                Self::PromoteReplica => std::option::Option::Some("PROMOTE_REPLICA"),
12779                Self::CreateReplica => std::option::Option::Some("CREATE_REPLICA"),
12780                Self::CreateUser => std::option::Option::Some("CREATE_USER"),
12781                Self::DeleteUser => std::option::Option::Some("DELETE_USER"),
12782                Self::UpdateUser => std::option::Option::Some("UPDATE_USER"),
12783                Self::CreateDatabase => std::option::Option::Some("CREATE_DATABASE"),
12784                Self::DeleteDatabase => std::option::Option::Some("DELETE_DATABASE"),
12785                Self::UpdateDatabase => std::option::Option::Some("UPDATE_DATABASE"),
12786                Self::Failover => std::option::Option::Some("FAILOVER"),
12787                Self::DeleteBackup => std::option::Option::Some("DELETE_BACKUP"),
12788                Self::RecreateReplica => std::option::Option::Some("RECREATE_REPLICA"),
12789                Self::TruncateLog => std::option::Option::Some("TRUNCATE_LOG"),
12790                Self::DemoteMaster => std::option::Option::Some("DEMOTE_MASTER"),
12791                Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
12792                Self::EnablePrivateIp => std::option::Option::Some("ENABLE_PRIVATE_IP"),
12793                Self::DeferMaintenance => std::option::Option::Some("DEFER_MAINTENANCE"),
12794                Self::CreateClone => std::option::Option::Some("CREATE_CLONE"),
12795                Self::RescheduleMaintenance => std::option::Option::Some("RESCHEDULE_MAINTENANCE"),
12796                Self::StartExternalSync => std::option::Option::Some("START_EXTERNAL_SYNC"),
12797                Self::LogCleanup => std::option::Option::Some("LOG_CLEANUP"),
12798                Self::AutoRestart => std::option::Option::Some("AUTO_RESTART"),
12799                Self::Reencrypt => std::option::Option::Some("REENCRYPT"),
12800                Self::Switchover => std::option::Option::Some("SWITCHOVER"),
12801                Self::AcquireSsrsLease => std::option::Option::Some("ACQUIRE_SSRS_LEASE"),
12802                Self::ReleaseSsrsLease => std::option::Option::Some("RELEASE_SSRS_LEASE"),
12803                Self::ReconfigureOldPrimary => std::option::Option::Some("RECONFIGURE_OLD_PRIMARY"),
12804                Self::ClusterMaintenance => std::option::Option::Some("CLUSTER_MAINTENANCE"),
12805                Self::SelfServiceMaintenance => {
12806                    std::option::Option::Some("SELF_SERVICE_MAINTENANCE")
12807                }
12808                Self::SwitchoverToReplica => std::option::Option::Some("SWITCHOVER_TO_REPLICA"),
12809                Self::MajorVersionUpgrade => std::option::Option::Some("MAJOR_VERSION_UPGRADE"),
12810                Self::UnknownValue(u) => u.0.name(),
12811            }
12812        }
12813    }
12814
12815    impl std::default::Default for SqlOperationType {
12816        fn default() -> Self {
12817            use std::convert::From;
12818            Self::from(0)
12819        }
12820    }
12821
12822    impl std::fmt::Display for SqlOperationType {
12823        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12824            wkt::internal::display_enum(f, self.name(), self.value())
12825        }
12826    }
12827
12828    impl std::convert::From<i32> for SqlOperationType {
12829        fn from(value: i32) -> Self {
12830            match value {
12831                0 => Self::Unspecified,
12832                1 => Self::Import,
12833                2 => Self::Export,
12834                3 => Self::Create,
12835                4 => Self::Update,
12836                5 => Self::Delete,
12837                6 => Self::Restart,
12838                7 => Self::Backup,
12839                8 => Self::Snapshot,
12840                9 => Self::BackupVolume,
12841                10 => Self::DeleteVolume,
12842                11 => Self::RestoreVolume,
12843                12 => Self::InjectUser,
12844                14 => Self::Clone,
12845                15 => Self::StopReplica,
12846                16 => Self::StartReplica,
12847                17 => Self::PromoteReplica,
12848                18 => Self::CreateReplica,
12849                19 => Self::CreateUser,
12850                20 => Self::DeleteUser,
12851                21 => Self::UpdateUser,
12852                22 => Self::CreateDatabase,
12853                23 => Self::DeleteDatabase,
12854                24 => Self::UpdateDatabase,
12855                25 => Self::Failover,
12856                26 => Self::DeleteBackup,
12857                27 => Self::RecreateReplica,
12858                28 => Self::TruncateLog,
12859                29 => Self::DemoteMaster,
12860                30 => Self::Maintenance,
12861                31 => Self::EnablePrivateIp,
12862                32 => Self::DeferMaintenance,
12863                33 => Self::CreateClone,
12864                34 => Self::RescheduleMaintenance,
12865                35 => Self::StartExternalSync,
12866                36 => Self::LogCleanup,
12867                37 => Self::AutoRestart,
12868                38 => Self::Reencrypt,
12869                39 => Self::Switchover,
12870                42 => Self::AcquireSsrsLease,
12871                43 => Self::ReleaseSsrsLease,
12872                44 => Self::ReconfigureOldPrimary,
12873                45 => Self::ClusterMaintenance,
12874                46 => Self::SelfServiceMaintenance,
12875                47 => Self::SwitchoverToReplica,
12876                48 => Self::MajorVersionUpgrade,
12877                _ => Self::UnknownValue(sql_operation_type::UnknownValue(
12878                    wkt::internal::UnknownEnumValue::Integer(value),
12879                )),
12880            }
12881        }
12882    }
12883
12884    impl std::convert::From<&str> for SqlOperationType {
12885        fn from(value: &str) -> Self {
12886            use std::string::ToString;
12887            match value {
12888                "SQL_OPERATION_TYPE_UNSPECIFIED" => Self::Unspecified,
12889                "IMPORT" => Self::Import,
12890                "EXPORT" => Self::Export,
12891                "CREATE" => Self::Create,
12892                "UPDATE" => Self::Update,
12893                "DELETE" => Self::Delete,
12894                "RESTART" => Self::Restart,
12895                "BACKUP" => Self::Backup,
12896                "SNAPSHOT" => Self::Snapshot,
12897                "BACKUP_VOLUME" => Self::BackupVolume,
12898                "DELETE_VOLUME" => Self::DeleteVolume,
12899                "RESTORE_VOLUME" => Self::RestoreVolume,
12900                "INJECT_USER" => Self::InjectUser,
12901                "CLONE" => Self::Clone,
12902                "STOP_REPLICA" => Self::StopReplica,
12903                "START_REPLICA" => Self::StartReplica,
12904                "PROMOTE_REPLICA" => Self::PromoteReplica,
12905                "CREATE_REPLICA" => Self::CreateReplica,
12906                "CREATE_USER" => Self::CreateUser,
12907                "DELETE_USER" => Self::DeleteUser,
12908                "UPDATE_USER" => Self::UpdateUser,
12909                "CREATE_DATABASE" => Self::CreateDatabase,
12910                "DELETE_DATABASE" => Self::DeleteDatabase,
12911                "UPDATE_DATABASE" => Self::UpdateDatabase,
12912                "FAILOVER" => Self::Failover,
12913                "DELETE_BACKUP" => Self::DeleteBackup,
12914                "RECREATE_REPLICA" => Self::RecreateReplica,
12915                "TRUNCATE_LOG" => Self::TruncateLog,
12916                "DEMOTE_MASTER" => Self::DemoteMaster,
12917                "MAINTENANCE" => Self::Maintenance,
12918                "ENABLE_PRIVATE_IP" => Self::EnablePrivateIp,
12919                "DEFER_MAINTENANCE" => Self::DeferMaintenance,
12920                "CREATE_CLONE" => Self::CreateClone,
12921                "RESCHEDULE_MAINTENANCE" => Self::RescheduleMaintenance,
12922                "START_EXTERNAL_SYNC" => Self::StartExternalSync,
12923                "LOG_CLEANUP" => Self::LogCleanup,
12924                "AUTO_RESTART" => Self::AutoRestart,
12925                "REENCRYPT" => Self::Reencrypt,
12926                "SWITCHOVER" => Self::Switchover,
12927                "ACQUIRE_SSRS_LEASE" => Self::AcquireSsrsLease,
12928                "RELEASE_SSRS_LEASE" => Self::ReleaseSsrsLease,
12929                "RECONFIGURE_OLD_PRIMARY" => Self::ReconfigureOldPrimary,
12930                "CLUSTER_MAINTENANCE" => Self::ClusterMaintenance,
12931                "SELF_SERVICE_MAINTENANCE" => Self::SelfServiceMaintenance,
12932                "SWITCHOVER_TO_REPLICA" => Self::SwitchoverToReplica,
12933                "MAJOR_VERSION_UPGRADE" => Self::MajorVersionUpgrade,
12934                _ => Self::UnknownValue(sql_operation_type::UnknownValue(
12935                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12936                )),
12937            }
12938        }
12939    }
12940
12941    impl serde::ser::Serialize for SqlOperationType {
12942        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12943        where
12944            S: serde::Serializer,
12945        {
12946            match self {
12947                Self::Unspecified => serializer.serialize_i32(0),
12948                Self::Import => serializer.serialize_i32(1),
12949                Self::Export => serializer.serialize_i32(2),
12950                Self::Create => serializer.serialize_i32(3),
12951                Self::Update => serializer.serialize_i32(4),
12952                Self::Delete => serializer.serialize_i32(5),
12953                Self::Restart => serializer.serialize_i32(6),
12954                Self::Backup => serializer.serialize_i32(7),
12955                Self::Snapshot => serializer.serialize_i32(8),
12956                Self::BackupVolume => serializer.serialize_i32(9),
12957                Self::DeleteVolume => serializer.serialize_i32(10),
12958                Self::RestoreVolume => serializer.serialize_i32(11),
12959                Self::InjectUser => serializer.serialize_i32(12),
12960                Self::Clone => serializer.serialize_i32(14),
12961                Self::StopReplica => serializer.serialize_i32(15),
12962                Self::StartReplica => serializer.serialize_i32(16),
12963                Self::PromoteReplica => serializer.serialize_i32(17),
12964                Self::CreateReplica => serializer.serialize_i32(18),
12965                Self::CreateUser => serializer.serialize_i32(19),
12966                Self::DeleteUser => serializer.serialize_i32(20),
12967                Self::UpdateUser => serializer.serialize_i32(21),
12968                Self::CreateDatabase => serializer.serialize_i32(22),
12969                Self::DeleteDatabase => serializer.serialize_i32(23),
12970                Self::UpdateDatabase => serializer.serialize_i32(24),
12971                Self::Failover => serializer.serialize_i32(25),
12972                Self::DeleteBackup => serializer.serialize_i32(26),
12973                Self::RecreateReplica => serializer.serialize_i32(27),
12974                Self::TruncateLog => serializer.serialize_i32(28),
12975                Self::DemoteMaster => serializer.serialize_i32(29),
12976                Self::Maintenance => serializer.serialize_i32(30),
12977                Self::EnablePrivateIp => serializer.serialize_i32(31),
12978                Self::DeferMaintenance => serializer.serialize_i32(32),
12979                Self::CreateClone => serializer.serialize_i32(33),
12980                Self::RescheduleMaintenance => serializer.serialize_i32(34),
12981                Self::StartExternalSync => serializer.serialize_i32(35),
12982                Self::LogCleanup => serializer.serialize_i32(36),
12983                Self::AutoRestart => serializer.serialize_i32(37),
12984                Self::Reencrypt => serializer.serialize_i32(38),
12985                Self::Switchover => serializer.serialize_i32(39),
12986                Self::AcquireSsrsLease => serializer.serialize_i32(42),
12987                Self::ReleaseSsrsLease => serializer.serialize_i32(43),
12988                Self::ReconfigureOldPrimary => serializer.serialize_i32(44),
12989                Self::ClusterMaintenance => serializer.serialize_i32(45),
12990                Self::SelfServiceMaintenance => serializer.serialize_i32(46),
12991                Self::SwitchoverToReplica => serializer.serialize_i32(47),
12992                Self::MajorVersionUpgrade => serializer.serialize_i32(48),
12993                Self::UnknownValue(u) => u.0.serialize(serializer),
12994            }
12995        }
12996    }
12997
12998    impl<'de> serde::de::Deserialize<'de> for SqlOperationType {
12999        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13000        where
13001            D: serde::Deserializer<'de>,
13002        {
13003            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOperationType>::new(
13004                ".google.cloud.sql.v1.Operation.SqlOperationType",
13005            ))
13006        }
13007    }
13008
13009    /// The status of an operation.
13010    ///
13011    /// # Working with unknown values
13012    ///
13013    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13014    /// additional enum variants at any time. Adding new variants is not considered
13015    /// a breaking change. Applications should write their code in anticipation of:
13016    ///
13017    /// - New values appearing in future releases of the client library, **and**
13018    /// - New values received dynamically, without application changes.
13019    ///
13020    /// Please consult the [Working with enums] section in the user guide for some
13021    /// guidelines.
13022    ///
13023    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13024    #[derive(Clone, Debug, PartialEq)]
13025    #[non_exhaustive]
13026    pub enum SqlOperationStatus {
13027        /// The state of the operation is unknown.
13028        Unspecified,
13029        /// The operation has been queued, but has not started yet.
13030        Pending,
13031        /// The operation is running.
13032        Running,
13033        /// The operation completed.
13034        Done,
13035        /// If set, the enum was initialized with an unknown value.
13036        ///
13037        /// Applications can examine the value using [SqlOperationStatus::value] or
13038        /// [SqlOperationStatus::name].
13039        UnknownValue(sql_operation_status::UnknownValue),
13040    }
13041
13042    #[doc(hidden)]
13043    pub mod sql_operation_status {
13044        #[allow(unused_imports)]
13045        use super::*;
13046        #[derive(Clone, Debug, PartialEq)]
13047        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13048    }
13049
13050    impl SqlOperationStatus {
13051        /// Gets the enum value.
13052        ///
13053        /// Returns `None` if the enum contains an unknown value deserialized from
13054        /// the string representation of enums.
13055        pub fn value(&self) -> std::option::Option<i32> {
13056            match self {
13057                Self::Unspecified => std::option::Option::Some(0),
13058                Self::Pending => std::option::Option::Some(1),
13059                Self::Running => std::option::Option::Some(2),
13060                Self::Done => std::option::Option::Some(3),
13061                Self::UnknownValue(u) => u.0.value(),
13062            }
13063        }
13064
13065        /// Gets the enum value as a string.
13066        ///
13067        /// Returns `None` if the enum contains an unknown value deserialized from
13068        /// the integer representation of enums.
13069        pub fn name(&self) -> std::option::Option<&str> {
13070            match self {
13071                Self::Unspecified => std::option::Option::Some("SQL_OPERATION_STATUS_UNSPECIFIED"),
13072                Self::Pending => std::option::Option::Some("PENDING"),
13073                Self::Running => std::option::Option::Some("RUNNING"),
13074                Self::Done => std::option::Option::Some("DONE"),
13075                Self::UnknownValue(u) => u.0.name(),
13076            }
13077        }
13078    }
13079
13080    impl std::default::Default for SqlOperationStatus {
13081        fn default() -> Self {
13082            use std::convert::From;
13083            Self::from(0)
13084        }
13085    }
13086
13087    impl std::fmt::Display for SqlOperationStatus {
13088        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13089            wkt::internal::display_enum(f, self.name(), self.value())
13090        }
13091    }
13092
13093    impl std::convert::From<i32> for SqlOperationStatus {
13094        fn from(value: i32) -> Self {
13095            match value {
13096                0 => Self::Unspecified,
13097                1 => Self::Pending,
13098                2 => Self::Running,
13099                3 => Self::Done,
13100                _ => Self::UnknownValue(sql_operation_status::UnknownValue(
13101                    wkt::internal::UnknownEnumValue::Integer(value),
13102                )),
13103            }
13104        }
13105    }
13106
13107    impl std::convert::From<&str> for SqlOperationStatus {
13108        fn from(value: &str) -> Self {
13109            use std::string::ToString;
13110            match value {
13111                "SQL_OPERATION_STATUS_UNSPECIFIED" => Self::Unspecified,
13112                "PENDING" => Self::Pending,
13113                "RUNNING" => Self::Running,
13114                "DONE" => Self::Done,
13115                _ => Self::UnknownValue(sql_operation_status::UnknownValue(
13116                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13117                )),
13118            }
13119        }
13120    }
13121
13122    impl serde::ser::Serialize for SqlOperationStatus {
13123        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13124        where
13125            S: serde::Serializer,
13126        {
13127            match self {
13128                Self::Unspecified => serializer.serialize_i32(0),
13129                Self::Pending => serializer.serialize_i32(1),
13130                Self::Running => serializer.serialize_i32(2),
13131                Self::Done => serializer.serialize_i32(3),
13132                Self::UnknownValue(u) => u.0.serialize(serializer),
13133            }
13134        }
13135    }
13136
13137    impl<'de> serde::de::Deserialize<'de> for SqlOperationStatus {
13138        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13139        where
13140            D: serde::Deserializer<'de>,
13141        {
13142            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOperationStatus>::new(
13143                ".google.cloud.sql.v1.Operation.SqlOperationStatus",
13144            ))
13145        }
13146    }
13147}
13148
13149/// Database instance operation error.
13150#[derive(Clone, Default, PartialEq)]
13151#[non_exhaustive]
13152pub struct OperationError {
13153    /// This is always `sql#operationError`.
13154    pub kind: std::string::String,
13155
13156    /// Identifies the specific error that occurred.
13157    pub code: std::string::String,
13158
13159    /// Additional information about the error encountered.
13160    pub message: std::string::String,
13161
13162    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13163}
13164
13165impl OperationError {
13166    pub fn new() -> Self {
13167        std::default::Default::default()
13168    }
13169
13170    /// Sets the value of [kind][crate::model::OperationError::kind].
13171    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13172        self.kind = v.into();
13173        self
13174    }
13175
13176    /// Sets the value of [code][crate::model::OperationError::code].
13177    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13178        self.code = v.into();
13179        self
13180    }
13181
13182    /// Sets the value of [message][crate::model::OperationError::message].
13183    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13184        self.message = v.into();
13185        self
13186    }
13187}
13188
13189impl wkt::message::Message for OperationError {
13190    fn typename() -> &'static str {
13191        "type.googleapis.com/google.cloud.sql.v1.OperationError"
13192    }
13193}
13194
13195/// Database instance operation errors list wrapper.
13196#[derive(Clone, Default, PartialEq)]
13197#[non_exhaustive]
13198pub struct OperationErrors {
13199    /// This is always `sql#operationErrors`.
13200    pub kind: std::string::String,
13201
13202    /// The list of errors encountered while processing this operation.
13203    pub errors: std::vec::Vec<crate::model::OperationError>,
13204
13205    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13206}
13207
13208impl OperationErrors {
13209    pub fn new() -> Self {
13210        std::default::Default::default()
13211    }
13212
13213    /// Sets the value of [kind][crate::model::OperationErrors::kind].
13214    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13215        self.kind = v.into();
13216        self
13217    }
13218
13219    /// Sets the value of [errors][crate::model::OperationErrors::errors].
13220    pub fn set_errors<T, V>(mut self, v: T) -> Self
13221    where
13222        T: std::iter::IntoIterator<Item = V>,
13223        V: std::convert::Into<crate::model::OperationError>,
13224    {
13225        use std::iter::Iterator;
13226        self.errors = v.into_iter().map(|i| i.into()).collect();
13227        self
13228    }
13229}
13230
13231impl wkt::message::Message for OperationErrors {
13232    fn typename() -> &'static str {
13233        "type.googleapis.com/google.cloud.sql.v1.OperationErrors"
13234    }
13235}
13236
13237/// Database instance local user password validation policy
13238#[derive(Clone, Default, PartialEq)]
13239#[non_exhaustive]
13240pub struct PasswordValidationPolicy {
13241    /// Minimum number of characters allowed.
13242    pub min_length: std::option::Option<wkt::Int32Value>,
13243
13244    /// The complexity of the password.
13245    pub complexity: crate::model::password_validation_policy::Complexity,
13246
13247    /// Number of previous passwords that cannot be reused.
13248    pub reuse_interval: std::option::Option<wkt::Int32Value>,
13249
13250    /// Disallow username as a part of the password.
13251    pub disallow_username_substring: std::option::Option<wkt::BoolValue>,
13252
13253    /// Minimum interval after which the password can be changed. This flag is only
13254    /// supported for PostgreSQL.
13255    pub password_change_interval: std::option::Option<wkt::Duration>,
13256
13257    /// Whether the password policy is enabled or not.
13258    pub enable_password_policy: std::option::Option<wkt::BoolValue>,
13259
13260    /// This field is deprecated and will be removed in a future version of the
13261    /// API.
13262    #[deprecated]
13263    pub disallow_compromised_credentials: std::option::Option<wkt::BoolValue>,
13264
13265    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13266}
13267
13268impl PasswordValidationPolicy {
13269    pub fn new() -> Self {
13270        std::default::Default::default()
13271    }
13272
13273    /// Sets the value of [min_length][crate::model::PasswordValidationPolicy::min_length].
13274    pub fn set_min_length<T>(mut self, v: T) -> Self
13275    where
13276        T: std::convert::Into<wkt::Int32Value>,
13277    {
13278        self.min_length = std::option::Option::Some(v.into());
13279        self
13280    }
13281
13282    /// Sets or clears the value of [min_length][crate::model::PasswordValidationPolicy::min_length].
13283    pub fn set_or_clear_min_length<T>(mut self, v: std::option::Option<T>) -> Self
13284    where
13285        T: std::convert::Into<wkt::Int32Value>,
13286    {
13287        self.min_length = v.map(|x| x.into());
13288        self
13289    }
13290
13291    /// Sets the value of [complexity][crate::model::PasswordValidationPolicy::complexity].
13292    pub fn set_complexity<
13293        T: std::convert::Into<crate::model::password_validation_policy::Complexity>,
13294    >(
13295        mut self,
13296        v: T,
13297    ) -> Self {
13298        self.complexity = v.into();
13299        self
13300    }
13301
13302    /// Sets the value of [reuse_interval][crate::model::PasswordValidationPolicy::reuse_interval].
13303    pub fn set_reuse_interval<T>(mut self, v: T) -> Self
13304    where
13305        T: std::convert::Into<wkt::Int32Value>,
13306    {
13307        self.reuse_interval = std::option::Option::Some(v.into());
13308        self
13309    }
13310
13311    /// Sets or clears the value of [reuse_interval][crate::model::PasswordValidationPolicy::reuse_interval].
13312    pub fn set_or_clear_reuse_interval<T>(mut self, v: std::option::Option<T>) -> Self
13313    where
13314        T: std::convert::Into<wkt::Int32Value>,
13315    {
13316        self.reuse_interval = v.map(|x| x.into());
13317        self
13318    }
13319
13320    /// Sets the value of [disallow_username_substring][crate::model::PasswordValidationPolicy::disallow_username_substring].
13321    pub fn set_disallow_username_substring<T>(mut self, v: T) -> Self
13322    where
13323        T: std::convert::Into<wkt::BoolValue>,
13324    {
13325        self.disallow_username_substring = std::option::Option::Some(v.into());
13326        self
13327    }
13328
13329    /// Sets or clears the value of [disallow_username_substring][crate::model::PasswordValidationPolicy::disallow_username_substring].
13330    pub fn set_or_clear_disallow_username_substring<T>(mut self, v: std::option::Option<T>) -> Self
13331    where
13332        T: std::convert::Into<wkt::BoolValue>,
13333    {
13334        self.disallow_username_substring = v.map(|x| x.into());
13335        self
13336    }
13337
13338    /// Sets the value of [password_change_interval][crate::model::PasswordValidationPolicy::password_change_interval].
13339    pub fn set_password_change_interval<T>(mut self, v: T) -> Self
13340    where
13341        T: std::convert::Into<wkt::Duration>,
13342    {
13343        self.password_change_interval = std::option::Option::Some(v.into());
13344        self
13345    }
13346
13347    /// Sets or clears the value of [password_change_interval][crate::model::PasswordValidationPolicy::password_change_interval].
13348    pub fn set_or_clear_password_change_interval<T>(mut self, v: std::option::Option<T>) -> Self
13349    where
13350        T: std::convert::Into<wkt::Duration>,
13351    {
13352        self.password_change_interval = v.map(|x| x.into());
13353        self
13354    }
13355
13356    /// Sets the value of [enable_password_policy][crate::model::PasswordValidationPolicy::enable_password_policy].
13357    pub fn set_enable_password_policy<T>(mut self, v: T) -> Self
13358    where
13359        T: std::convert::Into<wkt::BoolValue>,
13360    {
13361        self.enable_password_policy = std::option::Option::Some(v.into());
13362        self
13363    }
13364
13365    /// Sets or clears the value of [enable_password_policy][crate::model::PasswordValidationPolicy::enable_password_policy].
13366    pub fn set_or_clear_enable_password_policy<T>(mut self, v: std::option::Option<T>) -> Self
13367    where
13368        T: std::convert::Into<wkt::BoolValue>,
13369    {
13370        self.enable_password_policy = v.map(|x| x.into());
13371        self
13372    }
13373
13374    /// Sets the value of [disallow_compromised_credentials][crate::model::PasswordValidationPolicy::disallow_compromised_credentials].
13375    #[deprecated]
13376    pub fn set_disallow_compromised_credentials<T>(mut self, v: T) -> Self
13377    where
13378        T: std::convert::Into<wkt::BoolValue>,
13379    {
13380        self.disallow_compromised_credentials = std::option::Option::Some(v.into());
13381        self
13382    }
13383
13384    /// Sets or clears the value of [disallow_compromised_credentials][crate::model::PasswordValidationPolicy::disallow_compromised_credentials].
13385    #[deprecated]
13386    pub fn set_or_clear_disallow_compromised_credentials<T>(
13387        mut self,
13388        v: std::option::Option<T>,
13389    ) -> Self
13390    where
13391        T: std::convert::Into<wkt::BoolValue>,
13392    {
13393        self.disallow_compromised_credentials = v.map(|x| x.into());
13394        self
13395    }
13396}
13397
13398impl wkt::message::Message for PasswordValidationPolicy {
13399    fn typename() -> &'static str {
13400        "type.googleapis.com/google.cloud.sql.v1.PasswordValidationPolicy"
13401    }
13402}
13403
13404/// Defines additional types related to [PasswordValidationPolicy].
13405pub mod password_validation_policy {
13406    #[allow(unused_imports)]
13407    use super::*;
13408
13409    /// The complexity choices of the password.
13410    ///
13411    /// # Working with unknown values
13412    ///
13413    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13414    /// additional enum variants at any time. Adding new variants is not considered
13415    /// a breaking change. Applications should write their code in anticipation of:
13416    ///
13417    /// - New values appearing in future releases of the client library, **and**
13418    /// - New values received dynamically, without application changes.
13419    ///
13420    /// Please consult the [Working with enums] section in the user guide for some
13421    /// guidelines.
13422    ///
13423    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13424    #[derive(Clone, Debug, PartialEq)]
13425    #[non_exhaustive]
13426    pub enum Complexity {
13427        /// Complexity check is not specified.
13428        Unspecified,
13429        /// A combination of lowercase, uppercase, numeric, and non-alphanumeric
13430        /// characters.
13431        Default,
13432        /// If set, the enum was initialized with an unknown value.
13433        ///
13434        /// Applications can examine the value using [Complexity::value] or
13435        /// [Complexity::name].
13436        UnknownValue(complexity::UnknownValue),
13437    }
13438
13439    #[doc(hidden)]
13440    pub mod complexity {
13441        #[allow(unused_imports)]
13442        use super::*;
13443        #[derive(Clone, Debug, PartialEq)]
13444        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13445    }
13446
13447    impl Complexity {
13448        /// Gets the enum value.
13449        ///
13450        /// Returns `None` if the enum contains an unknown value deserialized from
13451        /// the string representation of enums.
13452        pub fn value(&self) -> std::option::Option<i32> {
13453            match self {
13454                Self::Unspecified => std::option::Option::Some(0),
13455                Self::Default => std::option::Option::Some(1),
13456                Self::UnknownValue(u) => u.0.value(),
13457            }
13458        }
13459
13460        /// Gets the enum value as a string.
13461        ///
13462        /// Returns `None` if the enum contains an unknown value deserialized from
13463        /// the integer representation of enums.
13464        pub fn name(&self) -> std::option::Option<&str> {
13465            match self {
13466                Self::Unspecified => std::option::Option::Some("COMPLEXITY_UNSPECIFIED"),
13467                Self::Default => std::option::Option::Some("COMPLEXITY_DEFAULT"),
13468                Self::UnknownValue(u) => u.0.name(),
13469            }
13470        }
13471    }
13472
13473    impl std::default::Default for Complexity {
13474        fn default() -> Self {
13475            use std::convert::From;
13476            Self::from(0)
13477        }
13478    }
13479
13480    impl std::fmt::Display for Complexity {
13481        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13482            wkt::internal::display_enum(f, self.name(), self.value())
13483        }
13484    }
13485
13486    impl std::convert::From<i32> for Complexity {
13487        fn from(value: i32) -> Self {
13488            match value {
13489                0 => Self::Unspecified,
13490                1 => Self::Default,
13491                _ => Self::UnknownValue(complexity::UnknownValue(
13492                    wkt::internal::UnknownEnumValue::Integer(value),
13493                )),
13494            }
13495        }
13496    }
13497
13498    impl std::convert::From<&str> for Complexity {
13499        fn from(value: &str) -> Self {
13500            use std::string::ToString;
13501            match value {
13502                "COMPLEXITY_UNSPECIFIED" => Self::Unspecified,
13503                "COMPLEXITY_DEFAULT" => Self::Default,
13504                _ => Self::UnknownValue(complexity::UnknownValue(
13505                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13506                )),
13507            }
13508        }
13509    }
13510
13511    impl serde::ser::Serialize for Complexity {
13512        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13513        where
13514            S: serde::Serializer,
13515        {
13516            match self {
13517                Self::Unspecified => serializer.serialize_i32(0),
13518                Self::Default => serializer.serialize_i32(1),
13519                Self::UnknownValue(u) => u.0.serialize(serializer),
13520            }
13521        }
13522    }
13523
13524    impl<'de> serde::de::Deserialize<'de> for Complexity {
13525        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13526        where
13527            D: serde::Deserializer<'de>,
13528        {
13529            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Complexity>::new(
13530                ".google.cloud.sql.v1.PasswordValidationPolicy.Complexity",
13531            ))
13532        }
13533    }
13534}
13535
13536/// Data cache configurations.
13537#[derive(Clone, Default, PartialEq)]
13538#[non_exhaustive]
13539pub struct DataCacheConfig {
13540    /// Whether data cache is enabled for the instance.
13541    pub data_cache_enabled: bool,
13542
13543    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13544}
13545
13546impl DataCacheConfig {
13547    pub fn new() -> Self {
13548        std::default::Default::default()
13549    }
13550
13551    /// Sets the value of [data_cache_enabled][crate::model::DataCacheConfig::data_cache_enabled].
13552    pub fn set_data_cache_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13553        self.data_cache_enabled = v.into();
13554        self
13555    }
13556}
13557
13558impl wkt::message::Message for DataCacheConfig {
13559    fn typename() -> &'static str {
13560        "type.googleapis.com/google.cloud.sql.v1.DataCacheConfig"
13561    }
13562}
13563
13564/// Database instance settings.
13565#[derive(Clone, Default, PartialEq)]
13566#[non_exhaustive]
13567pub struct Settings {
13568    /// The version of instance settings. This is a required field for update
13569    /// method to make sure concurrent updates are handled properly. During update,
13570    /// use the most recent settingsVersion value for this instance and do not try
13571    /// to update this value.
13572    pub settings_version: std::option::Option<wkt::Int64Value>,
13573
13574    /// The App Engine app IDs that can access this instance.
13575    /// (Deprecated) Applied to First Generation instances only.
13576    #[deprecated]
13577    pub authorized_gae_applications: std::vec::Vec<std::string::String>,
13578
13579    /// The tier (or machine type) for this instance, for example
13580    /// `db-custom-1-3840`. WARNING: Changing this restarts the instance.
13581    pub tier: std::string::String,
13582
13583    /// This is always `sql#settings`.
13584    pub kind: std::string::String,
13585
13586    /// User-provided labels, represented as a dictionary where each label is a
13587    /// single key value pair.
13588    pub user_labels: std::collections::HashMap<std::string::String, std::string::String>,
13589
13590    /// Availability type. Potential values:
13591    ///
13592    /// * `ZONAL`: The instance serves data from only one zone. Outages in that
13593    ///   zone affect data accessibility.
13594    /// * `REGIONAL`: The instance can serve data from more than one zone in a
13595    ///   region (it is highly available)./
13596    ///
13597    /// For more information, see [Overview of the High Availability
13598    /// Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
13599    pub availability_type: crate::model::SqlAvailabilityType,
13600
13601    /// The pricing plan for this instance. This can be either `PER_USE` or
13602    /// `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
13603    pub pricing_plan: crate::model::SqlPricingPlan,
13604
13605    /// The type of replication this instance uses. This can be either
13606    /// `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
13607    /// applicable to First Generation instances.
13608    #[deprecated]
13609    pub replication_type: crate::model::SqlReplicationType,
13610
13611    /// The maximum size to which storage capacity can be automatically increased.
13612    /// The default value is 0, which specifies that there is no limit.
13613    pub storage_auto_resize_limit: std::option::Option<wkt::Int64Value>,
13614
13615    /// The activation policy specifies when the instance is activated; it is
13616    /// applicable only when the instance state is RUNNABLE. Valid values:
13617    ///
13618    /// * `ALWAYS`: The instance is on, and remains so even in the absence of
13619    ///   connection requests.
13620    /// * `NEVER`: The instance is off; it is not activated, even if a
13621    ///   connection request arrives.
13622    pub activation_policy: crate::model::settings::SqlActivationPolicy,
13623
13624    /// The settings for IP Management. This allows to enable or disable the
13625    /// instance IP and manage which external networks can connect to the instance.
13626    /// The IPv4 address cannot be disabled for Second Generation instances.
13627    pub ip_configuration: std::option::Option<crate::model::IpConfiguration>,
13628
13629    /// Configuration to increase storage size automatically. The default value is
13630    /// true.
13631    pub storage_auto_resize: std::option::Option<wkt::BoolValue>,
13632
13633    /// The location preference settings. This allows the instance to be located as
13634    /// near as possible to either an App Engine app or Compute Engine zone for
13635    /// better performance. App Engine co-location was only applicable to First
13636    /// Generation instances.
13637    pub location_preference: std::option::Option<crate::model::LocationPreference>,
13638
13639    /// The database flags passed to the instance at startup.
13640    pub database_flags: std::vec::Vec<crate::model::DatabaseFlags>,
13641
13642    /// The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
13643    /// First Generation instances.
13644    pub data_disk_type: crate::model::SqlDataDiskType,
13645
13646    /// The maintenance window for this instance. This specifies when the instance
13647    /// can be restarted for maintenance purposes.
13648    pub maintenance_window: std::option::Option<crate::model::MaintenanceWindow>,
13649
13650    /// The daily backup configuration for the instance.
13651    pub backup_configuration: std::option::Option<crate::model::BackupConfiguration>,
13652
13653    /// Configuration specific to read replica instances. Indicates whether
13654    /// replication is enabled or not. WARNING: Changing this restarts the
13655    /// instance.
13656    pub database_replication_enabled: std::option::Option<wkt::BoolValue>,
13657
13658    /// Configuration specific to read replica instances. Indicates whether
13659    /// database flags for crash-safe replication are enabled. This property was
13660    /// only applicable to First Generation instances.
13661    #[deprecated]
13662    pub crash_safe_replication_enabled: std::option::Option<wkt::BoolValue>,
13663
13664    /// The size of data disk, in GB. The data disk size minimum is 10GB.
13665    pub data_disk_size_gb: std::option::Option<wkt::Int64Value>,
13666
13667    /// Active Directory configuration, relevant only for Cloud SQL for SQL Server.
13668    pub active_directory_config: std::option::Option<crate::model::SqlActiveDirectoryConfig>,
13669
13670    /// The name of server Instance collation.
13671    pub collation: std::string::String,
13672
13673    /// Deny maintenance periods
13674    pub deny_maintenance_periods: std::vec::Vec<crate::model::DenyMaintenancePeriod>,
13675
13676    /// Insights configuration, for now relevant only for Postgres.
13677    pub insights_config: std::option::Option<crate::model::InsightsConfig>,
13678
13679    /// The local user password validation policy of the instance.
13680    pub password_validation_policy: std::option::Option<crate::model::PasswordValidationPolicy>,
13681
13682    /// SQL Server specific audit configuration.
13683    pub sql_server_audit_config: std::option::Option<crate::model::SqlServerAuditConfig>,
13684
13685    /// Optional. The edition of the instance.
13686    pub edition: crate::model::settings::Edition,
13687
13688    /// Specifies if connections must use Cloud SQL connectors.
13689    /// Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
13690    /// can be connected without Cloud SQL
13691    /// Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
13692    /// Connectors).
13693    ///
13694    /// Note that using REQUIRED disables all existing authorized networks. If
13695    /// this field is not specified when creating a new instance, NOT_REQUIRED is
13696    /// used. If this field is not specified when patching or updating an existing
13697    /// instance, it is left unchanged in the instance.
13698    pub connector_enforcement: crate::model::settings::ConnectorEnforcement,
13699
13700    /// Configuration to protect against accidental instance deletion.
13701    pub deletion_protection_enabled: std::option::Option<wkt::BoolValue>,
13702
13703    /// Server timezone, relevant only for Cloud SQL for SQL Server.
13704    pub time_zone: std::string::String,
13705
13706    /// Specifies advanced machine configuration for the instances relevant only
13707    /// for SQL Server.
13708    pub advanced_machine_features: std::option::Option<crate::model::AdvancedMachineFeatures>,
13709
13710    /// Configuration for data cache.
13711    pub data_cache_config: std::option::Option<crate::model::DataCacheConfig>,
13712
13713    /// Optional. When this parameter is set to true, Cloud SQL instances can
13714    /// connect to Vertex AI to pass requests for real-time predictions and
13715    /// insights to the AI. The default value is false. This applies only to Cloud
13716    /// SQL for PostgreSQL instances.
13717    pub enable_google_ml_integration: std::option::Option<wkt::BoolValue>,
13718
13719    /// Optional. By default, Cloud SQL instances have schema extraction disabled
13720    /// for Dataplex. When this parameter is set to true, schema extraction for
13721    /// Dataplex on Cloud SQL instances is activated.
13722    pub enable_dataplex_integration: std::option::Option<wkt::BoolValue>,
13723
13724    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13725}
13726
13727impl Settings {
13728    pub fn new() -> Self {
13729        std::default::Default::default()
13730    }
13731
13732    /// Sets the value of [settings_version][crate::model::Settings::settings_version].
13733    pub fn set_settings_version<T>(mut self, v: T) -> Self
13734    where
13735        T: std::convert::Into<wkt::Int64Value>,
13736    {
13737        self.settings_version = std::option::Option::Some(v.into());
13738        self
13739    }
13740
13741    /// Sets or clears the value of [settings_version][crate::model::Settings::settings_version].
13742    pub fn set_or_clear_settings_version<T>(mut self, v: std::option::Option<T>) -> Self
13743    where
13744        T: std::convert::Into<wkt::Int64Value>,
13745    {
13746        self.settings_version = v.map(|x| x.into());
13747        self
13748    }
13749
13750    /// Sets the value of [authorized_gae_applications][crate::model::Settings::authorized_gae_applications].
13751    #[deprecated]
13752    pub fn set_authorized_gae_applications<T, V>(mut self, v: T) -> Self
13753    where
13754        T: std::iter::IntoIterator<Item = V>,
13755        V: std::convert::Into<std::string::String>,
13756    {
13757        use std::iter::Iterator;
13758        self.authorized_gae_applications = v.into_iter().map(|i| i.into()).collect();
13759        self
13760    }
13761
13762    /// Sets the value of [tier][crate::model::Settings::tier].
13763    pub fn set_tier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13764        self.tier = v.into();
13765        self
13766    }
13767
13768    /// Sets the value of [kind][crate::model::Settings::kind].
13769    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13770        self.kind = v.into();
13771        self
13772    }
13773
13774    /// Sets the value of [user_labels][crate::model::Settings::user_labels].
13775    pub fn set_user_labels<T, K, V>(mut self, v: T) -> Self
13776    where
13777        T: std::iter::IntoIterator<Item = (K, V)>,
13778        K: std::convert::Into<std::string::String>,
13779        V: std::convert::Into<std::string::String>,
13780    {
13781        use std::iter::Iterator;
13782        self.user_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13783        self
13784    }
13785
13786    /// Sets the value of [availability_type][crate::model::Settings::availability_type].
13787    pub fn set_availability_type<T: std::convert::Into<crate::model::SqlAvailabilityType>>(
13788        mut self,
13789        v: T,
13790    ) -> Self {
13791        self.availability_type = v.into();
13792        self
13793    }
13794
13795    /// Sets the value of [pricing_plan][crate::model::Settings::pricing_plan].
13796    pub fn set_pricing_plan<T: std::convert::Into<crate::model::SqlPricingPlan>>(
13797        mut self,
13798        v: T,
13799    ) -> Self {
13800        self.pricing_plan = v.into();
13801        self
13802    }
13803
13804    /// Sets the value of [replication_type][crate::model::Settings::replication_type].
13805    #[deprecated]
13806    pub fn set_replication_type<T: std::convert::Into<crate::model::SqlReplicationType>>(
13807        mut self,
13808        v: T,
13809    ) -> Self {
13810        self.replication_type = v.into();
13811        self
13812    }
13813
13814    /// Sets the value of [storage_auto_resize_limit][crate::model::Settings::storage_auto_resize_limit].
13815    pub fn set_storage_auto_resize_limit<T>(mut self, v: T) -> Self
13816    where
13817        T: std::convert::Into<wkt::Int64Value>,
13818    {
13819        self.storage_auto_resize_limit = std::option::Option::Some(v.into());
13820        self
13821    }
13822
13823    /// Sets or clears the value of [storage_auto_resize_limit][crate::model::Settings::storage_auto_resize_limit].
13824    pub fn set_or_clear_storage_auto_resize_limit<T>(mut self, v: std::option::Option<T>) -> Self
13825    where
13826        T: std::convert::Into<wkt::Int64Value>,
13827    {
13828        self.storage_auto_resize_limit = v.map(|x| x.into());
13829        self
13830    }
13831
13832    /// Sets the value of [activation_policy][crate::model::Settings::activation_policy].
13833    pub fn set_activation_policy<
13834        T: std::convert::Into<crate::model::settings::SqlActivationPolicy>,
13835    >(
13836        mut self,
13837        v: T,
13838    ) -> Self {
13839        self.activation_policy = v.into();
13840        self
13841    }
13842
13843    /// Sets the value of [ip_configuration][crate::model::Settings::ip_configuration].
13844    pub fn set_ip_configuration<T>(mut self, v: T) -> Self
13845    where
13846        T: std::convert::Into<crate::model::IpConfiguration>,
13847    {
13848        self.ip_configuration = std::option::Option::Some(v.into());
13849        self
13850    }
13851
13852    /// Sets or clears the value of [ip_configuration][crate::model::Settings::ip_configuration].
13853    pub fn set_or_clear_ip_configuration<T>(mut self, v: std::option::Option<T>) -> Self
13854    where
13855        T: std::convert::Into<crate::model::IpConfiguration>,
13856    {
13857        self.ip_configuration = v.map(|x| x.into());
13858        self
13859    }
13860
13861    /// Sets the value of [storage_auto_resize][crate::model::Settings::storage_auto_resize].
13862    pub fn set_storage_auto_resize<T>(mut self, v: T) -> Self
13863    where
13864        T: std::convert::Into<wkt::BoolValue>,
13865    {
13866        self.storage_auto_resize = std::option::Option::Some(v.into());
13867        self
13868    }
13869
13870    /// Sets or clears the value of [storage_auto_resize][crate::model::Settings::storage_auto_resize].
13871    pub fn set_or_clear_storage_auto_resize<T>(mut self, v: std::option::Option<T>) -> Self
13872    where
13873        T: std::convert::Into<wkt::BoolValue>,
13874    {
13875        self.storage_auto_resize = v.map(|x| x.into());
13876        self
13877    }
13878
13879    /// Sets the value of [location_preference][crate::model::Settings::location_preference].
13880    pub fn set_location_preference<T>(mut self, v: T) -> Self
13881    where
13882        T: std::convert::Into<crate::model::LocationPreference>,
13883    {
13884        self.location_preference = std::option::Option::Some(v.into());
13885        self
13886    }
13887
13888    /// Sets or clears the value of [location_preference][crate::model::Settings::location_preference].
13889    pub fn set_or_clear_location_preference<T>(mut self, v: std::option::Option<T>) -> Self
13890    where
13891        T: std::convert::Into<crate::model::LocationPreference>,
13892    {
13893        self.location_preference = v.map(|x| x.into());
13894        self
13895    }
13896
13897    /// Sets the value of [database_flags][crate::model::Settings::database_flags].
13898    pub fn set_database_flags<T, V>(mut self, v: T) -> Self
13899    where
13900        T: std::iter::IntoIterator<Item = V>,
13901        V: std::convert::Into<crate::model::DatabaseFlags>,
13902    {
13903        use std::iter::Iterator;
13904        self.database_flags = v.into_iter().map(|i| i.into()).collect();
13905        self
13906    }
13907
13908    /// Sets the value of [data_disk_type][crate::model::Settings::data_disk_type].
13909    pub fn set_data_disk_type<T: std::convert::Into<crate::model::SqlDataDiskType>>(
13910        mut self,
13911        v: T,
13912    ) -> Self {
13913        self.data_disk_type = v.into();
13914        self
13915    }
13916
13917    /// Sets the value of [maintenance_window][crate::model::Settings::maintenance_window].
13918    pub fn set_maintenance_window<T>(mut self, v: T) -> Self
13919    where
13920        T: std::convert::Into<crate::model::MaintenanceWindow>,
13921    {
13922        self.maintenance_window = std::option::Option::Some(v.into());
13923        self
13924    }
13925
13926    /// Sets or clears the value of [maintenance_window][crate::model::Settings::maintenance_window].
13927    pub fn set_or_clear_maintenance_window<T>(mut self, v: std::option::Option<T>) -> Self
13928    where
13929        T: std::convert::Into<crate::model::MaintenanceWindow>,
13930    {
13931        self.maintenance_window = v.map(|x| x.into());
13932        self
13933    }
13934
13935    /// Sets the value of [backup_configuration][crate::model::Settings::backup_configuration].
13936    pub fn set_backup_configuration<T>(mut self, v: T) -> Self
13937    where
13938        T: std::convert::Into<crate::model::BackupConfiguration>,
13939    {
13940        self.backup_configuration = std::option::Option::Some(v.into());
13941        self
13942    }
13943
13944    /// Sets or clears the value of [backup_configuration][crate::model::Settings::backup_configuration].
13945    pub fn set_or_clear_backup_configuration<T>(mut self, v: std::option::Option<T>) -> Self
13946    where
13947        T: std::convert::Into<crate::model::BackupConfiguration>,
13948    {
13949        self.backup_configuration = v.map(|x| x.into());
13950        self
13951    }
13952
13953    /// Sets the value of [database_replication_enabled][crate::model::Settings::database_replication_enabled].
13954    pub fn set_database_replication_enabled<T>(mut self, v: T) -> Self
13955    where
13956        T: std::convert::Into<wkt::BoolValue>,
13957    {
13958        self.database_replication_enabled = std::option::Option::Some(v.into());
13959        self
13960    }
13961
13962    /// Sets or clears the value of [database_replication_enabled][crate::model::Settings::database_replication_enabled].
13963    pub fn set_or_clear_database_replication_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13964    where
13965        T: std::convert::Into<wkt::BoolValue>,
13966    {
13967        self.database_replication_enabled = v.map(|x| x.into());
13968        self
13969    }
13970
13971    /// Sets the value of [crash_safe_replication_enabled][crate::model::Settings::crash_safe_replication_enabled].
13972    #[deprecated]
13973    pub fn set_crash_safe_replication_enabled<T>(mut self, v: T) -> Self
13974    where
13975        T: std::convert::Into<wkt::BoolValue>,
13976    {
13977        self.crash_safe_replication_enabled = std::option::Option::Some(v.into());
13978        self
13979    }
13980
13981    /// Sets or clears the value of [crash_safe_replication_enabled][crate::model::Settings::crash_safe_replication_enabled].
13982    #[deprecated]
13983    pub fn set_or_clear_crash_safe_replication_enabled<T>(
13984        mut self,
13985        v: std::option::Option<T>,
13986    ) -> Self
13987    where
13988        T: std::convert::Into<wkt::BoolValue>,
13989    {
13990        self.crash_safe_replication_enabled = v.map(|x| x.into());
13991        self
13992    }
13993
13994    /// Sets the value of [data_disk_size_gb][crate::model::Settings::data_disk_size_gb].
13995    pub fn set_data_disk_size_gb<T>(mut self, v: T) -> Self
13996    where
13997        T: std::convert::Into<wkt::Int64Value>,
13998    {
13999        self.data_disk_size_gb = std::option::Option::Some(v.into());
14000        self
14001    }
14002
14003    /// Sets or clears the value of [data_disk_size_gb][crate::model::Settings::data_disk_size_gb].
14004    pub fn set_or_clear_data_disk_size_gb<T>(mut self, v: std::option::Option<T>) -> Self
14005    where
14006        T: std::convert::Into<wkt::Int64Value>,
14007    {
14008        self.data_disk_size_gb = v.map(|x| x.into());
14009        self
14010    }
14011
14012    /// Sets the value of [active_directory_config][crate::model::Settings::active_directory_config].
14013    pub fn set_active_directory_config<T>(mut self, v: T) -> Self
14014    where
14015        T: std::convert::Into<crate::model::SqlActiveDirectoryConfig>,
14016    {
14017        self.active_directory_config = std::option::Option::Some(v.into());
14018        self
14019    }
14020
14021    /// Sets or clears the value of [active_directory_config][crate::model::Settings::active_directory_config].
14022    pub fn set_or_clear_active_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
14023    where
14024        T: std::convert::Into<crate::model::SqlActiveDirectoryConfig>,
14025    {
14026        self.active_directory_config = v.map(|x| x.into());
14027        self
14028    }
14029
14030    /// Sets the value of [collation][crate::model::Settings::collation].
14031    pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14032        self.collation = v.into();
14033        self
14034    }
14035
14036    /// Sets the value of [deny_maintenance_periods][crate::model::Settings::deny_maintenance_periods].
14037    pub fn set_deny_maintenance_periods<T, V>(mut self, v: T) -> Self
14038    where
14039        T: std::iter::IntoIterator<Item = V>,
14040        V: std::convert::Into<crate::model::DenyMaintenancePeriod>,
14041    {
14042        use std::iter::Iterator;
14043        self.deny_maintenance_periods = v.into_iter().map(|i| i.into()).collect();
14044        self
14045    }
14046
14047    /// Sets the value of [insights_config][crate::model::Settings::insights_config].
14048    pub fn set_insights_config<T>(mut self, v: T) -> Self
14049    where
14050        T: std::convert::Into<crate::model::InsightsConfig>,
14051    {
14052        self.insights_config = std::option::Option::Some(v.into());
14053        self
14054    }
14055
14056    /// Sets or clears the value of [insights_config][crate::model::Settings::insights_config].
14057    pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
14058    where
14059        T: std::convert::Into<crate::model::InsightsConfig>,
14060    {
14061        self.insights_config = v.map(|x| x.into());
14062        self
14063    }
14064
14065    /// Sets the value of [password_validation_policy][crate::model::Settings::password_validation_policy].
14066    pub fn set_password_validation_policy<T>(mut self, v: T) -> Self
14067    where
14068        T: std::convert::Into<crate::model::PasswordValidationPolicy>,
14069    {
14070        self.password_validation_policy = std::option::Option::Some(v.into());
14071        self
14072    }
14073
14074    /// Sets or clears the value of [password_validation_policy][crate::model::Settings::password_validation_policy].
14075    pub fn set_or_clear_password_validation_policy<T>(mut self, v: std::option::Option<T>) -> Self
14076    where
14077        T: std::convert::Into<crate::model::PasswordValidationPolicy>,
14078    {
14079        self.password_validation_policy = v.map(|x| x.into());
14080        self
14081    }
14082
14083    /// Sets the value of [sql_server_audit_config][crate::model::Settings::sql_server_audit_config].
14084    pub fn set_sql_server_audit_config<T>(mut self, v: T) -> Self
14085    where
14086        T: std::convert::Into<crate::model::SqlServerAuditConfig>,
14087    {
14088        self.sql_server_audit_config = std::option::Option::Some(v.into());
14089        self
14090    }
14091
14092    /// Sets or clears the value of [sql_server_audit_config][crate::model::Settings::sql_server_audit_config].
14093    pub fn set_or_clear_sql_server_audit_config<T>(mut self, v: std::option::Option<T>) -> Self
14094    where
14095        T: std::convert::Into<crate::model::SqlServerAuditConfig>,
14096    {
14097        self.sql_server_audit_config = v.map(|x| x.into());
14098        self
14099    }
14100
14101    /// Sets the value of [edition][crate::model::Settings::edition].
14102    pub fn set_edition<T: std::convert::Into<crate::model::settings::Edition>>(
14103        mut self,
14104        v: T,
14105    ) -> Self {
14106        self.edition = v.into();
14107        self
14108    }
14109
14110    /// Sets the value of [connector_enforcement][crate::model::Settings::connector_enforcement].
14111    pub fn set_connector_enforcement<
14112        T: std::convert::Into<crate::model::settings::ConnectorEnforcement>,
14113    >(
14114        mut self,
14115        v: T,
14116    ) -> Self {
14117        self.connector_enforcement = v.into();
14118        self
14119    }
14120
14121    /// Sets the value of [deletion_protection_enabled][crate::model::Settings::deletion_protection_enabled].
14122    pub fn set_deletion_protection_enabled<T>(mut self, v: T) -> Self
14123    where
14124        T: std::convert::Into<wkt::BoolValue>,
14125    {
14126        self.deletion_protection_enabled = std::option::Option::Some(v.into());
14127        self
14128    }
14129
14130    /// Sets or clears the value of [deletion_protection_enabled][crate::model::Settings::deletion_protection_enabled].
14131    pub fn set_or_clear_deletion_protection_enabled<T>(mut self, v: std::option::Option<T>) -> Self
14132    where
14133        T: std::convert::Into<wkt::BoolValue>,
14134    {
14135        self.deletion_protection_enabled = v.map(|x| x.into());
14136        self
14137    }
14138
14139    /// Sets the value of [time_zone][crate::model::Settings::time_zone].
14140    pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14141        self.time_zone = v.into();
14142        self
14143    }
14144
14145    /// Sets the value of [advanced_machine_features][crate::model::Settings::advanced_machine_features].
14146    pub fn set_advanced_machine_features<T>(mut self, v: T) -> Self
14147    where
14148        T: std::convert::Into<crate::model::AdvancedMachineFeatures>,
14149    {
14150        self.advanced_machine_features = std::option::Option::Some(v.into());
14151        self
14152    }
14153
14154    /// Sets or clears the value of [advanced_machine_features][crate::model::Settings::advanced_machine_features].
14155    pub fn set_or_clear_advanced_machine_features<T>(mut self, v: std::option::Option<T>) -> Self
14156    where
14157        T: std::convert::Into<crate::model::AdvancedMachineFeatures>,
14158    {
14159        self.advanced_machine_features = v.map(|x| x.into());
14160        self
14161    }
14162
14163    /// Sets the value of [data_cache_config][crate::model::Settings::data_cache_config].
14164    pub fn set_data_cache_config<T>(mut self, v: T) -> Self
14165    where
14166        T: std::convert::Into<crate::model::DataCacheConfig>,
14167    {
14168        self.data_cache_config = std::option::Option::Some(v.into());
14169        self
14170    }
14171
14172    /// Sets or clears the value of [data_cache_config][crate::model::Settings::data_cache_config].
14173    pub fn set_or_clear_data_cache_config<T>(mut self, v: std::option::Option<T>) -> Self
14174    where
14175        T: std::convert::Into<crate::model::DataCacheConfig>,
14176    {
14177        self.data_cache_config = v.map(|x| x.into());
14178        self
14179    }
14180
14181    /// Sets the value of [enable_google_ml_integration][crate::model::Settings::enable_google_ml_integration].
14182    pub fn set_enable_google_ml_integration<T>(mut self, v: T) -> Self
14183    where
14184        T: std::convert::Into<wkt::BoolValue>,
14185    {
14186        self.enable_google_ml_integration = std::option::Option::Some(v.into());
14187        self
14188    }
14189
14190    /// Sets or clears the value of [enable_google_ml_integration][crate::model::Settings::enable_google_ml_integration].
14191    pub fn set_or_clear_enable_google_ml_integration<T>(mut self, v: std::option::Option<T>) -> Self
14192    where
14193        T: std::convert::Into<wkt::BoolValue>,
14194    {
14195        self.enable_google_ml_integration = v.map(|x| x.into());
14196        self
14197    }
14198
14199    /// Sets the value of [enable_dataplex_integration][crate::model::Settings::enable_dataplex_integration].
14200    pub fn set_enable_dataplex_integration<T>(mut self, v: T) -> Self
14201    where
14202        T: std::convert::Into<wkt::BoolValue>,
14203    {
14204        self.enable_dataplex_integration = std::option::Option::Some(v.into());
14205        self
14206    }
14207
14208    /// Sets or clears the value of [enable_dataplex_integration][crate::model::Settings::enable_dataplex_integration].
14209    pub fn set_or_clear_enable_dataplex_integration<T>(mut self, v: std::option::Option<T>) -> Self
14210    where
14211        T: std::convert::Into<wkt::BoolValue>,
14212    {
14213        self.enable_dataplex_integration = v.map(|x| x.into());
14214        self
14215    }
14216}
14217
14218impl wkt::message::Message for Settings {
14219    fn typename() -> &'static str {
14220        "type.googleapis.com/google.cloud.sql.v1.Settings"
14221    }
14222}
14223
14224/// Defines additional types related to [Settings].
14225pub mod settings {
14226    #[allow(unused_imports)]
14227    use super::*;
14228
14229    /// Specifies when the instance is activated.
14230    ///
14231    /// # Working with unknown values
14232    ///
14233    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14234    /// additional enum variants at any time. Adding new variants is not considered
14235    /// a breaking change. Applications should write their code in anticipation of:
14236    ///
14237    /// - New values appearing in future releases of the client library, **and**
14238    /// - New values received dynamically, without application changes.
14239    ///
14240    /// Please consult the [Working with enums] section in the user guide for some
14241    /// guidelines.
14242    ///
14243    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14244    #[derive(Clone, Debug, PartialEq)]
14245    #[non_exhaustive]
14246    pub enum SqlActivationPolicy {
14247        /// Unknown activation plan.
14248        Unspecified,
14249        /// The instance is always up and running.
14250        Always,
14251        /// The instance never starts.
14252        Never,
14253        /// The instance starts upon receiving requests.
14254        #[deprecated]
14255        OnDemand,
14256        /// If set, the enum was initialized with an unknown value.
14257        ///
14258        /// Applications can examine the value using [SqlActivationPolicy::value] or
14259        /// [SqlActivationPolicy::name].
14260        UnknownValue(sql_activation_policy::UnknownValue),
14261    }
14262
14263    #[doc(hidden)]
14264    pub mod sql_activation_policy {
14265        #[allow(unused_imports)]
14266        use super::*;
14267        #[derive(Clone, Debug, PartialEq)]
14268        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14269    }
14270
14271    impl SqlActivationPolicy {
14272        /// Gets the enum value.
14273        ///
14274        /// Returns `None` if the enum contains an unknown value deserialized from
14275        /// the string representation of enums.
14276        pub fn value(&self) -> std::option::Option<i32> {
14277            match self {
14278                Self::Unspecified => std::option::Option::Some(0),
14279                Self::Always => std::option::Option::Some(1),
14280                Self::Never => std::option::Option::Some(2),
14281                Self::OnDemand => std::option::Option::Some(3),
14282                Self::UnknownValue(u) => u.0.value(),
14283            }
14284        }
14285
14286        /// Gets the enum value as a string.
14287        ///
14288        /// Returns `None` if the enum contains an unknown value deserialized from
14289        /// the integer representation of enums.
14290        pub fn name(&self) -> std::option::Option<&str> {
14291            match self {
14292                Self::Unspecified => std::option::Option::Some("SQL_ACTIVATION_POLICY_UNSPECIFIED"),
14293                Self::Always => std::option::Option::Some("ALWAYS"),
14294                Self::Never => std::option::Option::Some("NEVER"),
14295                Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
14296                Self::UnknownValue(u) => u.0.name(),
14297            }
14298        }
14299    }
14300
14301    impl std::default::Default for SqlActivationPolicy {
14302        fn default() -> Self {
14303            use std::convert::From;
14304            Self::from(0)
14305        }
14306    }
14307
14308    impl std::fmt::Display for SqlActivationPolicy {
14309        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14310            wkt::internal::display_enum(f, self.name(), self.value())
14311        }
14312    }
14313
14314    impl std::convert::From<i32> for SqlActivationPolicy {
14315        fn from(value: i32) -> Self {
14316            match value {
14317                0 => Self::Unspecified,
14318                1 => Self::Always,
14319                2 => Self::Never,
14320                3 => Self::OnDemand,
14321                _ => Self::UnknownValue(sql_activation_policy::UnknownValue(
14322                    wkt::internal::UnknownEnumValue::Integer(value),
14323                )),
14324            }
14325        }
14326    }
14327
14328    impl std::convert::From<&str> for SqlActivationPolicy {
14329        fn from(value: &str) -> Self {
14330            use std::string::ToString;
14331            match value {
14332                "SQL_ACTIVATION_POLICY_UNSPECIFIED" => Self::Unspecified,
14333                "ALWAYS" => Self::Always,
14334                "NEVER" => Self::Never,
14335                "ON_DEMAND" => Self::OnDemand,
14336                _ => Self::UnknownValue(sql_activation_policy::UnknownValue(
14337                    wkt::internal::UnknownEnumValue::String(value.to_string()),
14338                )),
14339            }
14340        }
14341    }
14342
14343    impl serde::ser::Serialize for SqlActivationPolicy {
14344        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14345        where
14346            S: serde::Serializer,
14347        {
14348            match self {
14349                Self::Unspecified => serializer.serialize_i32(0),
14350                Self::Always => serializer.serialize_i32(1),
14351                Self::Never => serializer.serialize_i32(2),
14352                Self::OnDemand => serializer.serialize_i32(3),
14353                Self::UnknownValue(u) => u.0.serialize(serializer),
14354            }
14355        }
14356    }
14357
14358    impl<'de> serde::de::Deserialize<'de> for SqlActivationPolicy {
14359        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14360        where
14361            D: serde::Deserializer<'de>,
14362        {
14363            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlActivationPolicy>::new(
14364                ".google.cloud.sql.v1.Settings.SqlActivationPolicy",
14365            ))
14366        }
14367    }
14368
14369    /// The edition of the instance, can be ENTERPRISE or ENTERPRISE_PLUS.
14370    ///
14371    /// # Working with unknown values
14372    ///
14373    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14374    /// additional enum variants at any time. Adding new variants is not considered
14375    /// a breaking change. Applications should write their code in anticipation of:
14376    ///
14377    /// - New values appearing in future releases of the client library, **and**
14378    /// - New values received dynamically, without application changes.
14379    ///
14380    /// Please consult the [Working with enums] section in the user guide for some
14381    /// guidelines.
14382    ///
14383    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14384    #[derive(Clone, Debug, PartialEq)]
14385    #[non_exhaustive]
14386    pub enum Edition {
14387        /// The instance did not specify the edition.
14388        Unspecified,
14389        /// The instance is an enterprise edition.
14390        Enterprise,
14391        /// The instance is an Enterprise Plus edition.
14392        EnterprisePlus,
14393        /// If set, the enum was initialized with an unknown value.
14394        ///
14395        /// Applications can examine the value using [Edition::value] or
14396        /// [Edition::name].
14397        UnknownValue(edition::UnknownValue),
14398    }
14399
14400    #[doc(hidden)]
14401    pub mod edition {
14402        #[allow(unused_imports)]
14403        use super::*;
14404        #[derive(Clone, Debug, PartialEq)]
14405        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14406    }
14407
14408    impl Edition {
14409        /// Gets the enum value.
14410        ///
14411        /// Returns `None` if the enum contains an unknown value deserialized from
14412        /// the string representation of enums.
14413        pub fn value(&self) -> std::option::Option<i32> {
14414            match self {
14415                Self::Unspecified => std::option::Option::Some(0),
14416                Self::Enterprise => std::option::Option::Some(2),
14417                Self::EnterprisePlus => std::option::Option::Some(3),
14418                Self::UnknownValue(u) => u.0.value(),
14419            }
14420        }
14421
14422        /// Gets the enum value as a string.
14423        ///
14424        /// Returns `None` if the enum contains an unknown value deserialized from
14425        /// the integer representation of enums.
14426        pub fn name(&self) -> std::option::Option<&str> {
14427            match self {
14428                Self::Unspecified => std::option::Option::Some("EDITION_UNSPECIFIED"),
14429                Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
14430                Self::EnterprisePlus => std::option::Option::Some("ENTERPRISE_PLUS"),
14431                Self::UnknownValue(u) => u.0.name(),
14432            }
14433        }
14434    }
14435
14436    impl std::default::Default for Edition {
14437        fn default() -> Self {
14438            use std::convert::From;
14439            Self::from(0)
14440        }
14441    }
14442
14443    impl std::fmt::Display for Edition {
14444        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14445            wkt::internal::display_enum(f, self.name(), self.value())
14446        }
14447    }
14448
14449    impl std::convert::From<i32> for Edition {
14450        fn from(value: i32) -> Self {
14451            match value {
14452                0 => Self::Unspecified,
14453                2 => Self::Enterprise,
14454                3 => Self::EnterprisePlus,
14455                _ => Self::UnknownValue(edition::UnknownValue(
14456                    wkt::internal::UnknownEnumValue::Integer(value),
14457                )),
14458            }
14459        }
14460    }
14461
14462    impl std::convert::From<&str> for Edition {
14463        fn from(value: &str) -> Self {
14464            use std::string::ToString;
14465            match value {
14466                "EDITION_UNSPECIFIED" => Self::Unspecified,
14467                "ENTERPRISE" => Self::Enterprise,
14468                "ENTERPRISE_PLUS" => Self::EnterprisePlus,
14469                _ => Self::UnknownValue(edition::UnknownValue(
14470                    wkt::internal::UnknownEnumValue::String(value.to_string()),
14471                )),
14472            }
14473        }
14474    }
14475
14476    impl serde::ser::Serialize for Edition {
14477        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14478        where
14479            S: serde::Serializer,
14480        {
14481            match self {
14482                Self::Unspecified => serializer.serialize_i32(0),
14483                Self::Enterprise => serializer.serialize_i32(2),
14484                Self::EnterprisePlus => serializer.serialize_i32(3),
14485                Self::UnknownValue(u) => u.0.serialize(serializer),
14486            }
14487        }
14488    }
14489
14490    impl<'de> serde::de::Deserialize<'de> for Edition {
14491        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14492        where
14493            D: serde::Deserializer<'de>,
14494        {
14495            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Edition>::new(
14496                ".google.cloud.sql.v1.Settings.Edition",
14497            ))
14498        }
14499    }
14500
14501    /// The options for enforcing Cloud SQL connectors in the instance.
14502    ///
14503    /// # Working with unknown values
14504    ///
14505    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14506    /// additional enum variants at any time. Adding new variants is not considered
14507    /// a breaking change. Applications should write their code in anticipation of:
14508    ///
14509    /// - New values appearing in future releases of the client library, **and**
14510    /// - New values received dynamically, without application changes.
14511    ///
14512    /// Please consult the [Working with enums] section in the user guide for some
14513    /// guidelines.
14514    ///
14515    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14516    #[derive(Clone, Debug, PartialEq)]
14517    #[non_exhaustive]
14518    pub enum ConnectorEnforcement {
14519        /// The requirement for Cloud SQL connectors is unknown.
14520        Unspecified,
14521        /// Do not require Cloud SQL connectors.
14522        NotRequired,
14523        /// Require all connections to use Cloud SQL connectors, including the
14524        /// Cloud SQL Auth Proxy and Cloud SQL Java, Python, and Go connectors.
14525        /// Note: This disables all existing authorized networks.
14526        Required,
14527        /// If set, the enum was initialized with an unknown value.
14528        ///
14529        /// Applications can examine the value using [ConnectorEnforcement::value] or
14530        /// [ConnectorEnforcement::name].
14531        UnknownValue(connector_enforcement::UnknownValue),
14532    }
14533
14534    #[doc(hidden)]
14535    pub mod connector_enforcement {
14536        #[allow(unused_imports)]
14537        use super::*;
14538        #[derive(Clone, Debug, PartialEq)]
14539        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14540    }
14541
14542    impl ConnectorEnforcement {
14543        /// Gets the enum value.
14544        ///
14545        /// Returns `None` if the enum contains an unknown value deserialized from
14546        /// the string representation of enums.
14547        pub fn value(&self) -> std::option::Option<i32> {
14548            match self {
14549                Self::Unspecified => std::option::Option::Some(0),
14550                Self::NotRequired => std::option::Option::Some(1),
14551                Self::Required => std::option::Option::Some(2),
14552                Self::UnknownValue(u) => u.0.value(),
14553            }
14554        }
14555
14556        /// Gets the enum value as a string.
14557        ///
14558        /// Returns `None` if the enum contains an unknown value deserialized from
14559        /// the integer representation of enums.
14560        pub fn name(&self) -> std::option::Option<&str> {
14561            match self {
14562                Self::Unspecified => std::option::Option::Some("CONNECTOR_ENFORCEMENT_UNSPECIFIED"),
14563                Self::NotRequired => std::option::Option::Some("NOT_REQUIRED"),
14564                Self::Required => std::option::Option::Some("REQUIRED"),
14565                Self::UnknownValue(u) => u.0.name(),
14566            }
14567        }
14568    }
14569
14570    impl std::default::Default for ConnectorEnforcement {
14571        fn default() -> Self {
14572            use std::convert::From;
14573            Self::from(0)
14574        }
14575    }
14576
14577    impl std::fmt::Display for ConnectorEnforcement {
14578        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14579            wkt::internal::display_enum(f, self.name(), self.value())
14580        }
14581    }
14582
14583    impl std::convert::From<i32> for ConnectorEnforcement {
14584        fn from(value: i32) -> Self {
14585            match value {
14586                0 => Self::Unspecified,
14587                1 => Self::NotRequired,
14588                2 => Self::Required,
14589                _ => Self::UnknownValue(connector_enforcement::UnknownValue(
14590                    wkt::internal::UnknownEnumValue::Integer(value),
14591                )),
14592            }
14593        }
14594    }
14595
14596    impl std::convert::From<&str> for ConnectorEnforcement {
14597        fn from(value: &str) -> Self {
14598            use std::string::ToString;
14599            match value {
14600                "CONNECTOR_ENFORCEMENT_UNSPECIFIED" => Self::Unspecified,
14601                "NOT_REQUIRED" => Self::NotRequired,
14602                "REQUIRED" => Self::Required,
14603                _ => Self::UnknownValue(connector_enforcement::UnknownValue(
14604                    wkt::internal::UnknownEnumValue::String(value.to_string()),
14605                )),
14606            }
14607        }
14608    }
14609
14610    impl serde::ser::Serialize for ConnectorEnforcement {
14611        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14612        where
14613            S: serde::Serializer,
14614        {
14615            match self {
14616                Self::Unspecified => serializer.serialize_i32(0),
14617                Self::NotRequired => serializer.serialize_i32(1),
14618                Self::Required => serializer.serialize_i32(2),
14619                Self::UnknownValue(u) => u.0.serialize(serializer),
14620            }
14621        }
14622    }
14623
14624    impl<'de> serde::de::Deserialize<'de> for ConnectorEnforcement {
14625        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14626        where
14627            D: serde::Deserializer<'de>,
14628        {
14629            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectorEnforcement>::new(
14630                ".google.cloud.sql.v1.Settings.ConnectorEnforcement",
14631            ))
14632        }
14633    }
14634}
14635
14636/// Specifies options for controlling advanced machine features.
14637#[derive(Clone, Default, PartialEq)]
14638#[non_exhaustive]
14639pub struct AdvancedMachineFeatures {
14640    /// The number of threads per physical core.
14641    pub threads_per_core: i32,
14642
14643    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14644}
14645
14646impl AdvancedMachineFeatures {
14647    pub fn new() -> Self {
14648        std::default::Default::default()
14649    }
14650
14651    /// Sets the value of [threads_per_core][crate::model::AdvancedMachineFeatures::threads_per_core].
14652    pub fn set_threads_per_core<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14653        self.threads_per_core = v.into();
14654        self
14655    }
14656}
14657
14658impl wkt::message::Message for AdvancedMachineFeatures {
14659    fn typename() -> &'static str {
14660        "type.googleapis.com/google.cloud.sql.v1.AdvancedMachineFeatures"
14661    }
14662}
14663
14664/// SslCerts Resource
14665#[derive(Clone, Default, PartialEq)]
14666#[non_exhaustive]
14667pub struct SslCert {
14668    /// This is always `sql#sslCert`.
14669    pub kind: std::string::String,
14670
14671    /// Serial number, as extracted from the certificate.
14672    pub cert_serial_number: std::string::String,
14673
14674    /// PEM representation.
14675    pub cert: std::string::String,
14676
14677    /// The time when the certificate was created in [RFC
14678    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
14679    /// `2012-11-15T16:19:00.094Z`
14680    pub create_time: std::option::Option<wkt::Timestamp>,
14681
14682    /// User supplied name.  Constrained to [a-zA-Z.-_ ]+.
14683    pub common_name: std::string::String,
14684
14685    /// The time when the certificate expires in [RFC
14686    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
14687    /// `2012-11-15T16:19:00.094Z`.
14688    pub expiration_time: std::option::Option<wkt::Timestamp>,
14689
14690    /// Sha1 Fingerprint.
14691    pub sha1_fingerprint: std::string::String,
14692
14693    /// Name of the database instance.
14694    pub instance: std::string::String,
14695
14696    /// The URI of this resource.
14697    pub self_link: std::string::String,
14698
14699    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14700}
14701
14702impl SslCert {
14703    pub fn new() -> Self {
14704        std::default::Default::default()
14705    }
14706
14707    /// Sets the value of [kind][crate::model::SslCert::kind].
14708    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14709        self.kind = v.into();
14710        self
14711    }
14712
14713    /// Sets the value of [cert_serial_number][crate::model::SslCert::cert_serial_number].
14714    pub fn set_cert_serial_number<T: std::convert::Into<std::string::String>>(
14715        mut self,
14716        v: T,
14717    ) -> Self {
14718        self.cert_serial_number = v.into();
14719        self
14720    }
14721
14722    /// Sets the value of [cert][crate::model::SslCert::cert].
14723    pub fn set_cert<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14724        self.cert = v.into();
14725        self
14726    }
14727
14728    /// Sets the value of [create_time][crate::model::SslCert::create_time].
14729    pub fn set_create_time<T>(mut self, v: T) -> Self
14730    where
14731        T: std::convert::Into<wkt::Timestamp>,
14732    {
14733        self.create_time = std::option::Option::Some(v.into());
14734        self
14735    }
14736
14737    /// Sets or clears the value of [create_time][crate::model::SslCert::create_time].
14738    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14739    where
14740        T: std::convert::Into<wkt::Timestamp>,
14741    {
14742        self.create_time = v.map(|x| x.into());
14743        self
14744    }
14745
14746    /// Sets the value of [common_name][crate::model::SslCert::common_name].
14747    pub fn set_common_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14748        self.common_name = v.into();
14749        self
14750    }
14751
14752    /// Sets the value of [expiration_time][crate::model::SslCert::expiration_time].
14753    pub fn set_expiration_time<T>(mut self, v: T) -> Self
14754    where
14755        T: std::convert::Into<wkt::Timestamp>,
14756    {
14757        self.expiration_time = std::option::Option::Some(v.into());
14758        self
14759    }
14760
14761    /// Sets or clears the value of [expiration_time][crate::model::SslCert::expiration_time].
14762    pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
14763    where
14764        T: std::convert::Into<wkt::Timestamp>,
14765    {
14766        self.expiration_time = v.map(|x| x.into());
14767        self
14768    }
14769
14770    /// Sets the value of [sha1_fingerprint][crate::model::SslCert::sha1_fingerprint].
14771    pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
14772        mut self,
14773        v: T,
14774    ) -> Self {
14775        self.sha1_fingerprint = v.into();
14776        self
14777    }
14778
14779    /// Sets the value of [instance][crate::model::SslCert::instance].
14780    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14781        self.instance = v.into();
14782        self
14783    }
14784
14785    /// Sets the value of [self_link][crate::model::SslCert::self_link].
14786    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14787        self.self_link = v.into();
14788        self
14789    }
14790}
14791
14792impl wkt::message::Message for SslCert {
14793    fn typename() -> &'static str {
14794        "type.googleapis.com/google.cloud.sql.v1.SslCert"
14795    }
14796}
14797
14798/// SslCertDetail.
14799#[derive(Clone, Default, PartialEq)]
14800#[non_exhaustive]
14801pub struct SslCertDetail {
14802    /// The public information about the cert.
14803    pub cert_info: std::option::Option<crate::model::SslCert>,
14804
14805    /// The private key for the client cert, in pem format.  Keep private in order
14806    /// to protect your security.
14807    pub cert_private_key: std::string::String,
14808
14809    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14810}
14811
14812impl SslCertDetail {
14813    pub fn new() -> Self {
14814        std::default::Default::default()
14815    }
14816
14817    /// Sets the value of [cert_info][crate::model::SslCertDetail::cert_info].
14818    pub fn set_cert_info<T>(mut self, v: T) -> Self
14819    where
14820        T: std::convert::Into<crate::model::SslCert>,
14821    {
14822        self.cert_info = std::option::Option::Some(v.into());
14823        self
14824    }
14825
14826    /// Sets or clears the value of [cert_info][crate::model::SslCertDetail::cert_info].
14827    pub fn set_or_clear_cert_info<T>(mut self, v: std::option::Option<T>) -> Self
14828    where
14829        T: std::convert::Into<crate::model::SslCert>,
14830    {
14831        self.cert_info = v.map(|x| x.into());
14832        self
14833    }
14834
14835    /// Sets the value of [cert_private_key][crate::model::SslCertDetail::cert_private_key].
14836    pub fn set_cert_private_key<T: std::convert::Into<std::string::String>>(
14837        mut self,
14838        v: T,
14839    ) -> Self {
14840        self.cert_private_key = v.into();
14841        self
14842    }
14843}
14844
14845impl wkt::message::Message for SslCertDetail {
14846    fn typename() -> &'static str {
14847        "type.googleapis.com/google.cloud.sql.v1.SslCertDetail"
14848    }
14849}
14850
14851/// Active Directory configuration, relevant only for Cloud SQL for SQL Server.
14852#[derive(Clone, Default, PartialEq)]
14853#[non_exhaustive]
14854pub struct SqlActiveDirectoryConfig {
14855    /// This is always sql#activeDirectoryConfig.
14856    pub kind: std::string::String,
14857
14858    /// The name of the domain (e.g., mydomain.com).
14859    pub domain: std::string::String,
14860
14861    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14862}
14863
14864impl SqlActiveDirectoryConfig {
14865    pub fn new() -> Self {
14866        std::default::Default::default()
14867    }
14868
14869    /// Sets the value of [kind][crate::model::SqlActiveDirectoryConfig::kind].
14870    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14871        self.kind = v.into();
14872        self
14873    }
14874
14875    /// Sets the value of [domain][crate::model::SqlActiveDirectoryConfig::domain].
14876    pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14877        self.domain = v.into();
14878        self
14879    }
14880}
14881
14882impl wkt::message::Message for SqlActiveDirectoryConfig {
14883    fn typename() -> &'static str {
14884        "type.googleapis.com/google.cloud.sql.v1.SqlActiveDirectoryConfig"
14885    }
14886}
14887
14888/// SQL Server specific audit configuration.
14889#[derive(Clone, Default, PartialEq)]
14890#[non_exhaustive]
14891pub struct SqlServerAuditConfig {
14892    /// This is always sql#sqlServerAuditConfig
14893    pub kind: std::string::String,
14894
14895    /// The name of the destination bucket (e.g., gs://mybucket).
14896    pub bucket: std::string::String,
14897
14898    /// How long to keep generated audit files.
14899    pub retention_interval: std::option::Option<wkt::Duration>,
14900
14901    /// How often to upload generated audit files.
14902    pub upload_interval: std::option::Option<wkt::Duration>,
14903
14904    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14905}
14906
14907impl SqlServerAuditConfig {
14908    pub fn new() -> Self {
14909        std::default::Default::default()
14910    }
14911
14912    /// Sets the value of [kind][crate::model::SqlServerAuditConfig::kind].
14913    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14914        self.kind = v.into();
14915        self
14916    }
14917
14918    /// Sets the value of [bucket][crate::model::SqlServerAuditConfig::bucket].
14919    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14920        self.bucket = v.into();
14921        self
14922    }
14923
14924    /// Sets the value of [retention_interval][crate::model::SqlServerAuditConfig::retention_interval].
14925    pub fn set_retention_interval<T>(mut self, v: T) -> Self
14926    where
14927        T: std::convert::Into<wkt::Duration>,
14928    {
14929        self.retention_interval = std::option::Option::Some(v.into());
14930        self
14931    }
14932
14933    /// Sets or clears the value of [retention_interval][crate::model::SqlServerAuditConfig::retention_interval].
14934    pub fn set_or_clear_retention_interval<T>(mut self, v: std::option::Option<T>) -> Self
14935    where
14936        T: std::convert::Into<wkt::Duration>,
14937    {
14938        self.retention_interval = v.map(|x| x.into());
14939        self
14940    }
14941
14942    /// Sets the value of [upload_interval][crate::model::SqlServerAuditConfig::upload_interval].
14943    pub fn set_upload_interval<T>(mut self, v: T) -> Self
14944    where
14945        T: std::convert::Into<wkt::Duration>,
14946    {
14947        self.upload_interval = std::option::Option::Some(v.into());
14948        self
14949    }
14950
14951    /// Sets or clears the value of [upload_interval][crate::model::SqlServerAuditConfig::upload_interval].
14952    pub fn set_or_clear_upload_interval<T>(mut self, v: std::option::Option<T>) -> Self
14953    where
14954        T: std::convert::Into<wkt::Duration>,
14955    {
14956        self.upload_interval = v.map(|x| x.into());
14957        self
14958    }
14959}
14960
14961impl wkt::message::Message for SqlServerAuditConfig {
14962    fn typename() -> &'static str {
14963        "type.googleapis.com/google.cloud.sql.v1.SqlServerAuditConfig"
14964    }
14965}
14966
14967/// Acquire SSRS lease context.
14968#[derive(Clone, Default, PartialEq)]
14969#[non_exhaustive]
14970pub struct AcquireSsrsLeaseContext {
14971    /// The username to be used as the setup login to connect to the database
14972    /// server for SSRS setup.
14973    pub setup_login: std::option::Option<std::string::String>,
14974
14975    /// The username to be used as the service login to connect to the report
14976    /// database for SSRS setup.
14977    pub service_login: std::option::Option<std::string::String>,
14978
14979    /// The report database to be used for SSRS setup.
14980    pub report_database: std::option::Option<std::string::String>,
14981
14982    /// Lease duration needed for SSRS setup.
14983    pub duration: std::option::Option<wkt::Duration>,
14984
14985    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14986}
14987
14988impl AcquireSsrsLeaseContext {
14989    pub fn new() -> Self {
14990        std::default::Default::default()
14991    }
14992
14993    /// Sets the value of [setup_login][crate::model::AcquireSsrsLeaseContext::setup_login].
14994    pub fn set_setup_login<T>(mut self, v: T) -> Self
14995    where
14996        T: std::convert::Into<std::string::String>,
14997    {
14998        self.setup_login = std::option::Option::Some(v.into());
14999        self
15000    }
15001
15002    /// Sets or clears the value of [setup_login][crate::model::AcquireSsrsLeaseContext::setup_login].
15003    pub fn set_or_clear_setup_login<T>(mut self, v: std::option::Option<T>) -> Self
15004    where
15005        T: std::convert::Into<std::string::String>,
15006    {
15007        self.setup_login = v.map(|x| x.into());
15008        self
15009    }
15010
15011    /// Sets the value of [service_login][crate::model::AcquireSsrsLeaseContext::service_login].
15012    pub fn set_service_login<T>(mut self, v: T) -> Self
15013    where
15014        T: std::convert::Into<std::string::String>,
15015    {
15016        self.service_login = std::option::Option::Some(v.into());
15017        self
15018    }
15019
15020    /// Sets or clears the value of [service_login][crate::model::AcquireSsrsLeaseContext::service_login].
15021    pub fn set_or_clear_service_login<T>(mut self, v: std::option::Option<T>) -> Self
15022    where
15023        T: std::convert::Into<std::string::String>,
15024    {
15025        self.service_login = v.map(|x| x.into());
15026        self
15027    }
15028
15029    /// Sets the value of [report_database][crate::model::AcquireSsrsLeaseContext::report_database].
15030    pub fn set_report_database<T>(mut self, v: T) -> Self
15031    where
15032        T: std::convert::Into<std::string::String>,
15033    {
15034        self.report_database = std::option::Option::Some(v.into());
15035        self
15036    }
15037
15038    /// Sets or clears the value of [report_database][crate::model::AcquireSsrsLeaseContext::report_database].
15039    pub fn set_or_clear_report_database<T>(mut self, v: std::option::Option<T>) -> Self
15040    where
15041        T: std::convert::Into<std::string::String>,
15042    {
15043        self.report_database = v.map(|x| x.into());
15044        self
15045    }
15046
15047    /// Sets the value of [duration][crate::model::AcquireSsrsLeaseContext::duration].
15048    pub fn set_duration<T>(mut self, v: T) -> Self
15049    where
15050        T: std::convert::Into<wkt::Duration>,
15051    {
15052        self.duration = std::option::Option::Some(v.into());
15053        self
15054    }
15055
15056    /// Sets or clears the value of [duration][crate::model::AcquireSsrsLeaseContext::duration].
15057    pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
15058    where
15059        T: std::convert::Into<wkt::Duration>,
15060    {
15061        self.duration = v.map(|x| x.into());
15062        self
15063    }
15064}
15065
15066impl wkt::message::Message for AcquireSsrsLeaseContext {
15067    fn typename() -> &'static str {
15068        "type.googleapis.com/google.cloud.sql.v1.AcquireSsrsLeaseContext"
15069    }
15070}
15071
15072#[derive(Clone, Default, PartialEq)]
15073#[non_exhaustive]
15074pub struct SqlSslCertsDeleteRequest {
15075    /// Cloud SQL instance ID. This does not include the project ID.
15076    pub instance: std::string::String,
15077
15078    /// Project ID of the project that contains the instance.
15079    pub project: std::string::String,
15080
15081    /// Sha1 FingerPrint.
15082    pub sha1_fingerprint: std::string::String,
15083
15084    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15085}
15086
15087impl SqlSslCertsDeleteRequest {
15088    pub fn new() -> Self {
15089        std::default::Default::default()
15090    }
15091
15092    /// Sets the value of [instance][crate::model::SqlSslCertsDeleteRequest::instance].
15093    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15094        self.instance = v.into();
15095        self
15096    }
15097
15098    /// Sets the value of [project][crate::model::SqlSslCertsDeleteRequest::project].
15099    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15100        self.project = v.into();
15101        self
15102    }
15103
15104    /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsDeleteRequest::sha1_fingerprint].
15105    pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
15106        mut self,
15107        v: T,
15108    ) -> Self {
15109        self.sha1_fingerprint = v.into();
15110        self
15111    }
15112}
15113
15114impl wkt::message::Message for SqlSslCertsDeleteRequest {
15115    fn typename() -> &'static str {
15116        "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsDeleteRequest"
15117    }
15118}
15119
15120#[derive(Clone, Default, PartialEq)]
15121#[non_exhaustive]
15122pub struct SqlSslCertsGetRequest {
15123    /// Cloud SQL instance ID. This does not include the project ID.
15124    pub instance: std::string::String,
15125
15126    /// Project ID of the project that contains the instance.
15127    pub project: std::string::String,
15128
15129    /// Sha1 FingerPrint.
15130    pub sha1_fingerprint: std::string::String,
15131
15132    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15133}
15134
15135impl SqlSslCertsGetRequest {
15136    pub fn new() -> Self {
15137        std::default::Default::default()
15138    }
15139
15140    /// Sets the value of [instance][crate::model::SqlSslCertsGetRequest::instance].
15141    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15142        self.instance = v.into();
15143        self
15144    }
15145
15146    /// Sets the value of [project][crate::model::SqlSslCertsGetRequest::project].
15147    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15148        self.project = v.into();
15149        self
15150    }
15151
15152    /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsGetRequest::sha1_fingerprint].
15153    pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
15154        mut self,
15155        v: T,
15156    ) -> Self {
15157        self.sha1_fingerprint = v.into();
15158        self
15159    }
15160}
15161
15162impl wkt::message::Message for SqlSslCertsGetRequest {
15163    fn typename() -> &'static str {
15164        "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsGetRequest"
15165    }
15166}
15167
15168#[derive(Clone, Default, PartialEq)]
15169#[non_exhaustive]
15170pub struct SqlSslCertsInsertRequest {
15171    /// Cloud SQL instance ID. This does not include the project ID.
15172    pub instance: std::string::String,
15173
15174    /// Project ID of the project that contains the instance.
15175    pub project: std::string::String,
15176
15177    pub body: std::option::Option<crate::model::SslCertsInsertRequest>,
15178
15179    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15180}
15181
15182impl SqlSslCertsInsertRequest {
15183    pub fn new() -> Self {
15184        std::default::Default::default()
15185    }
15186
15187    /// Sets the value of [instance][crate::model::SqlSslCertsInsertRequest::instance].
15188    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15189        self.instance = v.into();
15190        self
15191    }
15192
15193    /// Sets the value of [project][crate::model::SqlSslCertsInsertRequest::project].
15194    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15195        self.project = v.into();
15196        self
15197    }
15198
15199    /// Sets the value of [body][crate::model::SqlSslCertsInsertRequest::body].
15200    pub fn set_body<T>(mut self, v: T) -> Self
15201    where
15202        T: std::convert::Into<crate::model::SslCertsInsertRequest>,
15203    {
15204        self.body = std::option::Option::Some(v.into());
15205        self
15206    }
15207
15208    /// Sets or clears the value of [body][crate::model::SqlSslCertsInsertRequest::body].
15209    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
15210    where
15211        T: std::convert::Into<crate::model::SslCertsInsertRequest>,
15212    {
15213        self.body = v.map(|x| x.into());
15214        self
15215    }
15216}
15217
15218impl wkt::message::Message for SqlSslCertsInsertRequest {
15219    fn typename() -> &'static str {
15220        "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsInsertRequest"
15221    }
15222}
15223
15224#[derive(Clone, Default, PartialEq)]
15225#[non_exhaustive]
15226pub struct SqlSslCertsListRequest {
15227    /// Cloud SQL instance ID. This does not include the project ID.
15228    pub instance: std::string::String,
15229
15230    /// Project ID of the project that contains the instance.
15231    pub project: std::string::String,
15232
15233    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15234}
15235
15236impl SqlSslCertsListRequest {
15237    pub fn new() -> Self {
15238        std::default::Default::default()
15239    }
15240
15241    /// Sets the value of [instance][crate::model::SqlSslCertsListRequest::instance].
15242    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15243        self.instance = v.into();
15244        self
15245    }
15246
15247    /// Sets the value of [project][crate::model::SqlSslCertsListRequest::project].
15248    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15249        self.project = v.into();
15250        self
15251    }
15252}
15253
15254impl wkt::message::Message for SqlSslCertsListRequest {
15255    fn typename() -> &'static str {
15256        "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsListRequest"
15257    }
15258}
15259
15260/// SslCerts insert request.
15261#[derive(Clone, Default, PartialEq)]
15262#[non_exhaustive]
15263pub struct SslCertsInsertRequest {
15264    /// User supplied name.  Must be a distinct name from the other certificates
15265    /// for this instance.
15266    pub common_name: std::string::String,
15267
15268    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15269}
15270
15271impl SslCertsInsertRequest {
15272    pub fn new() -> Self {
15273        std::default::Default::default()
15274    }
15275
15276    /// Sets the value of [common_name][crate::model::SslCertsInsertRequest::common_name].
15277    pub fn set_common_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15278        self.common_name = v.into();
15279        self
15280    }
15281}
15282
15283impl wkt::message::Message for SslCertsInsertRequest {
15284    fn typename() -> &'static str {
15285        "type.googleapis.com/google.cloud.sql.v1.SslCertsInsertRequest"
15286    }
15287}
15288
15289/// SslCert insert response.
15290#[derive(Clone, Default, PartialEq)]
15291#[non_exhaustive]
15292pub struct SslCertsInsertResponse {
15293    /// This is always `sql#sslCertsInsert`.
15294    pub kind: std::string::String,
15295
15296    /// The operation to track the ssl certs insert request.
15297    pub operation: std::option::Option<crate::model::Operation>,
15298
15299    /// The server Certificate Authority's certificate.  If this is missing you can
15300    /// force a new one to be generated by calling resetSslConfig method on
15301    /// instances resource.
15302    pub server_ca_cert: std::option::Option<crate::model::SslCert>,
15303
15304    /// The new client certificate and private key.
15305    pub client_cert: std::option::Option<crate::model::SslCertDetail>,
15306
15307    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15308}
15309
15310impl SslCertsInsertResponse {
15311    pub fn new() -> Self {
15312        std::default::Default::default()
15313    }
15314
15315    /// Sets the value of [kind][crate::model::SslCertsInsertResponse::kind].
15316    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15317        self.kind = v.into();
15318        self
15319    }
15320
15321    /// Sets the value of [operation][crate::model::SslCertsInsertResponse::operation].
15322    pub fn set_operation<T>(mut self, v: T) -> Self
15323    where
15324        T: std::convert::Into<crate::model::Operation>,
15325    {
15326        self.operation = std::option::Option::Some(v.into());
15327        self
15328    }
15329
15330    /// Sets or clears the value of [operation][crate::model::SslCertsInsertResponse::operation].
15331    pub fn set_or_clear_operation<T>(mut self, v: std::option::Option<T>) -> Self
15332    where
15333        T: std::convert::Into<crate::model::Operation>,
15334    {
15335        self.operation = v.map(|x| x.into());
15336        self
15337    }
15338
15339    /// Sets the value of [server_ca_cert][crate::model::SslCertsInsertResponse::server_ca_cert].
15340    pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
15341    where
15342        T: std::convert::Into<crate::model::SslCert>,
15343    {
15344        self.server_ca_cert = std::option::Option::Some(v.into());
15345        self
15346    }
15347
15348    /// Sets or clears the value of [server_ca_cert][crate::model::SslCertsInsertResponse::server_ca_cert].
15349    pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
15350    where
15351        T: std::convert::Into<crate::model::SslCert>,
15352    {
15353        self.server_ca_cert = v.map(|x| x.into());
15354        self
15355    }
15356
15357    /// Sets the value of [client_cert][crate::model::SslCertsInsertResponse::client_cert].
15358    pub fn set_client_cert<T>(mut self, v: T) -> Self
15359    where
15360        T: std::convert::Into<crate::model::SslCertDetail>,
15361    {
15362        self.client_cert = std::option::Option::Some(v.into());
15363        self
15364    }
15365
15366    /// Sets or clears the value of [client_cert][crate::model::SslCertsInsertResponse::client_cert].
15367    pub fn set_or_clear_client_cert<T>(mut self, v: std::option::Option<T>) -> Self
15368    where
15369        T: std::convert::Into<crate::model::SslCertDetail>,
15370    {
15371        self.client_cert = v.map(|x| x.into());
15372        self
15373    }
15374}
15375
15376impl wkt::message::Message for SslCertsInsertResponse {
15377    fn typename() -> &'static str {
15378        "type.googleapis.com/google.cloud.sql.v1.SslCertsInsertResponse"
15379    }
15380}
15381
15382/// SslCerts list response.
15383#[derive(Clone, Default, PartialEq)]
15384#[non_exhaustive]
15385pub struct SslCertsListResponse {
15386    /// This is always `sql#sslCertsList`.
15387    pub kind: std::string::String,
15388
15389    /// List of client certificates for the instance.
15390    pub items: std::vec::Vec<crate::model::SslCert>,
15391
15392    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15393}
15394
15395impl SslCertsListResponse {
15396    pub fn new() -> Self {
15397        std::default::Default::default()
15398    }
15399
15400    /// Sets the value of [kind][crate::model::SslCertsListResponse::kind].
15401    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15402        self.kind = v.into();
15403        self
15404    }
15405
15406    /// Sets the value of [items][crate::model::SslCertsListResponse::items].
15407    pub fn set_items<T, V>(mut self, v: T) -> Self
15408    where
15409        T: std::iter::IntoIterator<Item = V>,
15410        V: std::convert::Into<crate::model::SslCert>,
15411    {
15412        use std::iter::Iterator;
15413        self.items = v.into_iter().map(|i| i.into()).collect();
15414        self
15415    }
15416}
15417
15418impl wkt::message::Message for SslCertsListResponse {
15419    fn typename() -> &'static str {
15420        "type.googleapis.com/google.cloud.sql.v1.SslCertsListResponse"
15421    }
15422}
15423
15424/// Tiers list request.
15425#[derive(Clone, Default, PartialEq)]
15426#[non_exhaustive]
15427pub struct SqlTiersListRequest {
15428    /// Project ID of the project for which to list tiers.
15429    pub project: std::string::String,
15430
15431    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15432}
15433
15434impl SqlTiersListRequest {
15435    pub fn new() -> Self {
15436        std::default::Default::default()
15437    }
15438
15439    /// Sets the value of [project][crate::model::SqlTiersListRequest::project].
15440    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15441        self.project = v.into();
15442        self
15443    }
15444}
15445
15446impl wkt::message::Message for SqlTiersListRequest {
15447    fn typename() -> &'static str {
15448        "type.googleapis.com/google.cloud.sql.v1.SqlTiersListRequest"
15449    }
15450}
15451
15452/// Tiers list response.
15453#[derive(Clone, Default, PartialEq)]
15454#[non_exhaustive]
15455pub struct TiersListResponse {
15456    /// This is always `sql#tiersList`.
15457    pub kind: std::string::String,
15458
15459    /// List of tiers.
15460    pub items: std::vec::Vec<crate::model::Tier>,
15461
15462    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15463}
15464
15465impl TiersListResponse {
15466    pub fn new() -> Self {
15467        std::default::Default::default()
15468    }
15469
15470    /// Sets the value of [kind][crate::model::TiersListResponse::kind].
15471    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15472        self.kind = v.into();
15473        self
15474    }
15475
15476    /// Sets the value of [items][crate::model::TiersListResponse::items].
15477    pub fn set_items<T, V>(mut self, v: T) -> Self
15478    where
15479        T: std::iter::IntoIterator<Item = V>,
15480        V: std::convert::Into<crate::model::Tier>,
15481    {
15482        use std::iter::Iterator;
15483        self.items = v.into_iter().map(|i| i.into()).collect();
15484        self
15485    }
15486}
15487
15488impl wkt::message::Message for TiersListResponse {
15489    fn typename() -> &'static str {
15490        "type.googleapis.com/google.cloud.sql.v1.TiersListResponse"
15491    }
15492}
15493
15494/// A Google Cloud SQL service tier resource.
15495#[derive(Clone, Default, PartialEq)]
15496#[non_exhaustive]
15497pub struct Tier {
15498    /// An identifier for the machine type, for example, `db-custom-1-3840`. For
15499    /// related information, see [Pricing](/sql/pricing).
15500    pub tier: std::string::String,
15501
15502    /// The maximum RAM usage of this tier in bytes.
15503    pub ram: i64,
15504
15505    /// This is always `sql#tier`.
15506    pub kind: std::string::String,
15507
15508    /// The maximum disk size of this tier in bytes.
15509    pub disk_quota: i64,
15510
15511    /// The applicable regions for this tier.
15512    pub region: std::vec::Vec<std::string::String>,
15513
15514    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15515}
15516
15517impl Tier {
15518    pub fn new() -> Self {
15519        std::default::Default::default()
15520    }
15521
15522    /// Sets the value of [tier][crate::model::Tier::tier].
15523    pub fn set_tier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15524        self.tier = v.into();
15525        self
15526    }
15527
15528    /// Sets the value of [ram][crate::model::Tier::ram].
15529    pub fn set_ram<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
15530        self.ram = v.into();
15531        self
15532    }
15533
15534    /// Sets the value of [kind][crate::model::Tier::kind].
15535    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15536        self.kind = v.into();
15537        self
15538    }
15539
15540    /// Sets the value of [disk_quota][crate::model::Tier::disk_quota].
15541    pub fn set_disk_quota<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
15542        self.disk_quota = v.into();
15543        self
15544    }
15545
15546    /// Sets the value of [region][crate::model::Tier::region].
15547    pub fn set_region<T, V>(mut self, v: T) -> Self
15548    where
15549        T: std::iter::IntoIterator<Item = V>,
15550        V: std::convert::Into<std::string::String>,
15551    {
15552        use std::iter::Iterator;
15553        self.region = v.into_iter().map(|i| i.into()).collect();
15554        self
15555    }
15556}
15557
15558impl wkt::message::Message for Tier {
15559    fn typename() -> &'static str {
15560        "type.googleapis.com/google.cloud.sql.v1.Tier"
15561    }
15562}
15563
15564#[derive(Clone, Default, PartialEq)]
15565#[non_exhaustive]
15566pub struct SqlUsersDeleteRequest {
15567    /// Host of the user in the instance.
15568    pub host: std::string::String,
15569
15570    /// Database instance ID. This does not include the project ID.
15571    pub instance: std::string::String,
15572
15573    /// Name of the user in the instance.
15574    pub name: std::string::String,
15575
15576    /// Project ID of the project that contains the instance.
15577    pub project: std::string::String,
15578
15579    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15580}
15581
15582impl SqlUsersDeleteRequest {
15583    pub fn new() -> Self {
15584        std::default::Default::default()
15585    }
15586
15587    /// Sets the value of [host][crate::model::SqlUsersDeleteRequest::host].
15588    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15589        self.host = v.into();
15590        self
15591    }
15592
15593    /// Sets the value of [instance][crate::model::SqlUsersDeleteRequest::instance].
15594    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15595        self.instance = v.into();
15596        self
15597    }
15598
15599    /// Sets the value of [name][crate::model::SqlUsersDeleteRequest::name].
15600    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15601        self.name = v.into();
15602        self
15603    }
15604
15605    /// Sets the value of [project][crate::model::SqlUsersDeleteRequest::project].
15606    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15607        self.project = v.into();
15608        self
15609    }
15610}
15611
15612impl wkt::message::Message for SqlUsersDeleteRequest {
15613    fn typename() -> &'static str {
15614        "type.googleapis.com/google.cloud.sql.v1.SqlUsersDeleteRequest"
15615    }
15616}
15617
15618/// Request message for Users Get RPC
15619#[derive(Clone, Default, PartialEq)]
15620#[non_exhaustive]
15621pub struct SqlUsersGetRequest {
15622    /// Database instance ID. This does not include the project ID.
15623    pub instance: std::string::String,
15624
15625    /// User of the instance.
15626    pub name: std::string::String,
15627
15628    /// Project ID of the project that contains the instance.
15629    pub project: std::string::String,
15630
15631    /// Host of a user of the instance.
15632    pub host: std::string::String,
15633
15634    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15635}
15636
15637impl SqlUsersGetRequest {
15638    pub fn new() -> Self {
15639        std::default::Default::default()
15640    }
15641
15642    /// Sets the value of [instance][crate::model::SqlUsersGetRequest::instance].
15643    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15644        self.instance = v.into();
15645        self
15646    }
15647
15648    /// Sets the value of [name][crate::model::SqlUsersGetRequest::name].
15649    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15650        self.name = v.into();
15651        self
15652    }
15653
15654    /// Sets the value of [project][crate::model::SqlUsersGetRequest::project].
15655    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15656        self.project = v.into();
15657        self
15658    }
15659
15660    /// Sets the value of [host][crate::model::SqlUsersGetRequest::host].
15661    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15662        self.host = v.into();
15663        self
15664    }
15665}
15666
15667impl wkt::message::Message for SqlUsersGetRequest {
15668    fn typename() -> &'static str {
15669        "type.googleapis.com/google.cloud.sql.v1.SqlUsersGetRequest"
15670    }
15671}
15672
15673#[derive(Clone, Default, PartialEq)]
15674#[non_exhaustive]
15675pub struct SqlUsersInsertRequest {
15676    /// Database instance ID. This does not include the project ID.
15677    pub instance: std::string::String,
15678
15679    /// Project ID of the project that contains the instance.
15680    pub project: std::string::String,
15681
15682    pub body: std::option::Option<crate::model::User>,
15683
15684    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15685}
15686
15687impl SqlUsersInsertRequest {
15688    pub fn new() -> Self {
15689        std::default::Default::default()
15690    }
15691
15692    /// Sets the value of [instance][crate::model::SqlUsersInsertRequest::instance].
15693    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15694        self.instance = v.into();
15695        self
15696    }
15697
15698    /// Sets the value of [project][crate::model::SqlUsersInsertRequest::project].
15699    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15700        self.project = v.into();
15701        self
15702    }
15703
15704    /// Sets the value of [body][crate::model::SqlUsersInsertRequest::body].
15705    pub fn set_body<T>(mut self, v: T) -> Self
15706    where
15707        T: std::convert::Into<crate::model::User>,
15708    {
15709        self.body = std::option::Option::Some(v.into());
15710        self
15711    }
15712
15713    /// Sets or clears the value of [body][crate::model::SqlUsersInsertRequest::body].
15714    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
15715    where
15716        T: std::convert::Into<crate::model::User>,
15717    {
15718        self.body = v.map(|x| x.into());
15719        self
15720    }
15721}
15722
15723impl wkt::message::Message for SqlUsersInsertRequest {
15724    fn typename() -> &'static str {
15725        "type.googleapis.com/google.cloud.sql.v1.SqlUsersInsertRequest"
15726    }
15727}
15728
15729#[derive(Clone, Default, PartialEq)]
15730#[non_exhaustive]
15731pub struct SqlUsersListRequest {
15732    /// Database instance ID. This does not include the project ID.
15733    pub instance: std::string::String,
15734
15735    /// Project ID of the project that contains the instance.
15736    pub project: std::string::String,
15737
15738    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15739}
15740
15741impl SqlUsersListRequest {
15742    pub fn new() -> Self {
15743        std::default::Default::default()
15744    }
15745
15746    /// Sets the value of [instance][crate::model::SqlUsersListRequest::instance].
15747    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15748        self.instance = v.into();
15749        self
15750    }
15751
15752    /// Sets the value of [project][crate::model::SqlUsersListRequest::project].
15753    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15754        self.project = v.into();
15755        self
15756    }
15757}
15758
15759impl wkt::message::Message for SqlUsersListRequest {
15760    fn typename() -> &'static str {
15761        "type.googleapis.com/google.cloud.sql.v1.SqlUsersListRequest"
15762    }
15763}
15764
15765#[derive(Clone, Default, PartialEq)]
15766#[non_exhaustive]
15767pub struct SqlUsersUpdateRequest {
15768    /// Optional. Host of the user in the instance.
15769    pub host: std::string::String,
15770
15771    /// Database instance ID. This does not include the project ID.
15772    pub instance: std::string::String,
15773
15774    /// Name of the user in the instance.
15775    pub name: std::string::String,
15776
15777    /// Project ID of the project that contains the instance.
15778    pub project: std::string::String,
15779
15780    pub body: std::option::Option<crate::model::User>,
15781
15782    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15783}
15784
15785impl SqlUsersUpdateRequest {
15786    pub fn new() -> Self {
15787        std::default::Default::default()
15788    }
15789
15790    /// Sets the value of [host][crate::model::SqlUsersUpdateRequest::host].
15791    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15792        self.host = v.into();
15793        self
15794    }
15795
15796    /// Sets the value of [instance][crate::model::SqlUsersUpdateRequest::instance].
15797    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15798        self.instance = v.into();
15799        self
15800    }
15801
15802    /// Sets the value of [name][crate::model::SqlUsersUpdateRequest::name].
15803    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15804        self.name = v.into();
15805        self
15806    }
15807
15808    /// Sets the value of [project][crate::model::SqlUsersUpdateRequest::project].
15809    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15810        self.project = v.into();
15811        self
15812    }
15813
15814    /// Sets the value of [body][crate::model::SqlUsersUpdateRequest::body].
15815    pub fn set_body<T>(mut self, v: T) -> Self
15816    where
15817        T: std::convert::Into<crate::model::User>,
15818    {
15819        self.body = std::option::Option::Some(v.into());
15820        self
15821    }
15822
15823    /// Sets or clears the value of [body][crate::model::SqlUsersUpdateRequest::body].
15824    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
15825    where
15826        T: std::convert::Into<crate::model::User>,
15827    {
15828        self.body = v.map(|x| x.into());
15829        self
15830    }
15831}
15832
15833impl wkt::message::Message for SqlUsersUpdateRequest {
15834    fn typename() -> &'static str {
15835        "type.googleapis.com/google.cloud.sql.v1.SqlUsersUpdateRequest"
15836    }
15837}
15838
15839/// User level password validation policy.
15840#[derive(Clone, Default, PartialEq)]
15841#[non_exhaustive]
15842pub struct UserPasswordValidationPolicy {
15843    /// Number of failed login attempts allowed before user get locked.
15844    pub allowed_failed_attempts: i32,
15845
15846    /// Expiration duration after password is updated.
15847    pub password_expiration_duration: std::option::Option<wkt::Duration>,
15848
15849    /// If true, failed login attempts check will be enabled.
15850    pub enable_failed_attempts_check: bool,
15851
15852    /// Output only. Read-only password status.
15853    pub status: std::option::Option<crate::model::PasswordStatus>,
15854
15855    /// If true, the user must specify the current password before changing the
15856    /// password. This flag is supported only for MySQL.
15857    pub enable_password_verification: bool,
15858
15859    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15860}
15861
15862impl UserPasswordValidationPolicy {
15863    pub fn new() -> Self {
15864        std::default::Default::default()
15865    }
15866
15867    /// Sets the value of [allowed_failed_attempts][crate::model::UserPasswordValidationPolicy::allowed_failed_attempts].
15868    pub fn set_allowed_failed_attempts<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15869        self.allowed_failed_attempts = v.into();
15870        self
15871    }
15872
15873    /// Sets the value of [password_expiration_duration][crate::model::UserPasswordValidationPolicy::password_expiration_duration].
15874    pub fn set_password_expiration_duration<T>(mut self, v: T) -> Self
15875    where
15876        T: std::convert::Into<wkt::Duration>,
15877    {
15878        self.password_expiration_duration = std::option::Option::Some(v.into());
15879        self
15880    }
15881
15882    /// Sets or clears the value of [password_expiration_duration][crate::model::UserPasswordValidationPolicy::password_expiration_duration].
15883    pub fn set_or_clear_password_expiration_duration<T>(mut self, v: std::option::Option<T>) -> Self
15884    where
15885        T: std::convert::Into<wkt::Duration>,
15886    {
15887        self.password_expiration_duration = v.map(|x| x.into());
15888        self
15889    }
15890
15891    /// Sets the value of [enable_failed_attempts_check][crate::model::UserPasswordValidationPolicy::enable_failed_attempts_check].
15892    pub fn set_enable_failed_attempts_check<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15893        self.enable_failed_attempts_check = v.into();
15894        self
15895    }
15896
15897    /// Sets the value of [status][crate::model::UserPasswordValidationPolicy::status].
15898    pub fn set_status<T>(mut self, v: T) -> Self
15899    where
15900        T: std::convert::Into<crate::model::PasswordStatus>,
15901    {
15902        self.status = std::option::Option::Some(v.into());
15903        self
15904    }
15905
15906    /// Sets or clears the value of [status][crate::model::UserPasswordValidationPolicy::status].
15907    pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
15908    where
15909        T: std::convert::Into<crate::model::PasswordStatus>,
15910    {
15911        self.status = v.map(|x| x.into());
15912        self
15913    }
15914
15915    /// Sets the value of [enable_password_verification][crate::model::UserPasswordValidationPolicy::enable_password_verification].
15916    pub fn set_enable_password_verification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15917        self.enable_password_verification = v.into();
15918        self
15919    }
15920}
15921
15922impl wkt::message::Message for UserPasswordValidationPolicy {
15923    fn typename() -> &'static str {
15924        "type.googleapis.com/google.cloud.sql.v1.UserPasswordValidationPolicy"
15925    }
15926}
15927
15928/// Read-only password status.
15929#[derive(Clone, Default, PartialEq)]
15930#[non_exhaustive]
15931pub struct PasswordStatus {
15932    /// If true, user does not have login privileges.
15933    pub locked: bool,
15934
15935    /// The expiration time of the current password.
15936    pub password_expiration_time: std::option::Option<wkt::Timestamp>,
15937
15938    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15939}
15940
15941impl PasswordStatus {
15942    pub fn new() -> Self {
15943        std::default::Default::default()
15944    }
15945
15946    /// Sets the value of [locked][crate::model::PasswordStatus::locked].
15947    pub fn set_locked<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15948        self.locked = v.into();
15949        self
15950    }
15951
15952    /// Sets the value of [password_expiration_time][crate::model::PasswordStatus::password_expiration_time].
15953    pub fn set_password_expiration_time<T>(mut self, v: T) -> Self
15954    where
15955        T: std::convert::Into<wkt::Timestamp>,
15956    {
15957        self.password_expiration_time = std::option::Option::Some(v.into());
15958        self
15959    }
15960
15961    /// Sets or clears the value of [password_expiration_time][crate::model::PasswordStatus::password_expiration_time].
15962    pub fn set_or_clear_password_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
15963    where
15964        T: std::convert::Into<wkt::Timestamp>,
15965    {
15966        self.password_expiration_time = v.map(|x| x.into());
15967        self
15968    }
15969}
15970
15971impl wkt::message::Message for PasswordStatus {
15972    fn typename() -> &'static str {
15973        "type.googleapis.com/google.cloud.sql.v1.PasswordStatus"
15974    }
15975}
15976
15977/// A Cloud SQL user resource.
15978#[derive(Clone, Default, PartialEq)]
15979#[non_exhaustive]
15980pub struct User {
15981    /// This is always `sql#user`.
15982    pub kind: std::string::String,
15983
15984    /// The password for the user.
15985    pub password: std::string::String,
15986
15987    /// This field is deprecated and will be removed from a future version of the
15988    /// API.
15989    pub etag: std::string::String,
15990
15991    /// The name of the user in the Cloud SQL instance. Can be omitted for
15992    /// `update` because it is already specified in the URL.
15993    pub name: std::string::String,
15994
15995    /// Optional. The host from which the user can connect. For `insert`
15996    /// operations, host defaults to an empty string. For `update`
15997    /// operations, host is specified as part of the request URL. The host name
15998    /// cannot be updated after insertion.  For a MySQL instance, it's required;
15999    /// for a PostgreSQL or SQL Server instance, it's optional.
16000    pub host: std::string::String,
16001
16002    /// The name of the Cloud SQL instance. This does not include the project ID.
16003    /// Can be omitted for `update` because it is already specified on the
16004    /// URL.
16005    pub instance: std::string::String,
16006
16007    /// The project ID of the project containing the Cloud SQL database. The Google
16008    /// apps domain is prefixed if applicable. Can be omitted for `update` because
16009    /// it is already specified on the URL.
16010    pub project: std::string::String,
16011
16012    /// The user type. It determines the method to authenticate the user during
16013    /// login. The default is the database's built-in user type.
16014    pub r#type: crate::model::user::SqlUserType,
16015
16016    /// User level password validation policy.
16017    pub password_policy: std::option::Option<crate::model::UserPasswordValidationPolicy>,
16018
16019    /// Dual password status for the user.
16020    pub dual_password_type: std::option::Option<crate::model::user::DualPasswordType>,
16021
16022    /// User details for specific database type
16023    pub user_details: std::option::Option<crate::model::user::UserDetails>,
16024
16025    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16026}
16027
16028impl User {
16029    pub fn new() -> Self {
16030        std::default::Default::default()
16031    }
16032
16033    /// Sets the value of [kind][crate::model::User::kind].
16034    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16035        self.kind = v.into();
16036        self
16037    }
16038
16039    /// Sets the value of [password][crate::model::User::password].
16040    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16041        self.password = v.into();
16042        self
16043    }
16044
16045    /// Sets the value of [etag][crate::model::User::etag].
16046    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16047        self.etag = v.into();
16048        self
16049    }
16050
16051    /// Sets the value of [name][crate::model::User::name].
16052    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16053        self.name = v.into();
16054        self
16055    }
16056
16057    /// Sets the value of [host][crate::model::User::host].
16058    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16059        self.host = v.into();
16060        self
16061    }
16062
16063    /// Sets the value of [instance][crate::model::User::instance].
16064    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16065        self.instance = v.into();
16066        self
16067    }
16068
16069    /// Sets the value of [project][crate::model::User::project].
16070    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16071        self.project = v.into();
16072        self
16073    }
16074
16075    /// Sets the value of [r#type][crate::model::User::type].
16076    pub fn set_type<T: std::convert::Into<crate::model::user::SqlUserType>>(
16077        mut self,
16078        v: T,
16079    ) -> Self {
16080        self.r#type = v.into();
16081        self
16082    }
16083
16084    /// Sets the value of [password_policy][crate::model::User::password_policy].
16085    pub fn set_password_policy<T>(mut self, v: T) -> Self
16086    where
16087        T: std::convert::Into<crate::model::UserPasswordValidationPolicy>,
16088    {
16089        self.password_policy = std::option::Option::Some(v.into());
16090        self
16091    }
16092
16093    /// Sets or clears the value of [password_policy][crate::model::User::password_policy].
16094    pub fn set_or_clear_password_policy<T>(mut self, v: std::option::Option<T>) -> Self
16095    where
16096        T: std::convert::Into<crate::model::UserPasswordValidationPolicy>,
16097    {
16098        self.password_policy = v.map(|x| x.into());
16099        self
16100    }
16101
16102    /// Sets the value of [dual_password_type][crate::model::User::dual_password_type].
16103    pub fn set_dual_password_type<T>(mut self, v: T) -> Self
16104    where
16105        T: std::convert::Into<crate::model::user::DualPasswordType>,
16106    {
16107        self.dual_password_type = std::option::Option::Some(v.into());
16108        self
16109    }
16110
16111    /// Sets or clears the value of [dual_password_type][crate::model::User::dual_password_type].
16112    pub fn set_or_clear_dual_password_type<T>(mut self, v: std::option::Option<T>) -> Self
16113    where
16114        T: std::convert::Into<crate::model::user::DualPasswordType>,
16115    {
16116        self.dual_password_type = v.map(|x| x.into());
16117        self
16118    }
16119
16120    /// Sets the value of [user_details][crate::model::User::user_details].
16121    ///
16122    /// Note that all the setters affecting `user_details` are mutually
16123    /// exclusive.
16124    pub fn set_user_details<
16125        T: std::convert::Into<std::option::Option<crate::model::user::UserDetails>>,
16126    >(
16127        mut self,
16128        v: T,
16129    ) -> Self {
16130        self.user_details = v.into();
16131        self
16132    }
16133
16134    /// The value of [user_details][crate::model::User::user_details]
16135    /// if it holds a `SqlserverUserDetails`, `None` if the field is not set or
16136    /// holds a different branch.
16137    pub fn sqlserver_user_details(
16138        &self,
16139    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerUserDetails>> {
16140        #[allow(unreachable_patterns)]
16141        self.user_details.as_ref().and_then(|v| match v {
16142            crate::model::user::UserDetails::SqlserverUserDetails(v) => {
16143                std::option::Option::Some(v)
16144            }
16145            _ => std::option::Option::None,
16146        })
16147    }
16148
16149    /// Sets the value of [user_details][crate::model::User::user_details]
16150    /// to hold a `SqlserverUserDetails`.
16151    ///
16152    /// Note that all the setters affecting `user_details` are
16153    /// mutually exclusive.
16154    pub fn set_sqlserver_user_details<
16155        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerUserDetails>>,
16156    >(
16157        mut self,
16158        v: T,
16159    ) -> Self {
16160        self.user_details = std::option::Option::Some(
16161            crate::model::user::UserDetails::SqlserverUserDetails(v.into()),
16162        );
16163        self
16164    }
16165}
16166
16167impl wkt::message::Message for User {
16168    fn typename() -> &'static str {
16169        "type.googleapis.com/google.cloud.sql.v1.User"
16170    }
16171}
16172
16173/// Defines additional types related to [User].
16174pub mod user {
16175    #[allow(unused_imports)]
16176    use super::*;
16177
16178    /// The user type.
16179    ///
16180    /// # Working with unknown values
16181    ///
16182    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16183    /// additional enum variants at any time. Adding new variants is not considered
16184    /// a breaking change. Applications should write their code in anticipation of:
16185    ///
16186    /// - New values appearing in future releases of the client library, **and**
16187    /// - New values received dynamically, without application changes.
16188    ///
16189    /// Please consult the [Working with enums] section in the user guide for some
16190    /// guidelines.
16191    ///
16192    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16193    #[derive(Clone, Debug, PartialEq)]
16194    #[non_exhaustive]
16195    pub enum SqlUserType {
16196        /// The database's built-in user type.
16197        BuiltIn,
16198        /// Cloud IAM user.
16199        CloudIamUser,
16200        /// Cloud IAM service account.
16201        CloudIamServiceAccount,
16202        /// Cloud IAM group non-login user.
16203        CloudIamGroup,
16204        /// Cloud IAM group login user.
16205        CloudIamGroupUser,
16206        /// Cloud IAM group login service account.
16207        CloudIamGroupServiceAccount,
16208        /// If set, the enum was initialized with an unknown value.
16209        ///
16210        /// Applications can examine the value using [SqlUserType::value] or
16211        /// [SqlUserType::name].
16212        UnknownValue(sql_user_type::UnknownValue),
16213    }
16214
16215    #[doc(hidden)]
16216    pub mod sql_user_type {
16217        #[allow(unused_imports)]
16218        use super::*;
16219        #[derive(Clone, Debug, PartialEq)]
16220        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16221    }
16222
16223    impl SqlUserType {
16224        /// Gets the enum value.
16225        ///
16226        /// Returns `None` if the enum contains an unknown value deserialized from
16227        /// the string representation of enums.
16228        pub fn value(&self) -> std::option::Option<i32> {
16229            match self {
16230                Self::BuiltIn => std::option::Option::Some(0),
16231                Self::CloudIamUser => std::option::Option::Some(1),
16232                Self::CloudIamServiceAccount => std::option::Option::Some(2),
16233                Self::CloudIamGroup => std::option::Option::Some(3),
16234                Self::CloudIamGroupUser => std::option::Option::Some(4),
16235                Self::CloudIamGroupServiceAccount => std::option::Option::Some(5),
16236                Self::UnknownValue(u) => u.0.value(),
16237            }
16238        }
16239
16240        /// Gets the enum value as a string.
16241        ///
16242        /// Returns `None` if the enum contains an unknown value deserialized from
16243        /// the integer representation of enums.
16244        pub fn name(&self) -> std::option::Option<&str> {
16245            match self {
16246                Self::BuiltIn => std::option::Option::Some("BUILT_IN"),
16247                Self::CloudIamUser => std::option::Option::Some("CLOUD_IAM_USER"),
16248                Self::CloudIamServiceAccount => {
16249                    std::option::Option::Some("CLOUD_IAM_SERVICE_ACCOUNT")
16250                }
16251                Self::CloudIamGroup => std::option::Option::Some("CLOUD_IAM_GROUP"),
16252                Self::CloudIamGroupUser => std::option::Option::Some("CLOUD_IAM_GROUP_USER"),
16253                Self::CloudIamGroupServiceAccount => {
16254                    std::option::Option::Some("CLOUD_IAM_GROUP_SERVICE_ACCOUNT")
16255                }
16256                Self::UnknownValue(u) => u.0.name(),
16257            }
16258        }
16259    }
16260
16261    impl std::default::Default for SqlUserType {
16262        fn default() -> Self {
16263            use std::convert::From;
16264            Self::from(0)
16265        }
16266    }
16267
16268    impl std::fmt::Display for SqlUserType {
16269        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16270            wkt::internal::display_enum(f, self.name(), self.value())
16271        }
16272    }
16273
16274    impl std::convert::From<i32> for SqlUserType {
16275        fn from(value: i32) -> Self {
16276            match value {
16277                0 => Self::BuiltIn,
16278                1 => Self::CloudIamUser,
16279                2 => Self::CloudIamServiceAccount,
16280                3 => Self::CloudIamGroup,
16281                4 => Self::CloudIamGroupUser,
16282                5 => Self::CloudIamGroupServiceAccount,
16283                _ => Self::UnknownValue(sql_user_type::UnknownValue(
16284                    wkt::internal::UnknownEnumValue::Integer(value),
16285                )),
16286            }
16287        }
16288    }
16289
16290    impl std::convert::From<&str> for SqlUserType {
16291        fn from(value: &str) -> Self {
16292            use std::string::ToString;
16293            match value {
16294                "BUILT_IN" => Self::BuiltIn,
16295                "CLOUD_IAM_USER" => Self::CloudIamUser,
16296                "CLOUD_IAM_SERVICE_ACCOUNT" => Self::CloudIamServiceAccount,
16297                "CLOUD_IAM_GROUP" => Self::CloudIamGroup,
16298                "CLOUD_IAM_GROUP_USER" => Self::CloudIamGroupUser,
16299                "CLOUD_IAM_GROUP_SERVICE_ACCOUNT" => Self::CloudIamGroupServiceAccount,
16300                _ => Self::UnknownValue(sql_user_type::UnknownValue(
16301                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16302                )),
16303            }
16304        }
16305    }
16306
16307    impl serde::ser::Serialize for SqlUserType {
16308        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16309        where
16310            S: serde::Serializer,
16311        {
16312            match self {
16313                Self::BuiltIn => serializer.serialize_i32(0),
16314                Self::CloudIamUser => serializer.serialize_i32(1),
16315                Self::CloudIamServiceAccount => serializer.serialize_i32(2),
16316                Self::CloudIamGroup => serializer.serialize_i32(3),
16317                Self::CloudIamGroupUser => serializer.serialize_i32(4),
16318                Self::CloudIamGroupServiceAccount => serializer.serialize_i32(5),
16319                Self::UnknownValue(u) => u.0.serialize(serializer),
16320            }
16321        }
16322    }
16323
16324    impl<'de> serde::de::Deserialize<'de> for SqlUserType {
16325        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16326        where
16327            D: serde::Deserializer<'de>,
16328        {
16329            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlUserType>::new(
16330                ".google.cloud.sql.v1.User.SqlUserType",
16331            ))
16332        }
16333    }
16334
16335    /// The type of retained password.
16336    ///
16337    /// # Working with unknown values
16338    ///
16339    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16340    /// additional enum variants at any time. Adding new variants is not considered
16341    /// a breaking change. Applications should write their code in anticipation of:
16342    ///
16343    /// - New values appearing in future releases of the client library, **and**
16344    /// - New values received dynamically, without application changes.
16345    ///
16346    /// Please consult the [Working with enums] section in the user guide for some
16347    /// guidelines.
16348    ///
16349    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16350    #[derive(Clone, Debug, PartialEq)]
16351    #[non_exhaustive]
16352    pub enum DualPasswordType {
16353        /// The default value.
16354        Unspecified,
16355        /// Do not update the user's dual password status.
16356        NoModifyDualPassword,
16357        /// No dual password usable for connecting using this user.
16358        NoDualPassword,
16359        /// Dual password usable for connecting using this user.
16360        DualPassword,
16361        /// If set, the enum was initialized with an unknown value.
16362        ///
16363        /// Applications can examine the value using [DualPasswordType::value] or
16364        /// [DualPasswordType::name].
16365        UnknownValue(dual_password_type::UnknownValue),
16366    }
16367
16368    #[doc(hidden)]
16369    pub mod dual_password_type {
16370        #[allow(unused_imports)]
16371        use super::*;
16372        #[derive(Clone, Debug, PartialEq)]
16373        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16374    }
16375
16376    impl DualPasswordType {
16377        /// Gets the enum value.
16378        ///
16379        /// Returns `None` if the enum contains an unknown value deserialized from
16380        /// the string representation of enums.
16381        pub fn value(&self) -> std::option::Option<i32> {
16382            match self {
16383                Self::Unspecified => std::option::Option::Some(0),
16384                Self::NoModifyDualPassword => std::option::Option::Some(1),
16385                Self::NoDualPassword => std::option::Option::Some(2),
16386                Self::DualPassword => std::option::Option::Some(3),
16387                Self::UnknownValue(u) => u.0.value(),
16388            }
16389        }
16390
16391        /// Gets the enum value as a string.
16392        ///
16393        /// Returns `None` if the enum contains an unknown value deserialized from
16394        /// the integer representation of enums.
16395        pub fn name(&self) -> std::option::Option<&str> {
16396            match self {
16397                Self::Unspecified => std::option::Option::Some("DUAL_PASSWORD_TYPE_UNSPECIFIED"),
16398                Self::NoModifyDualPassword => std::option::Option::Some("NO_MODIFY_DUAL_PASSWORD"),
16399                Self::NoDualPassword => std::option::Option::Some("NO_DUAL_PASSWORD"),
16400                Self::DualPassword => std::option::Option::Some("DUAL_PASSWORD"),
16401                Self::UnknownValue(u) => u.0.name(),
16402            }
16403        }
16404    }
16405
16406    impl std::default::Default for DualPasswordType {
16407        fn default() -> Self {
16408            use std::convert::From;
16409            Self::from(0)
16410        }
16411    }
16412
16413    impl std::fmt::Display for DualPasswordType {
16414        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16415            wkt::internal::display_enum(f, self.name(), self.value())
16416        }
16417    }
16418
16419    impl std::convert::From<i32> for DualPasswordType {
16420        fn from(value: i32) -> Self {
16421            match value {
16422                0 => Self::Unspecified,
16423                1 => Self::NoModifyDualPassword,
16424                2 => Self::NoDualPassword,
16425                3 => Self::DualPassword,
16426                _ => Self::UnknownValue(dual_password_type::UnknownValue(
16427                    wkt::internal::UnknownEnumValue::Integer(value),
16428                )),
16429            }
16430        }
16431    }
16432
16433    impl std::convert::From<&str> for DualPasswordType {
16434        fn from(value: &str) -> Self {
16435            use std::string::ToString;
16436            match value {
16437                "DUAL_PASSWORD_TYPE_UNSPECIFIED" => Self::Unspecified,
16438                "NO_MODIFY_DUAL_PASSWORD" => Self::NoModifyDualPassword,
16439                "NO_DUAL_PASSWORD" => Self::NoDualPassword,
16440                "DUAL_PASSWORD" => Self::DualPassword,
16441                _ => Self::UnknownValue(dual_password_type::UnknownValue(
16442                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16443                )),
16444            }
16445        }
16446    }
16447
16448    impl serde::ser::Serialize for DualPasswordType {
16449        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16450        where
16451            S: serde::Serializer,
16452        {
16453            match self {
16454                Self::Unspecified => serializer.serialize_i32(0),
16455                Self::NoModifyDualPassword => serializer.serialize_i32(1),
16456                Self::NoDualPassword => serializer.serialize_i32(2),
16457                Self::DualPassword => serializer.serialize_i32(3),
16458                Self::UnknownValue(u) => u.0.serialize(serializer),
16459            }
16460        }
16461    }
16462
16463    impl<'de> serde::de::Deserialize<'de> for DualPasswordType {
16464        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16465        where
16466            D: serde::Deserializer<'de>,
16467        {
16468            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DualPasswordType>::new(
16469                ".google.cloud.sql.v1.User.DualPasswordType",
16470            ))
16471        }
16472    }
16473
16474    /// User details for specific database type
16475    #[derive(Clone, Debug, PartialEq)]
16476    #[non_exhaustive]
16477    pub enum UserDetails {
16478        SqlserverUserDetails(std::boxed::Box<crate::model::SqlServerUserDetails>),
16479    }
16480}
16481
16482/// Represents a Sql Server user on the Cloud SQL instance.
16483#[derive(Clone, Default, PartialEq)]
16484#[non_exhaustive]
16485pub struct SqlServerUserDetails {
16486    /// If the user has been disabled
16487    pub disabled: bool,
16488
16489    /// The server roles for this user
16490    pub server_roles: std::vec::Vec<std::string::String>,
16491
16492    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16493}
16494
16495impl SqlServerUserDetails {
16496    pub fn new() -> Self {
16497        std::default::Default::default()
16498    }
16499
16500    /// Sets the value of [disabled][crate::model::SqlServerUserDetails::disabled].
16501    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16502        self.disabled = v.into();
16503        self
16504    }
16505
16506    /// Sets the value of [server_roles][crate::model::SqlServerUserDetails::server_roles].
16507    pub fn set_server_roles<T, V>(mut self, v: T) -> Self
16508    where
16509        T: std::iter::IntoIterator<Item = V>,
16510        V: std::convert::Into<std::string::String>,
16511    {
16512        use std::iter::Iterator;
16513        self.server_roles = v.into_iter().map(|i| i.into()).collect();
16514        self
16515    }
16516}
16517
16518impl wkt::message::Message for SqlServerUserDetails {
16519    fn typename() -> &'static str {
16520        "type.googleapis.com/google.cloud.sql.v1.SqlServerUserDetails"
16521    }
16522}
16523
16524/// User list response.
16525#[derive(Clone, Default, PartialEq)]
16526#[non_exhaustive]
16527pub struct UsersListResponse {
16528    /// This is always `sql#usersList`.
16529    pub kind: std::string::String,
16530
16531    /// List of user resources in the instance.
16532    pub items: std::vec::Vec<crate::model::User>,
16533
16534    /// Unused.
16535    #[deprecated]
16536    pub next_page_token: std::string::String,
16537
16538    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16539}
16540
16541impl UsersListResponse {
16542    pub fn new() -> Self {
16543        std::default::Default::default()
16544    }
16545
16546    /// Sets the value of [kind][crate::model::UsersListResponse::kind].
16547    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16548        self.kind = v.into();
16549        self
16550    }
16551
16552    /// Sets the value of [items][crate::model::UsersListResponse::items].
16553    pub fn set_items<T, V>(mut self, v: T) -> Self
16554    where
16555        T: std::iter::IntoIterator<Item = V>,
16556        V: std::convert::Into<crate::model::User>,
16557    {
16558        use std::iter::Iterator;
16559        self.items = v.into_iter().map(|i| i.into()).collect();
16560        self
16561    }
16562
16563    /// Sets the value of [next_page_token][crate::model::UsersListResponse::next_page_token].
16564    #[deprecated]
16565    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16566        self.next_page_token = v.into();
16567        self
16568    }
16569}
16570
16571impl wkt::message::Message for UsersListResponse {
16572    fn typename() -> &'static str {
16573        "type.googleapis.com/google.cloud.sql.v1.UsersListResponse"
16574    }
16575}
16576
16577/// The status of a backup run.
16578///
16579/// # Working with unknown values
16580///
16581/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16582/// additional enum variants at any time. Adding new variants is not considered
16583/// a breaking change. Applications should write their code in anticipation of:
16584///
16585/// - New values appearing in future releases of the client library, **and**
16586/// - New values received dynamically, without application changes.
16587///
16588/// Please consult the [Working with enums] section in the user guide for some
16589/// guidelines.
16590///
16591/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16592#[derive(Clone, Debug, PartialEq)]
16593#[non_exhaustive]
16594pub enum SqlBackupRunStatus {
16595    /// The status of the run is unknown.
16596    Unspecified,
16597    /// The backup operation was enqueued.
16598    Enqueued,
16599    /// The backup is overdue across a given backup window. Indicates a
16600    /// problem. Example: Long-running operation in progress during
16601    /// the whole window.
16602    Overdue,
16603    /// The backup is in progress.
16604    Running,
16605    /// The backup failed.
16606    Failed,
16607    /// The backup was successful.
16608    Successful,
16609    /// The backup was skipped (without problems) for a given backup
16610    /// window. Example: Instance was idle.
16611    Skipped,
16612    /// The backup is about to be deleted.
16613    DeletionPending,
16614    /// The backup deletion failed.
16615    DeletionFailed,
16616    /// The backup has been deleted.
16617    Deleted,
16618    /// If set, the enum was initialized with an unknown value.
16619    ///
16620    /// Applications can examine the value using [SqlBackupRunStatus::value] or
16621    /// [SqlBackupRunStatus::name].
16622    UnknownValue(sql_backup_run_status::UnknownValue),
16623}
16624
16625#[doc(hidden)]
16626pub mod sql_backup_run_status {
16627    #[allow(unused_imports)]
16628    use super::*;
16629    #[derive(Clone, Debug, PartialEq)]
16630    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16631}
16632
16633impl SqlBackupRunStatus {
16634    /// Gets the enum value.
16635    ///
16636    /// Returns `None` if the enum contains an unknown value deserialized from
16637    /// the string representation of enums.
16638    pub fn value(&self) -> std::option::Option<i32> {
16639        match self {
16640            Self::Unspecified => std::option::Option::Some(0),
16641            Self::Enqueued => std::option::Option::Some(1),
16642            Self::Overdue => std::option::Option::Some(2),
16643            Self::Running => std::option::Option::Some(3),
16644            Self::Failed => std::option::Option::Some(4),
16645            Self::Successful => std::option::Option::Some(5),
16646            Self::Skipped => std::option::Option::Some(6),
16647            Self::DeletionPending => std::option::Option::Some(7),
16648            Self::DeletionFailed => std::option::Option::Some(8),
16649            Self::Deleted => std::option::Option::Some(9),
16650            Self::UnknownValue(u) => u.0.value(),
16651        }
16652    }
16653
16654    /// Gets the enum value as a string.
16655    ///
16656    /// Returns `None` if the enum contains an unknown value deserialized from
16657    /// the integer representation of enums.
16658    pub fn name(&self) -> std::option::Option<&str> {
16659        match self {
16660            Self::Unspecified => std::option::Option::Some("SQL_BACKUP_RUN_STATUS_UNSPECIFIED"),
16661            Self::Enqueued => std::option::Option::Some("ENQUEUED"),
16662            Self::Overdue => std::option::Option::Some("OVERDUE"),
16663            Self::Running => std::option::Option::Some("RUNNING"),
16664            Self::Failed => std::option::Option::Some("FAILED"),
16665            Self::Successful => std::option::Option::Some("SUCCESSFUL"),
16666            Self::Skipped => std::option::Option::Some("SKIPPED"),
16667            Self::DeletionPending => std::option::Option::Some("DELETION_PENDING"),
16668            Self::DeletionFailed => std::option::Option::Some("DELETION_FAILED"),
16669            Self::Deleted => std::option::Option::Some("DELETED"),
16670            Self::UnknownValue(u) => u.0.name(),
16671        }
16672    }
16673}
16674
16675impl std::default::Default for SqlBackupRunStatus {
16676    fn default() -> Self {
16677        use std::convert::From;
16678        Self::from(0)
16679    }
16680}
16681
16682impl std::fmt::Display for SqlBackupRunStatus {
16683    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16684        wkt::internal::display_enum(f, self.name(), self.value())
16685    }
16686}
16687
16688impl std::convert::From<i32> for SqlBackupRunStatus {
16689    fn from(value: i32) -> Self {
16690        match value {
16691            0 => Self::Unspecified,
16692            1 => Self::Enqueued,
16693            2 => Self::Overdue,
16694            3 => Self::Running,
16695            4 => Self::Failed,
16696            5 => Self::Successful,
16697            6 => Self::Skipped,
16698            7 => Self::DeletionPending,
16699            8 => Self::DeletionFailed,
16700            9 => Self::Deleted,
16701            _ => Self::UnknownValue(sql_backup_run_status::UnknownValue(
16702                wkt::internal::UnknownEnumValue::Integer(value),
16703            )),
16704        }
16705    }
16706}
16707
16708impl std::convert::From<&str> for SqlBackupRunStatus {
16709    fn from(value: &str) -> Self {
16710        use std::string::ToString;
16711        match value {
16712            "SQL_BACKUP_RUN_STATUS_UNSPECIFIED" => Self::Unspecified,
16713            "ENQUEUED" => Self::Enqueued,
16714            "OVERDUE" => Self::Overdue,
16715            "RUNNING" => Self::Running,
16716            "FAILED" => Self::Failed,
16717            "SUCCESSFUL" => Self::Successful,
16718            "SKIPPED" => Self::Skipped,
16719            "DELETION_PENDING" => Self::DeletionPending,
16720            "DELETION_FAILED" => Self::DeletionFailed,
16721            "DELETED" => Self::Deleted,
16722            _ => Self::UnknownValue(sql_backup_run_status::UnknownValue(
16723                wkt::internal::UnknownEnumValue::String(value.to_string()),
16724            )),
16725        }
16726    }
16727}
16728
16729impl serde::ser::Serialize for SqlBackupRunStatus {
16730    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16731    where
16732        S: serde::Serializer,
16733    {
16734        match self {
16735            Self::Unspecified => serializer.serialize_i32(0),
16736            Self::Enqueued => serializer.serialize_i32(1),
16737            Self::Overdue => serializer.serialize_i32(2),
16738            Self::Running => serializer.serialize_i32(3),
16739            Self::Failed => serializer.serialize_i32(4),
16740            Self::Successful => serializer.serialize_i32(5),
16741            Self::Skipped => serializer.serialize_i32(6),
16742            Self::DeletionPending => serializer.serialize_i32(7),
16743            Self::DeletionFailed => serializer.serialize_i32(8),
16744            Self::Deleted => serializer.serialize_i32(9),
16745            Self::UnknownValue(u) => u.0.serialize(serializer),
16746        }
16747    }
16748}
16749
16750impl<'de> serde::de::Deserialize<'de> for SqlBackupRunStatus {
16751    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16752    where
16753        D: serde::Deserializer<'de>,
16754    {
16755        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupRunStatus>::new(
16756            ".google.cloud.sql.v1.SqlBackupRunStatus",
16757        ))
16758    }
16759}
16760
16761/// Defines the supported backup kinds.
16762///
16763/// # Working with unknown values
16764///
16765/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16766/// additional enum variants at any time. Adding new variants is not considered
16767/// a breaking change. Applications should write their code in anticipation of:
16768///
16769/// - New values appearing in future releases of the client library, **and**
16770/// - New values received dynamically, without application changes.
16771///
16772/// Please consult the [Working with enums] section in the user guide for some
16773/// guidelines.
16774///
16775/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16776#[derive(Clone, Debug, PartialEq)]
16777#[non_exhaustive]
16778pub enum SqlBackupKind {
16779    /// This is an unknown BackupKind.
16780    Unspecified,
16781    /// The snapshot based backups
16782    Snapshot,
16783    /// Physical backups
16784    Physical,
16785    /// If set, the enum was initialized with an unknown value.
16786    ///
16787    /// Applications can examine the value using [SqlBackupKind::value] or
16788    /// [SqlBackupKind::name].
16789    UnknownValue(sql_backup_kind::UnknownValue),
16790}
16791
16792#[doc(hidden)]
16793pub mod sql_backup_kind {
16794    #[allow(unused_imports)]
16795    use super::*;
16796    #[derive(Clone, Debug, PartialEq)]
16797    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16798}
16799
16800impl SqlBackupKind {
16801    /// Gets the enum value.
16802    ///
16803    /// Returns `None` if the enum contains an unknown value deserialized from
16804    /// the string representation of enums.
16805    pub fn value(&self) -> std::option::Option<i32> {
16806        match self {
16807            Self::Unspecified => std::option::Option::Some(0),
16808            Self::Snapshot => std::option::Option::Some(1),
16809            Self::Physical => std::option::Option::Some(2),
16810            Self::UnknownValue(u) => u.0.value(),
16811        }
16812    }
16813
16814    /// Gets the enum value as a string.
16815    ///
16816    /// Returns `None` if the enum contains an unknown value deserialized from
16817    /// the integer representation of enums.
16818    pub fn name(&self) -> std::option::Option<&str> {
16819        match self {
16820            Self::Unspecified => std::option::Option::Some("SQL_BACKUP_KIND_UNSPECIFIED"),
16821            Self::Snapshot => std::option::Option::Some("SNAPSHOT"),
16822            Self::Physical => std::option::Option::Some("PHYSICAL"),
16823            Self::UnknownValue(u) => u.0.name(),
16824        }
16825    }
16826}
16827
16828impl std::default::Default for SqlBackupKind {
16829    fn default() -> Self {
16830        use std::convert::From;
16831        Self::from(0)
16832    }
16833}
16834
16835impl std::fmt::Display for SqlBackupKind {
16836    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16837        wkt::internal::display_enum(f, self.name(), self.value())
16838    }
16839}
16840
16841impl std::convert::From<i32> for SqlBackupKind {
16842    fn from(value: i32) -> Self {
16843        match value {
16844            0 => Self::Unspecified,
16845            1 => Self::Snapshot,
16846            2 => Self::Physical,
16847            _ => Self::UnknownValue(sql_backup_kind::UnknownValue(
16848                wkt::internal::UnknownEnumValue::Integer(value),
16849            )),
16850        }
16851    }
16852}
16853
16854impl std::convert::From<&str> for SqlBackupKind {
16855    fn from(value: &str) -> Self {
16856        use std::string::ToString;
16857        match value {
16858            "SQL_BACKUP_KIND_UNSPECIFIED" => Self::Unspecified,
16859            "SNAPSHOT" => Self::Snapshot,
16860            "PHYSICAL" => Self::Physical,
16861            _ => Self::UnknownValue(sql_backup_kind::UnknownValue(
16862                wkt::internal::UnknownEnumValue::String(value.to_string()),
16863            )),
16864        }
16865    }
16866}
16867
16868impl serde::ser::Serialize for SqlBackupKind {
16869    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16870    where
16871        S: serde::Serializer,
16872    {
16873        match self {
16874            Self::Unspecified => serializer.serialize_i32(0),
16875            Self::Snapshot => serializer.serialize_i32(1),
16876            Self::Physical => serializer.serialize_i32(2),
16877            Self::UnknownValue(u) => u.0.serialize(serializer),
16878        }
16879    }
16880}
16881
16882impl<'de> serde::de::Deserialize<'de> for SqlBackupKind {
16883    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16884    where
16885        D: serde::Deserializer<'de>,
16886    {
16887        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupKind>::new(
16888            ".google.cloud.sql.v1.SqlBackupKind",
16889        ))
16890    }
16891}
16892
16893/// Type of backup (i.e. automated, on demand, etc).
16894///
16895/// # Working with unknown values
16896///
16897/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16898/// additional enum variants at any time. Adding new variants is not considered
16899/// a breaking change. Applications should write their code in anticipation of:
16900///
16901/// - New values appearing in future releases of the client library, **and**
16902/// - New values received dynamically, without application changes.
16903///
16904/// Please consult the [Working with enums] section in the user guide for some
16905/// guidelines.
16906///
16907/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16908#[derive(Clone, Debug, PartialEq)]
16909#[non_exhaustive]
16910pub enum SqlBackupRunType {
16911    /// This is an unknown BackupRun type.
16912    Unspecified,
16913    /// The backup schedule automatically triggers a backup.
16914    Automated,
16915    /// The user manually triggers a backup.
16916    OnDemand,
16917    /// If set, the enum was initialized with an unknown value.
16918    ///
16919    /// Applications can examine the value using [SqlBackupRunType::value] or
16920    /// [SqlBackupRunType::name].
16921    UnknownValue(sql_backup_run_type::UnknownValue),
16922}
16923
16924#[doc(hidden)]
16925pub mod sql_backup_run_type {
16926    #[allow(unused_imports)]
16927    use super::*;
16928    #[derive(Clone, Debug, PartialEq)]
16929    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16930}
16931
16932impl SqlBackupRunType {
16933    /// Gets the enum value.
16934    ///
16935    /// Returns `None` if the enum contains an unknown value deserialized from
16936    /// the string representation of enums.
16937    pub fn value(&self) -> std::option::Option<i32> {
16938        match self {
16939            Self::Unspecified => std::option::Option::Some(0),
16940            Self::Automated => std::option::Option::Some(1),
16941            Self::OnDemand => std::option::Option::Some(2),
16942            Self::UnknownValue(u) => u.0.value(),
16943        }
16944    }
16945
16946    /// Gets the enum value as a string.
16947    ///
16948    /// Returns `None` if the enum contains an unknown value deserialized from
16949    /// the integer representation of enums.
16950    pub fn name(&self) -> std::option::Option<&str> {
16951        match self {
16952            Self::Unspecified => std::option::Option::Some("SQL_BACKUP_RUN_TYPE_UNSPECIFIED"),
16953            Self::Automated => std::option::Option::Some("AUTOMATED"),
16954            Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
16955            Self::UnknownValue(u) => u.0.name(),
16956        }
16957    }
16958}
16959
16960impl std::default::Default for SqlBackupRunType {
16961    fn default() -> Self {
16962        use std::convert::From;
16963        Self::from(0)
16964    }
16965}
16966
16967impl std::fmt::Display for SqlBackupRunType {
16968    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16969        wkt::internal::display_enum(f, self.name(), self.value())
16970    }
16971}
16972
16973impl std::convert::From<i32> for SqlBackupRunType {
16974    fn from(value: i32) -> Self {
16975        match value {
16976            0 => Self::Unspecified,
16977            1 => Self::Automated,
16978            2 => Self::OnDemand,
16979            _ => Self::UnknownValue(sql_backup_run_type::UnknownValue(
16980                wkt::internal::UnknownEnumValue::Integer(value),
16981            )),
16982        }
16983    }
16984}
16985
16986impl std::convert::From<&str> for SqlBackupRunType {
16987    fn from(value: &str) -> Self {
16988        use std::string::ToString;
16989        match value {
16990            "SQL_BACKUP_RUN_TYPE_UNSPECIFIED" => Self::Unspecified,
16991            "AUTOMATED" => Self::Automated,
16992            "ON_DEMAND" => Self::OnDemand,
16993            _ => Self::UnknownValue(sql_backup_run_type::UnknownValue(
16994                wkt::internal::UnknownEnumValue::String(value.to_string()),
16995            )),
16996        }
16997    }
16998}
16999
17000impl serde::ser::Serialize for SqlBackupRunType {
17001    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17002    where
17003        S: serde::Serializer,
17004    {
17005        match self {
17006            Self::Unspecified => serializer.serialize_i32(0),
17007            Self::Automated => serializer.serialize_i32(1),
17008            Self::OnDemand => serializer.serialize_i32(2),
17009            Self::UnknownValue(u) => u.0.serialize(serializer),
17010        }
17011    }
17012}
17013
17014impl<'de> serde::de::Deserialize<'de> for SqlBackupRunType {
17015    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17016    where
17017        D: serde::Deserializer<'de>,
17018    {
17019        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupRunType>::new(
17020            ".google.cloud.sql.v1.SqlBackupRunType",
17021        ))
17022    }
17023}
17024
17025///
17026/// # Working with unknown values
17027///
17028/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17029/// additional enum variants at any time. Adding new variants is not considered
17030/// a breaking change. Applications should write their code in anticipation of:
17031///
17032/// - New values appearing in future releases of the client library, **and**
17033/// - New values received dynamically, without application changes.
17034///
17035/// Please consult the [Working with enums] section in the user guide for some
17036/// guidelines.
17037///
17038/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17039#[derive(Clone, Debug, PartialEq)]
17040#[non_exhaustive]
17041pub enum SqlFlagType {
17042    /// This is an unknown flag type.
17043    Unspecified,
17044    /// Boolean type flag.
17045    Boolean,
17046    /// String type flag.
17047    String,
17048    /// Integer type flag.
17049    Integer,
17050    /// Flag type used for a server startup option.
17051    None,
17052    /// Type introduced specially for MySQL TimeZone offset. Accept a string value
17053    /// with the format [-12:59, 13:00].
17054    MysqlTimezoneOffset,
17055    /// Float type flag.
17056    Float,
17057    /// Comma-separated list of the strings in a SqlFlagType enum.
17058    RepeatedString,
17059    /// If set, the enum was initialized with an unknown value.
17060    ///
17061    /// Applications can examine the value using [SqlFlagType::value] or
17062    /// [SqlFlagType::name].
17063    UnknownValue(sql_flag_type::UnknownValue),
17064}
17065
17066#[doc(hidden)]
17067pub mod sql_flag_type {
17068    #[allow(unused_imports)]
17069    use super::*;
17070    #[derive(Clone, Debug, PartialEq)]
17071    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17072}
17073
17074impl SqlFlagType {
17075    /// Gets the enum value.
17076    ///
17077    /// Returns `None` if the enum contains an unknown value deserialized from
17078    /// the string representation of enums.
17079    pub fn value(&self) -> std::option::Option<i32> {
17080        match self {
17081            Self::Unspecified => std::option::Option::Some(0),
17082            Self::Boolean => std::option::Option::Some(1),
17083            Self::String => std::option::Option::Some(2),
17084            Self::Integer => std::option::Option::Some(3),
17085            Self::None => std::option::Option::Some(4),
17086            Self::MysqlTimezoneOffset => std::option::Option::Some(5),
17087            Self::Float => std::option::Option::Some(6),
17088            Self::RepeatedString => std::option::Option::Some(7),
17089            Self::UnknownValue(u) => u.0.value(),
17090        }
17091    }
17092
17093    /// Gets the enum value as a string.
17094    ///
17095    /// Returns `None` if the enum contains an unknown value deserialized from
17096    /// the integer representation of enums.
17097    pub fn name(&self) -> std::option::Option<&str> {
17098        match self {
17099            Self::Unspecified => std::option::Option::Some("SQL_FLAG_TYPE_UNSPECIFIED"),
17100            Self::Boolean => std::option::Option::Some("BOOLEAN"),
17101            Self::String => std::option::Option::Some("STRING"),
17102            Self::Integer => std::option::Option::Some("INTEGER"),
17103            Self::None => std::option::Option::Some("NONE"),
17104            Self::MysqlTimezoneOffset => std::option::Option::Some("MYSQL_TIMEZONE_OFFSET"),
17105            Self::Float => std::option::Option::Some("FLOAT"),
17106            Self::RepeatedString => std::option::Option::Some("REPEATED_STRING"),
17107            Self::UnknownValue(u) => u.0.name(),
17108        }
17109    }
17110}
17111
17112impl std::default::Default for SqlFlagType {
17113    fn default() -> Self {
17114        use std::convert::From;
17115        Self::from(0)
17116    }
17117}
17118
17119impl std::fmt::Display for SqlFlagType {
17120    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17121        wkt::internal::display_enum(f, self.name(), self.value())
17122    }
17123}
17124
17125impl std::convert::From<i32> for SqlFlagType {
17126    fn from(value: i32) -> Self {
17127        match value {
17128            0 => Self::Unspecified,
17129            1 => Self::Boolean,
17130            2 => Self::String,
17131            3 => Self::Integer,
17132            4 => Self::None,
17133            5 => Self::MysqlTimezoneOffset,
17134            6 => Self::Float,
17135            7 => Self::RepeatedString,
17136            _ => Self::UnknownValue(sql_flag_type::UnknownValue(
17137                wkt::internal::UnknownEnumValue::Integer(value),
17138            )),
17139        }
17140    }
17141}
17142
17143impl std::convert::From<&str> for SqlFlagType {
17144    fn from(value: &str) -> Self {
17145        use std::string::ToString;
17146        match value {
17147            "SQL_FLAG_TYPE_UNSPECIFIED" => Self::Unspecified,
17148            "BOOLEAN" => Self::Boolean,
17149            "STRING" => Self::String,
17150            "INTEGER" => Self::Integer,
17151            "NONE" => Self::None,
17152            "MYSQL_TIMEZONE_OFFSET" => Self::MysqlTimezoneOffset,
17153            "FLOAT" => Self::Float,
17154            "REPEATED_STRING" => Self::RepeatedString,
17155            _ => Self::UnknownValue(sql_flag_type::UnknownValue(
17156                wkt::internal::UnknownEnumValue::String(value.to_string()),
17157            )),
17158        }
17159    }
17160}
17161
17162impl serde::ser::Serialize for SqlFlagType {
17163    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17164    where
17165        S: serde::Serializer,
17166    {
17167        match self {
17168            Self::Unspecified => serializer.serialize_i32(0),
17169            Self::Boolean => serializer.serialize_i32(1),
17170            Self::String => serializer.serialize_i32(2),
17171            Self::Integer => serializer.serialize_i32(3),
17172            Self::None => serializer.serialize_i32(4),
17173            Self::MysqlTimezoneOffset => serializer.serialize_i32(5),
17174            Self::Float => serializer.serialize_i32(6),
17175            Self::RepeatedString => serializer.serialize_i32(7),
17176            Self::UnknownValue(u) => u.0.serialize(serializer),
17177        }
17178    }
17179}
17180
17181impl<'de> serde::de::Deserialize<'de> for SqlFlagType {
17182    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17183    where
17184        D: serde::Deserializer<'de>,
17185    {
17186        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFlagType>::new(
17187            ".google.cloud.sql.v1.SqlFlagType",
17188        ))
17189    }
17190}
17191
17192/// External Sync parallel level.
17193///
17194/// # Working with unknown values
17195///
17196/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17197/// additional enum variants at any time. Adding new variants is not considered
17198/// a breaking change. Applications should write their code in anticipation of:
17199///
17200/// - New values appearing in future releases of the client library, **and**
17201/// - New values received dynamically, without application changes.
17202///
17203/// Please consult the [Working with enums] section in the user guide for some
17204/// guidelines.
17205///
17206/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17207#[derive(Clone, Debug, PartialEq)]
17208#[non_exhaustive]
17209pub enum ExternalSyncParallelLevel {
17210    /// Unknown sync parallel level. Will be defaulted to OPTIMAL.
17211    Unspecified,
17212    /// Minimal parallel level.
17213    Min,
17214    /// Optimal parallel level.
17215    Optimal,
17216    /// Maximum parallel level.
17217    Max,
17218    /// If set, the enum was initialized with an unknown value.
17219    ///
17220    /// Applications can examine the value using [ExternalSyncParallelLevel::value] or
17221    /// [ExternalSyncParallelLevel::name].
17222    UnknownValue(external_sync_parallel_level::UnknownValue),
17223}
17224
17225#[doc(hidden)]
17226pub mod external_sync_parallel_level {
17227    #[allow(unused_imports)]
17228    use super::*;
17229    #[derive(Clone, Debug, PartialEq)]
17230    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17231}
17232
17233impl ExternalSyncParallelLevel {
17234    /// Gets the enum value.
17235    ///
17236    /// Returns `None` if the enum contains an unknown value deserialized from
17237    /// the string representation of enums.
17238    pub fn value(&self) -> std::option::Option<i32> {
17239        match self {
17240            Self::Unspecified => std::option::Option::Some(0),
17241            Self::Min => std::option::Option::Some(1),
17242            Self::Optimal => std::option::Option::Some(2),
17243            Self::Max => std::option::Option::Some(3),
17244            Self::UnknownValue(u) => u.0.value(),
17245        }
17246    }
17247
17248    /// Gets the enum value as a string.
17249    ///
17250    /// Returns `None` if the enum contains an unknown value deserialized from
17251    /// the integer representation of enums.
17252    pub fn name(&self) -> std::option::Option<&str> {
17253        match self {
17254            Self::Unspecified => {
17255                std::option::Option::Some("EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED")
17256            }
17257            Self::Min => std::option::Option::Some("MIN"),
17258            Self::Optimal => std::option::Option::Some("OPTIMAL"),
17259            Self::Max => std::option::Option::Some("MAX"),
17260            Self::UnknownValue(u) => u.0.name(),
17261        }
17262    }
17263}
17264
17265impl std::default::Default for ExternalSyncParallelLevel {
17266    fn default() -> Self {
17267        use std::convert::From;
17268        Self::from(0)
17269    }
17270}
17271
17272impl std::fmt::Display for ExternalSyncParallelLevel {
17273    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17274        wkt::internal::display_enum(f, self.name(), self.value())
17275    }
17276}
17277
17278impl std::convert::From<i32> for ExternalSyncParallelLevel {
17279    fn from(value: i32) -> Self {
17280        match value {
17281            0 => Self::Unspecified,
17282            1 => Self::Min,
17283            2 => Self::Optimal,
17284            3 => Self::Max,
17285            _ => Self::UnknownValue(external_sync_parallel_level::UnknownValue(
17286                wkt::internal::UnknownEnumValue::Integer(value),
17287            )),
17288        }
17289    }
17290}
17291
17292impl std::convert::From<&str> for ExternalSyncParallelLevel {
17293    fn from(value: &str) -> Self {
17294        use std::string::ToString;
17295        match value {
17296            "EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED" => Self::Unspecified,
17297            "MIN" => Self::Min,
17298            "OPTIMAL" => Self::Optimal,
17299            "MAX" => Self::Max,
17300            _ => Self::UnknownValue(external_sync_parallel_level::UnknownValue(
17301                wkt::internal::UnknownEnumValue::String(value.to_string()),
17302            )),
17303        }
17304    }
17305}
17306
17307impl serde::ser::Serialize for ExternalSyncParallelLevel {
17308    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17309    where
17310        S: serde::Serializer,
17311    {
17312        match self {
17313            Self::Unspecified => serializer.serialize_i32(0),
17314            Self::Min => serializer.serialize_i32(1),
17315            Self::Optimal => serializer.serialize_i32(2),
17316            Self::Max => serializer.serialize_i32(3),
17317            Self::UnknownValue(u) => u.0.serialize(serializer),
17318        }
17319    }
17320}
17321
17322impl<'de> serde::de::Deserialize<'de> for ExternalSyncParallelLevel {
17323    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17324    where
17325        D: serde::Deserializer<'de>,
17326    {
17327        deserializer.deserialize_any(
17328            wkt::internal::EnumVisitor::<ExternalSyncParallelLevel>::new(
17329                ".google.cloud.sql.v1.ExternalSyncParallelLevel",
17330            ),
17331        )
17332    }
17333}
17334
17335///
17336/// # Working with unknown values
17337///
17338/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17339/// additional enum variants at any time. Adding new variants is not considered
17340/// a breaking change. Applications should write their code in anticipation of:
17341///
17342/// - New values appearing in future releases of the client library, **and**
17343/// - New values received dynamically, without application changes.
17344///
17345/// Please consult the [Working with enums] section in the user guide for some
17346/// guidelines.
17347///
17348/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17349#[derive(Clone, Debug, PartialEq)]
17350#[non_exhaustive]
17351pub enum SqlInstanceType {
17352    /// This is an unknown Cloud SQL instance type.
17353    Unspecified,
17354    /// A regular Cloud SQL instance that is not replicating from a primary
17355    /// instance.
17356    CloudSqlInstance,
17357    /// An instance running on the customer's premises that is not managed by
17358    /// Cloud SQL.
17359    OnPremisesInstance,
17360    /// A Cloud SQL instance acting as a read-replica.
17361    ReadReplicaInstance,
17362    /// If set, the enum was initialized with an unknown value.
17363    ///
17364    /// Applications can examine the value using [SqlInstanceType::value] or
17365    /// [SqlInstanceType::name].
17366    UnknownValue(sql_instance_type::UnknownValue),
17367}
17368
17369#[doc(hidden)]
17370pub mod sql_instance_type {
17371    #[allow(unused_imports)]
17372    use super::*;
17373    #[derive(Clone, Debug, PartialEq)]
17374    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17375}
17376
17377impl SqlInstanceType {
17378    /// Gets the enum value.
17379    ///
17380    /// Returns `None` if the enum contains an unknown value deserialized from
17381    /// the string representation of enums.
17382    pub fn value(&self) -> std::option::Option<i32> {
17383        match self {
17384            Self::Unspecified => std::option::Option::Some(0),
17385            Self::CloudSqlInstance => std::option::Option::Some(1),
17386            Self::OnPremisesInstance => std::option::Option::Some(2),
17387            Self::ReadReplicaInstance => std::option::Option::Some(3),
17388            Self::UnknownValue(u) => u.0.value(),
17389        }
17390    }
17391
17392    /// Gets the enum value as a string.
17393    ///
17394    /// Returns `None` if the enum contains an unknown value deserialized from
17395    /// the integer representation of enums.
17396    pub fn name(&self) -> std::option::Option<&str> {
17397        match self {
17398            Self::Unspecified => std::option::Option::Some("SQL_INSTANCE_TYPE_UNSPECIFIED"),
17399            Self::CloudSqlInstance => std::option::Option::Some("CLOUD_SQL_INSTANCE"),
17400            Self::OnPremisesInstance => std::option::Option::Some("ON_PREMISES_INSTANCE"),
17401            Self::ReadReplicaInstance => std::option::Option::Some("READ_REPLICA_INSTANCE"),
17402            Self::UnknownValue(u) => u.0.name(),
17403        }
17404    }
17405}
17406
17407impl std::default::Default for SqlInstanceType {
17408    fn default() -> Self {
17409        use std::convert::From;
17410        Self::from(0)
17411    }
17412}
17413
17414impl std::fmt::Display for SqlInstanceType {
17415    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17416        wkt::internal::display_enum(f, self.name(), self.value())
17417    }
17418}
17419
17420impl std::convert::From<i32> for SqlInstanceType {
17421    fn from(value: i32) -> Self {
17422        match value {
17423            0 => Self::Unspecified,
17424            1 => Self::CloudSqlInstance,
17425            2 => Self::OnPremisesInstance,
17426            3 => Self::ReadReplicaInstance,
17427            _ => Self::UnknownValue(sql_instance_type::UnknownValue(
17428                wkt::internal::UnknownEnumValue::Integer(value),
17429            )),
17430        }
17431    }
17432}
17433
17434impl std::convert::From<&str> for SqlInstanceType {
17435    fn from(value: &str) -> Self {
17436        use std::string::ToString;
17437        match value {
17438            "SQL_INSTANCE_TYPE_UNSPECIFIED" => Self::Unspecified,
17439            "CLOUD_SQL_INSTANCE" => Self::CloudSqlInstance,
17440            "ON_PREMISES_INSTANCE" => Self::OnPremisesInstance,
17441            "READ_REPLICA_INSTANCE" => Self::ReadReplicaInstance,
17442            _ => Self::UnknownValue(sql_instance_type::UnknownValue(
17443                wkt::internal::UnknownEnumValue::String(value.to_string()),
17444            )),
17445        }
17446    }
17447}
17448
17449impl serde::ser::Serialize for SqlInstanceType {
17450    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17451    where
17452        S: serde::Serializer,
17453    {
17454        match self {
17455            Self::Unspecified => serializer.serialize_i32(0),
17456            Self::CloudSqlInstance => serializer.serialize_i32(1),
17457            Self::OnPremisesInstance => serializer.serialize_i32(2),
17458            Self::ReadReplicaInstance => serializer.serialize_i32(3),
17459            Self::UnknownValue(u) => u.0.serialize(serializer),
17460        }
17461    }
17462}
17463
17464impl<'de> serde::de::Deserialize<'de> for SqlInstanceType {
17465    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17466    where
17467        D: serde::Deserializer<'de>,
17468    {
17469        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlInstanceType>::new(
17470            ".google.cloud.sql.v1.SqlInstanceType",
17471        ))
17472    }
17473}
17474
17475/// The suspension reason of the database instance if the state is SUSPENDED.
17476///
17477/// # Working with unknown values
17478///
17479/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17480/// additional enum variants at any time. Adding new variants is not considered
17481/// a breaking change. Applications should write their code in anticipation of:
17482///
17483/// - New values appearing in future releases of the client library, **and**
17484/// - New values received dynamically, without application changes.
17485///
17486/// Please consult the [Working with enums] section in the user guide for some
17487/// guidelines.
17488///
17489/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17490#[derive(Clone, Debug, PartialEq)]
17491#[non_exhaustive]
17492pub enum SqlSuspensionReason {
17493    /// This is an unknown suspension reason.
17494    Unspecified,
17495    /// The instance is suspended due to billing issues (for example:, GCP account
17496    /// issue)
17497    BillingIssue,
17498    /// The instance is suspended due to illegal content (for example:, child
17499    /// pornography, copyrighted material, etc.).
17500    LegalIssue,
17501    /// The instance is causing operational issues (for example:, causing the
17502    /// database to crash).
17503    OperationalIssue,
17504    /// The KMS key used by the instance is either revoked or denied access to
17505    KmsKeyIssue,
17506    /// If set, the enum was initialized with an unknown value.
17507    ///
17508    /// Applications can examine the value using [SqlSuspensionReason::value] or
17509    /// [SqlSuspensionReason::name].
17510    UnknownValue(sql_suspension_reason::UnknownValue),
17511}
17512
17513#[doc(hidden)]
17514pub mod sql_suspension_reason {
17515    #[allow(unused_imports)]
17516    use super::*;
17517    #[derive(Clone, Debug, PartialEq)]
17518    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17519}
17520
17521impl SqlSuspensionReason {
17522    /// Gets the enum value.
17523    ///
17524    /// Returns `None` if the enum contains an unknown value deserialized from
17525    /// the string representation of enums.
17526    pub fn value(&self) -> std::option::Option<i32> {
17527        match self {
17528            Self::Unspecified => std::option::Option::Some(0),
17529            Self::BillingIssue => std::option::Option::Some(2),
17530            Self::LegalIssue => std::option::Option::Some(3),
17531            Self::OperationalIssue => std::option::Option::Some(4),
17532            Self::KmsKeyIssue => std::option::Option::Some(5),
17533            Self::UnknownValue(u) => u.0.value(),
17534        }
17535    }
17536
17537    /// Gets the enum value as a string.
17538    ///
17539    /// Returns `None` if the enum contains an unknown value deserialized from
17540    /// the integer representation of enums.
17541    pub fn name(&self) -> std::option::Option<&str> {
17542        match self {
17543            Self::Unspecified => std::option::Option::Some("SQL_SUSPENSION_REASON_UNSPECIFIED"),
17544            Self::BillingIssue => std::option::Option::Some("BILLING_ISSUE"),
17545            Self::LegalIssue => std::option::Option::Some("LEGAL_ISSUE"),
17546            Self::OperationalIssue => std::option::Option::Some("OPERATIONAL_ISSUE"),
17547            Self::KmsKeyIssue => std::option::Option::Some("KMS_KEY_ISSUE"),
17548            Self::UnknownValue(u) => u.0.name(),
17549        }
17550    }
17551}
17552
17553impl std::default::Default for SqlSuspensionReason {
17554    fn default() -> Self {
17555        use std::convert::From;
17556        Self::from(0)
17557    }
17558}
17559
17560impl std::fmt::Display for SqlSuspensionReason {
17561    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17562        wkt::internal::display_enum(f, self.name(), self.value())
17563    }
17564}
17565
17566impl std::convert::From<i32> for SqlSuspensionReason {
17567    fn from(value: i32) -> Self {
17568        match value {
17569            0 => Self::Unspecified,
17570            2 => Self::BillingIssue,
17571            3 => Self::LegalIssue,
17572            4 => Self::OperationalIssue,
17573            5 => Self::KmsKeyIssue,
17574            _ => Self::UnknownValue(sql_suspension_reason::UnknownValue(
17575                wkt::internal::UnknownEnumValue::Integer(value),
17576            )),
17577        }
17578    }
17579}
17580
17581impl std::convert::From<&str> for SqlSuspensionReason {
17582    fn from(value: &str) -> Self {
17583        use std::string::ToString;
17584        match value {
17585            "SQL_SUSPENSION_REASON_UNSPECIFIED" => Self::Unspecified,
17586            "BILLING_ISSUE" => Self::BillingIssue,
17587            "LEGAL_ISSUE" => Self::LegalIssue,
17588            "OPERATIONAL_ISSUE" => Self::OperationalIssue,
17589            "KMS_KEY_ISSUE" => Self::KmsKeyIssue,
17590            _ => Self::UnknownValue(sql_suspension_reason::UnknownValue(
17591                wkt::internal::UnknownEnumValue::String(value.to_string()),
17592            )),
17593        }
17594    }
17595}
17596
17597impl serde::ser::Serialize for SqlSuspensionReason {
17598    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17599    where
17600        S: serde::Serializer,
17601    {
17602        match self {
17603            Self::Unspecified => serializer.serialize_i32(0),
17604            Self::BillingIssue => serializer.serialize_i32(2),
17605            Self::LegalIssue => serializer.serialize_i32(3),
17606            Self::OperationalIssue => serializer.serialize_i32(4),
17607            Self::KmsKeyIssue => serializer.serialize_i32(5),
17608            Self::UnknownValue(u) => u.0.serialize(serializer),
17609        }
17610    }
17611}
17612
17613impl<'de> serde::de::Deserialize<'de> for SqlSuspensionReason {
17614    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17615    where
17616        D: serde::Deserializer<'de>,
17617    {
17618        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlSuspensionReason>::new(
17619            ".google.cloud.sql.v1.SqlSuspensionReason",
17620        ))
17621    }
17622}
17623
17624///
17625/// # Working with unknown values
17626///
17627/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17628/// additional enum variants at any time. Adding new variants is not considered
17629/// a breaking change. Applications should write their code in anticipation of:
17630///
17631/// - New values appearing in future releases of the client library, **and**
17632/// - New values received dynamically, without application changes.
17633///
17634/// Please consult the [Working with enums] section in the user guide for some
17635/// guidelines.
17636///
17637/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17638#[derive(Clone, Debug, PartialEq)]
17639#[non_exhaustive]
17640pub enum SqlFileType {
17641    /// Unknown file type.
17642    Unspecified,
17643    /// File containing SQL statements.
17644    Sql,
17645    /// File in CSV format.
17646    Csv,
17647    Bak,
17648    /// If set, the enum was initialized with an unknown value.
17649    ///
17650    /// Applications can examine the value using [SqlFileType::value] or
17651    /// [SqlFileType::name].
17652    UnknownValue(sql_file_type::UnknownValue),
17653}
17654
17655#[doc(hidden)]
17656pub mod sql_file_type {
17657    #[allow(unused_imports)]
17658    use super::*;
17659    #[derive(Clone, Debug, PartialEq)]
17660    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17661}
17662
17663impl SqlFileType {
17664    /// Gets the enum value.
17665    ///
17666    /// Returns `None` if the enum contains an unknown value deserialized from
17667    /// the string representation of enums.
17668    pub fn value(&self) -> std::option::Option<i32> {
17669        match self {
17670            Self::Unspecified => std::option::Option::Some(0),
17671            Self::Sql => std::option::Option::Some(1),
17672            Self::Csv => std::option::Option::Some(2),
17673            Self::Bak => std::option::Option::Some(4),
17674            Self::UnknownValue(u) => u.0.value(),
17675        }
17676    }
17677
17678    /// Gets the enum value as a string.
17679    ///
17680    /// Returns `None` if the enum contains an unknown value deserialized from
17681    /// the integer representation of enums.
17682    pub fn name(&self) -> std::option::Option<&str> {
17683        match self {
17684            Self::Unspecified => std::option::Option::Some("SQL_FILE_TYPE_UNSPECIFIED"),
17685            Self::Sql => std::option::Option::Some("SQL"),
17686            Self::Csv => std::option::Option::Some("CSV"),
17687            Self::Bak => std::option::Option::Some("BAK"),
17688            Self::UnknownValue(u) => u.0.name(),
17689        }
17690    }
17691}
17692
17693impl std::default::Default for SqlFileType {
17694    fn default() -> Self {
17695        use std::convert::From;
17696        Self::from(0)
17697    }
17698}
17699
17700impl std::fmt::Display for SqlFileType {
17701    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17702        wkt::internal::display_enum(f, self.name(), self.value())
17703    }
17704}
17705
17706impl std::convert::From<i32> for SqlFileType {
17707    fn from(value: i32) -> Self {
17708        match value {
17709            0 => Self::Unspecified,
17710            1 => Self::Sql,
17711            2 => Self::Csv,
17712            4 => Self::Bak,
17713            _ => Self::UnknownValue(sql_file_type::UnknownValue(
17714                wkt::internal::UnknownEnumValue::Integer(value),
17715            )),
17716        }
17717    }
17718}
17719
17720impl std::convert::From<&str> for SqlFileType {
17721    fn from(value: &str) -> Self {
17722        use std::string::ToString;
17723        match value {
17724            "SQL_FILE_TYPE_UNSPECIFIED" => Self::Unspecified,
17725            "SQL" => Self::Sql,
17726            "CSV" => Self::Csv,
17727            "BAK" => Self::Bak,
17728            _ => Self::UnknownValue(sql_file_type::UnknownValue(
17729                wkt::internal::UnknownEnumValue::String(value.to_string()),
17730            )),
17731        }
17732    }
17733}
17734
17735impl serde::ser::Serialize for SqlFileType {
17736    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17737    where
17738        S: serde::Serializer,
17739    {
17740        match self {
17741            Self::Unspecified => serializer.serialize_i32(0),
17742            Self::Sql => serializer.serialize_i32(1),
17743            Self::Csv => serializer.serialize_i32(2),
17744            Self::Bak => serializer.serialize_i32(4),
17745            Self::UnknownValue(u) => u.0.serialize(serializer),
17746        }
17747    }
17748}
17749
17750impl<'de> serde::de::Deserialize<'de> for SqlFileType {
17751    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17752    where
17753        D: serde::Deserializer<'de>,
17754    {
17755        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFileType>::new(
17756            ".google.cloud.sql.v1.SqlFileType",
17757        ))
17758    }
17759}
17760
17761///
17762/// # Working with unknown values
17763///
17764/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17765/// additional enum variants at any time. Adding new variants is not considered
17766/// a breaking change. Applications should write their code in anticipation of:
17767///
17768/// - New values appearing in future releases of the client library, **and**
17769/// - New values received dynamically, without application changes.
17770///
17771/// Please consult the [Working with enums] section in the user guide for some
17772/// guidelines.
17773///
17774/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17775#[derive(Clone, Debug, PartialEq)]
17776#[non_exhaustive]
17777pub enum BakType {
17778    /// Default type.
17779    Unspecified,
17780    /// Full backup.
17781    Full,
17782    /// Differential backup.
17783    Diff,
17784    /// Transaction Log backup
17785    Tlog,
17786    /// If set, the enum was initialized with an unknown value.
17787    ///
17788    /// Applications can examine the value using [BakType::value] or
17789    /// [BakType::name].
17790    UnknownValue(bak_type::UnknownValue),
17791}
17792
17793#[doc(hidden)]
17794pub mod bak_type {
17795    #[allow(unused_imports)]
17796    use super::*;
17797    #[derive(Clone, Debug, PartialEq)]
17798    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17799}
17800
17801impl BakType {
17802    /// Gets the enum value.
17803    ///
17804    /// Returns `None` if the enum contains an unknown value deserialized from
17805    /// the string representation of enums.
17806    pub fn value(&self) -> std::option::Option<i32> {
17807        match self {
17808            Self::Unspecified => std::option::Option::Some(0),
17809            Self::Full => std::option::Option::Some(1),
17810            Self::Diff => std::option::Option::Some(2),
17811            Self::Tlog => std::option::Option::Some(3),
17812            Self::UnknownValue(u) => u.0.value(),
17813        }
17814    }
17815
17816    /// Gets the enum value as a string.
17817    ///
17818    /// Returns `None` if the enum contains an unknown value deserialized from
17819    /// the integer representation of enums.
17820    pub fn name(&self) -> std::option::Option<&str> {
17821        match self {
17822            Self::Unspecified => std::option::Option::Some("BAK_TYPE_UNSPECIFIED"),
17823            Self::Full => std::option::Option::Some("FULL"),
17824            Self::Diff => std::option::Option::Some("DIFF"),
17825            Self::Tlog => std::option::Option::Some("TLOG"),
17826            Self::UnknownValue(u) => u.0.name(),
17827        }
17828    }
17829}
17830
17831impl std::default::Default for BakType {
17832    fn default() -> Self {
17833        use std::convert::From;
17834        Self::from(0)
17835    }
17836}
17837
17838impl std::fmt::Display for BakType {
17839    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17840        wkt::internal::display_enum(f, self.name(), self.value())
17841    }
17842}
17843
17844impl std::convert::From<i32> for BakType {
17845    fn from(value: i32) -> Self {
17846        match value {
17847            0 => Self::Unspecified,
17848            1 => Self::Full,
17849            2 => Self::Diff,
17850            3 => Self::Tlog,
17851            _ => Self::UnknownValue(bak_type::UnknownValue(
17852                wkt::internal::UnknownEnumValue::Integer(value),
17853            )),
17854        }
17855    }
17856}
17857
17858impl std::convert::From<&str> for BakType {
17859    fn from(value: &str) -> Self {
17860        use std::string::ToString;
17861        match value {
17862            "BAK_TYPE_UNSPECIFIED" => Self::Unspecified,
17863            "FULL" => Self::Full,
17864            "DIFF" => Self::Diff,
17865            "TLOG" => Self::Tlog,
17866            _ => Self::UnknownValue(bak_type::UnknownValue(
17867                wkt::internal::UnknownEnumValue::String(value.to_string()),
17868            )),
17869        }
17870    }
17871}
17872
17873impl serde::ser::Serialize for BakType {
17874    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17875    where
17876        S: serde::Serializer,
17877    {
17878        match self {
17879            Self::Unspecified => serializer.serialize_i32(0),
17880            Self::Full => serializer.serialize_i32(1),
17881            Self::Diff => serializer.serialize_i32(2),
17882            Self::Tlog => serializer.serialize_i32(3),
17883            Self::UnknownValue(u) => u.0.serialize(serializer),
17884        }
17885    }
17886}
17887
17888impl<'de> serde::de::Deserialize<'de> for BakType {
17889    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17890    where
17891        D: serde::Deserializer<'de>,
17892    {
17893        deserializer.deserialize_any(wkt::internal::EnumVisitor::<BakType>::new(
17894            ".google.cloud.sql.v1.BakType",
17895        ))
17896    }
17897}
17898
17899///
17900/// # Working with unknown values
17901///
17902/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17903/// additional enum variants at any time. Adding new variants is not considered
17904/// a breaking change. Applications should write their code in anticipation of:
17905///
17906/// - New values appearing in future releases of the client library, **and**
17907/// - New values received dynamically, without application changes.
17908///
17909/// Please consult the [Working with enums] section in the user guide for some
17910/// guidelines.
17911///
17912/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17913#[derive(Clone, Debug, PartialEq)]
17914#[non_exhaustive]
17915pub enum SqlBackendType {
17916    /// This is an unknown backend type for instance.
17917    Unspecified,
17918    /// V1 speckle instance.
17919    #[deprecated]
17920    FirstGen,
17921    /// V2 speckle instance.
17922    SecondGen,
17923    /// On premises instance.
17924    External,
17925    /// If set, the enum was initialized with an unknown value.
17926    ///
17927    /// Applications can examine the value using [SqlBackendType::value] or
17928    /// [SqlBackendType::name].
17929    UnknownValue(sql_backend_type::UnknownValue),
17930}
17931
17932#[doc(hidden)]
17933pub mod sql_backend_type {
17934    #[allow(unused_imports)]
17935    use super::*;
17936    #[derive(Clone, Debug, PartialEq)]
17937    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17938}
17939
17940impl SqlBackendType {
17941    /// Gets the enum value.
17942    ///
17943    /// Returns `None` if the enum contains an unknown value deserialized from
17944    /// the string representation of enums.
17945    pub fn value(&self) -> std::option::Option<i32> {
17946        match self {
17947            Self::Unspecified => std::option::Option::Some(0),
17948            Self::FirstGen => std::option::Option::Some(1),
17949            Self::SecondGen => std::option::Option::Some(2),
17950            Self::External => std::option::Option::Some(3),
17951            Self::UnknownValue(u) => u.0.value(),
17952        }
17953    }
17954
17955    /// Gets the enum value as a string.
17956    ///
17957    /// Returns `None` if the enum contains an unknown value deserialized from
17958    /// the integer representation of enums.
17959    pub fn name(&self) -> std::option::Option<&str> {
17960        match self {
17961            Self::Unspecified => std::option::Option::Some("SQL_BACKEND_TYPE_UNSPECIFIED"),
17962            Self::FirstGen => std::option::Option::Some("FIRST_GEN"),
17963            Self::SecondGen => std::option::Option::Some("SECOND_GEN"),
17964            Self::External => std::option::Option::Some("EXTERNAL"),
17965            Self::UnknownValue(u) => u.0.name(),
17966        }
17967    }
17968}
17969
17970impl std::default::Default for SqlBackendType {
17971    fn default() -> Self {
17972        use std::convert::From;
17973        Self::from(0)
17974    }
17975}
17976
17977impl std::fmt::Display for SqlBackendType {
17978    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17979        wkt::internal::display_enum(f, self.name(), self.value())
17980    }
17981}
17982
17983impl std::convert::From<i32> for SqlBackendType {
17984    fn from(value: i32) -> Self {
17985        match value {
17986            0 => Self::Unspecified,
17987            1 => Self::FirstGen,
17988            2 => Self::SecondGen,
17989            3 => Self::External,
17990            _ => Self::UnknownValue(sql_backend_type::UnknownValue(
17991                wkt::internal::UnknownEnumValue::Integer(value),
17992            )),
17993        }
17994    }
17995}
17996
17997impl std::convert::From<&str> for SqlBackendType {
17998    fn from(value: &str) -> Self {
17999        use std::string::ToString;
18000        match value {
18001            "SQL_BACKEND_TYPE_UNSPECIFIED" => Self::Unspecified,
18002            "FIRST_GEN" => Self::FirstGen,
18003            "SECOND_GEN" => Self::SecondGen,
18004            "EXTERNAL" => Self::External,
18005            _ => Self::UnknownValue(sql_backend_type::UnknownValue(
18006                wkt::internal::UnknownEnumValue::String(value.to_string()),
18007            )),
18008        }
18009    }
18010}
18011
18012impl serde::ser::Serialize for SqlBackendType {
18013    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18014    where
18015        S: serde::Serializer,
18016    {
18017        match self {
18018            Self::Unspecified => serializer.serialize_i32(0),
18019            Self::FirstGen => serializer.serialize_i32(1),
18020            Self::SecondGen => serializer.serialize_i32(2),
18021            Self::External => serializer.serialize_i32(3),
18022            Self::UnknownValue(u) => u.0.serialize(serializer),
18023        }
18024    }
18025}
18026
18027impl<'de> serde::de::Deserialize<'de> for SqlBackendType {
18028    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18029    where
18030        D: serde::Deserializer<'de>,
18031    {
18032        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackendType>::new(
18033            ".google.cloud.sql.v1.SqlBackendType",
18034        ))
18035    }
18036}
18037
18038///
18039/// # Working with unknown values
18040///
18041/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18042/// additional enum variants at any time. Adding new variants is not considered
18043/// a breaking change. Applications should write their code in anticipation of:
18044///
18045/// - New values appearing in future releases of the client library, **and**
18046/// - New values received dynamically, without application changes.
18047///
18048/// Please consult the [Working with enums] section in the user guide for some
18049/// guidelines.
18050///
18051/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18052#[derive(Clone, Debug, PartialEq)]
18053#[non_exhaustive]
18054pub enum SqlIpAddressType {
18055    /// This is an unknown IP address type.
18056    Unspecified,
18057    /// IP address the customer is supposed to connect to. Usually this is the
18058    /// load balancer's IP address
18059    Primary,
18060    /// Source IP address of the connection a read replica establishes to its
18061    /// external primary instance. This IP address can be allowlisted by the
18062    /// customer in case it has a firewall that filters incoming connection to its
18063    /// on premises primary instance.
18064    Outgoing,
18065    /// Private IP used when using private IPs and network peering.
18066    Private,
18067    /// V1 IP of a migrated instance. We want the user to
18068    /// decommission this IP as soon as the migration is complete.
18069    /// Note: V1 instances with V1 ip addresses will be counted as PRIMARY.
18070    Migrated1StGen,
18071    /// If set, the enum was initialized with an unknown value.
18072    ///
18073    /// Applications can examine the value using [SqlIpAddressType::value] or
18074    /// [SqlIpAddressType::name].
18075    UnknownValue(sql_ip_address_type::UnknownValue),
18076}
18077
18078#[doc(hidden)]
18079pub mod sql_ip_address_type {
18080    #[allow(unused_imports)]
18081    use super::*;
18082    #[derive(Clone, Debug, PartialEq)]
18083    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18084}
18085
18086impl SqlIpAddressType {
18087    /// Gets the enum value.
18088    ///
18089    /// Returns `None` if the enum contains an unknown value deserialized from
18090    /// the string representation of enums.
18091    pub fn value(&self) -> std::option::Option<i32> {
18092        match self {
18093            Self::Unspecified => std::option::Option::Some(0),
18094            Self::Primary => std::option::Option::Some(1),
18095            Self::Outgoing => std::option::Option::Some(2),
18096            Self::Private => std::option::Option::Some(3),
18097            Self::Migrated1StGen => std::option::Option::Some(4),
18098            Self::UnknownValue(u) => u.0.value(),
18099        }
18100    }
18101
18102    /// Gets the enum value as a string.
18103    ///
18104    /// Returns `None` if the enum contains an unknown value deserialized from
18105    /// the integer representation of enums.
18106    pub fn name(&self) -> std::option::Option<&str> {
18107        match self {
18108            Self::Unspecified => std::option::Option::Some("SQL_IP_ADDRESS_TYPE_UNSPECIFIED"),
18109            Self::Primary => std::option::Option::Some("PRIMARY"),
18110            Self::Outgoing => std::option::Option::Some("OUTGOING"),
18111            Self::Private => std::option::Option::Some("PRIVATE"),
18112            Self::Migrated1StGen => std::option::Option::Some("MIGRATED_1ST_GEN"),
18113            Self::UnknownValue(u) => u.0.name(),
18114        }
18115    }
18116}
18117
18118impl std::default::Default for SqlIpAddressType {
18119    fn default() -> Self {
18120        use std::convert::From;
18121        Self::from(0)
18122    }
18123}
18124
18125impl std::fmt::Display for SqlIpAddressType {
18126    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18127        wkt::internal::display_enum(f, self.name(), self.value())
18128    }
18129}
18130
18131impl std::convert::From<i32> for SqlIpAddressType {
18132    fn from(value: i32) -> Self {
18133        match value {
18134            0 => Self::Unspecified,
18135            1 => Self::Primary,
18136            2 => Self::Outgoing,
18137            3 => Self::Private,
18138            4 => Self::Migrated1StGen,
18139            _ => Self::UnknownValue(sql_ip_address_type::UnknownValue(
18140                wkt::internal::UnknownEnumValue::Integer(value),
18141            )),
18142        }
18143    }
18144}
18145
18146impl std::convert::From<&str> for SqlIpAddressType {
18147    fn from(value: &str) -> Self {
18148        use std::string::ToString;
18149        match value {
18150            "SQL_IP_ADDRESS_TYPE_UNSPECIFIED" => Self::Unspecified,
18151            "PRIMARY" => Self::Primary,
18152            "OUTGOING" => Self::Outgoing,
18153            "PRIVATE" => Self::Private,
18154            "MIGRATED_1ST_GEN" => Self::Migrated1StGen,
18155            _ => Self::UnknownValue(sql_ip_address_type::UnknownValue(
18156                wkt::internal::UnknownEnumValue::String(value.to_string()),
18157            )),
18158        }
18159    }
18160}
18161
18162impl serde::ser::Serialize for SqlIpAddressType {
18163    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18164    where
18165        S: serde::Serializer,
18166    {
18167        match self {
18168            Self::Unspecified => serializer.serialize_i32(0),
18169            Self::Primary => serializer.serialize_i32(1),
18170            Self::Outgoing => serializer.serialize_i32(2),
18171            Self::Private => serializer.serialize_i32(3),
18172            Self::Migrated1StGen => serializer.serialize_i32(4),
18173            Self::UnknownValue(u) => u.0.serialize(serializer),
18174        }
18175    }
18176}
18177
18178impl<'de> serde::de::Deserialize<'de> for SqlIpAddressType {
18179    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18180    where
18181        D: serde::Deserializer<'de>,
18182    {
18183        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlIpAddressType>::new(
18184            ".google.cloud.sql.v1.SqlIpAddressType",
18185        ))
18186    }
18187}
18188
18189/// The database engine type and version.
18190///
18191/// # Working with unknown values
18192///
18193/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18194/// additional enum variants at any time. Adding new variants is not considered
18195/// a breaking change. Applications should write their code in anticipation of:
18196///
18197/// - New values appearing in future releases of the client library, **and**
18198/// - New values received dynamically, without application changes.
18199///
18200/// Please consult the [Working with enums] section in the user guide for some
18201/// guidelines.
18202///
18203/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18204#[derive(Clone, Debug, PartialEq)]
18205#[non_exhaustive]
18206pub enum SqlDatabaseVersion {
18207    /// This is an unknown database version.
18208    Unspecified,
18209    /// The database version is MySQL 5.1.
18210    #[deprecated]
18211    Mysql51,
18212    /// The database version is MySQL 5.5.
18213    #[deprecated]
18214    Mysql55,
18215    /// The database version is MySQL 5.6.
18216    Mysql56,
18217    /// The database version is MySQL 5.7.
18218    Mysql57,
18219    /// The database version is SQL Server 2017 Standard.
18220    Sqlserver2017Standard,
18221    /// The database version is SQL Server 2017 Enterprise.
18222    Sqlserver2017Enterprise,
18223    /// The database version is SQL Server 2017 Express.
18224    Sqlserver2017Express,
18225    /// The database version is SQL Server 2017 Web.
18226    Sqlserver2017Web,
18227    /// The database version is PostgreSQL 9.6.
18228    Postgres96,
18229    /// The database version is PostgreSQL 10.
18230    Postgres10,
18231    /// The database version is PostgreSQL 11.
18232    Postgres11,
18233    /// The database version is PostgreSQL 12.
18234    Postgres12,
18235    /// The database version is PostgreSQL 13.
18236    Postgres13,
18237    /// The database version is PostgreSQL 14.
18238    Postgres14,
18239    /// The database version is PostgreSQL 15.
18240    Postgres15,
18241    /// The database version is PostgreSQL 16.
18242    Postgres16,
18243    /// The database version is MySQL 8.
18244    Mysql80,
18245    /// The database major version is MySQL 8.0 and the minor version is 18.
18246    Mysql8018,
18247    /// The database major version is MySQL 8.0 and the minor version is 26.
18248    Mysql8026,
18249    /// The database major version is MySQL 8.0 and the minor version is 27.
18250    Mysql8027,
18251    /// The database major version is MySQL 8.0 and the minor version is 28.
18252    Mysql8028,
18253    /// The database major version is MySQL 8.0 and the minor version is 29.
18254    #[deprecated]
18255    Mysql8029,
18256    /// The database major version is MySQL 8.0 and the minor version is 30.
18257    Mysql8030,
18258    /// The database major version is MySQL 8.0 and the minor version is 31.
18259    Mysql8031,
18260    /// The database major version is MySQL 8.0 and the minor version is 32.
18261    Mysql8032,
18262    /// The database major version is MySQL 8.0 and the minor version is 33.
18263    Mysql8033,
18264    /// The database major version is MySQL 8.0 and the minor version is 34.
18265    Mysql8034,
18266    /// The database major version is MySQL 8.0 and the minor version is 35.
18267    Mysql8035,
18268    /// The database major version is MySQL 8.0 and the minor version is 36.
18269    Mysql8036,
18270    /// The database major version is MySQL 8.0 and the minor version is 37.
18271    Mysql8037,
18272    /// The database major version is MySQL 8.0 and the minor version is 38.
18273    Mysql8038,
18274    /// The database major version is MySQL 8.0 and the minor version is 39.
18275    Mysql8039,
18276    /// The database major version is MySQL 8.0 and the minor version is 40.
18277    Mysql8040,
18278    /// The database version is MySQL 8.4.
18279    Mysql84,
18280    /// The database version is MySQL 8.4 and the patch version is 0.
18281    Mysql840,
18282    /// The database version is SQL Server 2019 Standard.
18283    Sqlserver2019Standard,
18284    /// The database version is SQL Server 2019 Enterprise.
18285    Sqlserver2019Enterprise,
18286    /// The database version is SQL Server 2019 Express.
18287    Sqlserver2019Express,
18288    /// The database version is SQL Server 2019 Web.
18289    Sqlserver2019Web,
18290    /// The database version is SQL Server 2022 Standard.
18291    Sqlserver2022Standard,
18292    /// The database version is SQL Server 2022 Enterprise.
18293    Sqlserver2022Enterprise,
18294    /// The database version is SQL Server 2022 Express.
18295    Sqlserver2022Express,
18296    /// The database version is SQL Server 2022 Web.
18297    Sqlserver2022Web,
18298    /// If set, the enum was initialized with an unknown value.
18299    ///
18300    /// Applications can examine the value using [SqlDatabaseVersion::value] or
18301    /// [SqlDatabaseVersion::name].
18302    UnknownValue(sql_database_version::UnknownValue),
18303}
18304
18305#[doc(hidden)]
18306pub mod sql_database_version {
18307    #[allow(unused_imports)]
18308    use super::*;
18309    #[derive(Clone, Debug, PartialEq)]
18310    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18311}
18312
18313impl SqlDatabaseVersion {
18314    /// Gets the enum value.
18315    ///
18316    /// Returns `None` if the enum contains an unknown value deserialized from
18317    /// the string representation of enums.
18318    pub fn value(&self) -> std::option::Option<i32> {
18319        match self {
18320            Self::Unspecified => std::option::Option::Some(0),
18321            Self::Mysql51 => std::option::Option::Some(2),
18322            Self::Mysql55 => std::option::Option::Some(3),
18323            Self::Mysql56 => std::option::Option::Some(5),
18324            Self::Mysql57 => std::option::Option::Some(6),
18325            Self::Sqlserver2017Standard => std::option::Option::Some(11),
18326            Self::Sqlserver2017Enterprise => std::option::Option::Some(14),
18327            Self::Sqlserver2017Express => std::option::Option::Some(15),
18328            Self::Sqlserver2017Web => std::option::Option::Some(16),
18329            Self::Postgres96 => std::option::Option::Some(9),
18330            Self::Postgres10 => std::option::Option::Some(18),
18331            Self::Postgres11 => std::option::Option::Some(10),
18332            Self::Postgres12 => std::option::Option::Some(19),
18333            Self::Postgres13 => std::option::Option::Some(23),
18334            Self::Postgres14 => std::option::Option::Some(110),
18335            Self::Postgres15 => std::option::Option::Some(172),
18336            Self::Postgres16 => std::option::Option::Some(272),
18337            Self::Mysql80 => std::option::Option::Some(20),
18338            Self::Mysql8018 => std::option::Option::Some(41),
18339            Self::Mysql8026 => std::option::Option::Some(85),
18340            Self::Mysql8027 => std::option::Option::Some(111),
18341            Self::Mysql8028 => std::option::Option::Some(132),
18342            Self::Mysql8029 => std::option::Option::Some(148),
18343            Self::Mysql8030 => std::option::Option::Some(174),
18344            Self::Mysql8031 => std::option::Option::Some(197),
18345            Self::Mysql8032 => std::option::Option::Some(213),
18346            Self::Mysql8033 => std::option::Option::Some(238),
18347            Self::Mysql8034 => std::option::Option::Some(239),
18348            Self::Mysql8035 => std::option::Option::Some(240),
18349            Self::Mysql8036 => std::option::Option::Some(241),
18350            Self::Mysql8037 => std::option::Option::Some(355),
18351            Self::Mysql8038 => std::option::Option::Some(356),
18352            Self::Mysql8039 => std::option::Option::Some(357),
18353            Self::Mysql8040 => std::option::Option::Some(358),
18354            Self::Mysql84 => std::option::Option::Some(398),
18355            Self::Mysql840 => std::option::Option::Some(399),
18356            Self::Sqlserver2019Standard => std::option::Option::Some(26),
18357            Self::Sqlserver2019Enterprise => std::option::Option::Some(27),
18358            Self::Sqlserver2019Express => std::option::Option::Some(28),
18359            Self::Sqlserver2019Web => std::option::Option::Some(29),
18360            Self::Sqlserver2022Standard => std::option::Option::Some(199),
18361            Self::Sqlserver2022Enterprise => std::option::Option::Some(200),
18362            Self::Sqlserver2022Express => std::option::Option::Some(201),
18363            Self::Sqlserver2022Web => std::option::Option::Some(202),
18364            Self::UnknownValue(u) => u.0.value(),
18365        }
18366    }
18367
18368    /// Gets the enum value as a string.
18369    ///
18370    /// Returns `None` if the enum contains an unknown value deserialized from
18371    /// the integer representation of enums.
18372    pub fn name(&self) -> std::option::Option<&str> {
18373        match self {
18374            Self::Unspecified => std::option::Option::Some("SQL_DATABASE_VERSION_UNSPECIFIED"),
18375            Self::Mysql51 => std::option::Option::Some("MYSQL_5_1"),
18376            Self::Mysql55 => std::option::Option::Some("MYSQL_5_5"),
18377            Self::Mysql56 => std::option::Option::Some("MYSQL_5_6"),
18378            Self::Mysql57 => std::option::Option::Some("MYSQL_5_7"),
18379            Self::Sqlserver2017Standard => std::option::Option::Some("SQLSERVER_2017_STANDARD"),
18380            Self::Sqlserver2017Enterprise => std::option::Option::Some("SQLSERVER_2017_ENTERPRISE"),
18381            Self::Sqlserver2017Express => std::option::Option::Some("SQLSERVER_2017_EXPRESS"),
18382            Self::Sqlserver2017Web => std::option::Option::Some("SQLSERVER_2017_WEB"),
18383            Self::Postgres96 => std::option::Option::Some("POSTGRES_9_6"),
18384            Self::Postgres10 => std::option::Option::Some("POSTGRES_10"),
18385            Self::Postgres11 => std::option::Option::Some("POSTGRES_11"),
18386            Self::Postgres12 => std::option::Option::Some("POSTGRES_12"),
18387            Self::Postgres13 => std::option::Option::Some("POSTGRES_13"),
18388            Self::Postgres14 => std::option::Option::Some("POSTGRES_14"),
18389            Self::Postgres15 => std::option::Option::Some("POSTGRES_15"),
18390            Self::Postgres16 => std::option::Option::Some("POSTGRES_16"),
18391            Self::Mysql80 => std::option::Option::Some("MYSQL_8_0"),
18392            Self::Mysql8018 => std::option::Option::Some("MYSQL_8_0_18"),
18393            Self::Mysql8026 => std::option::Option::Some("MYSQL_8_0_26"),
18394            Self::Mysql8027 => std::option::Option::Some("MYSQL_8_0_27"),
18395            Self::Mysql8028 => std::option::Option::Some("MYSQL_8_0_28"),
18396            Self::Mysql8029 => std::option::Option::Some("MYSQL_8_0_29"),
18397            Self::Mysql8030 => std::option::Option::Some("MYSQL_8_0_30"),
18398            Self::Mysql8031 => std::option::Option::Some("MYSQL_8_0_31"),
18399            Self::Mysql8032 => std::option::Option::Some("MYSQL_8_0_32"),
18400            Self::Mysql8033 => std::option::Option::Some("MYSQL_8_0_33"),
18401            Self::Mysql8034 => std::option::Option::Some("MYSQL_8_0_34"),
18402            Self::Mysql8035 => std::option::Option::Some("MYSQL_8_0_35"),
18403            Self::Mysql8036 => std::option::Option::Some("MYSQL_8_0_36"),
18404            Self::Mysql8037 => std::option::Option::Some("MYSQL_8_0_37"),
18405            Self::Mysql8038 => std::option::Option::Some("MYSQL_8_0_38"),
18406            Self::Mysql8039 => std::option::Option::Some("MYSQL_8_0_39"),
18407            Self::Mysql8040 => std::option::Option::Some("MYSQL_8_0_40"),
18408            Self::Mysql84 => std::option::Option::Some("MYSQL_8_4"),
18409            Self::Mysql840 => std::option::Option::Some("MYSQL_8_4_0"),
18410            Self::Sqlserver2019Standard => std::option::Option::Some("SQLSERVER_2019_STANDARD"),
18411            Self::Sqlserver2019Enterprise => std::option::Option::Some("SQLSERVER_2019_ENTERPRISE"),
18412            Self::Sqlserver2019Express => std::option::Option::Some("SQLSERVER_2019_EXPRESS"),
18413            Self::Sqlserver2019Web => std::option::Option::Some("SQLSERVER_2019_WEB"),
18414            Self::Sqlserver2022Standard => std::option::Option::Some("SQLSERVER_2022_STANDARD"),
18415            Self::Sqlserver2022Enterprise => std::option::Option::Some("SQLSERVER_2022_ENTERPRISE"),
18416            Self::Sqlserver2022Express => std::option::Option::Some("SQLSERVER_2022_EXPRESS"),
18417            Self::Sqlserver2022Web => std::option::Option::Some("SQLSERVER_2022_WEB"),
18418            Self::UnknownValue(u) => u.0.name(),
18419        }
18420    }
18421}
18422
18423impl std::default::Default for SqlDatabaseVersion {
18424    fn default() -> Self {
18425        use std::convert::From;
18426        Self::from(0)
18427    }
18428}
18429
18430impl std::fmt::Display for SqlDatabaseVersion {
18431    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18432        wkt::internal::display_enum(f, self.name(), self.value())
18433    }
18434}
18435
18436impl std::convert::From<i32> for SqlDatabaseVersion {
18437    fn from(value: i32) -> Self {
18438        match value {
18439            0 => Self::Unspecified,
18440            2 => Self::Mysql51,
18441            3 => Self::Mysql55,
18442            5 => Self::Mysql56,
18443            6 => Self::Mysql57,
18444            9 => Self::Postgres96,
18445            10 => Self::Postgres11,
18446            11 => Self::Sqlserver2017Standard,
18447            14 => Self::Sqlserver2017Enterprise,
18448            15 => Self::Sqlserver2017Express,
18449            16 => Self::Sqlserver2017Web,
18450            18 => Self::Postgres10,
18451            19 => Self::Postgres12,
18452            20 => Self::Mysql80,
18453            23 => Self::Postgres13,
18454            26 => Self::Sqlserver2019Standard,
18455            27 => Self::Sqlserver2019Enterprise,
18456            28 => Self::Sqlserver2019Express,
18457            29 => Self::Sqlserver2019Web,
18458            41 => Self::Mysql8018,
18459            85 => Self::Mysql8026,
18460            110 => Self::Postgres14,
18461            111 => Self::Mysql8027,
18462            132 => Self::Mysql8028,
18463            148 => Self::Mysql8029,
18464            172 => Self::Postgres15,
18465            174 => Self::Mysql8030,
18466            197 => Self::Mysql8031,
18467            199 => Self::Sqlserver2022Standard,
18468            200 => Self::Sqlserver2022Enterprise,
18469            201 => Self::Sqlserver2022Express,
18470            202 => Self::Sqlserver2022Web,
18471            213 => Self::Mysql8032,
18472            238 => Self::Mysql8033,
18473            239 => Self::Mysql8034,
18474            240 => Self::Mysql8035,
18475            241 => Self::Mysql8036,
18476            272 => Self::Postgres16,
18477            355 => Self::Mysql8037,
18478            356 => Self::Mysql8038,
18479            357 => Self::Mysql8039,
18480            358 => Self::Mysql8040,
18481            398 => Self::Mysql84,
18482            399 => Self::Mysql840,
18483            _ => Self::UnknownValue(sql_database_version::UnknownValue(
18484                wkt::internal::UnknownEnumValue::Integer(value),
18485            )),
18486        }
18487    }
18488}
18489
18490impl std::convert::From<&str> for SqlDatabaseVersion {
18491    fn from(value: &str) -> Self {
18492        use std::string::ToString;
18493        match value {
18494            "SQL_DATABASE_VERSION_UNSPECIFIED" => Self::Unspecified,
18495            "MYSQL_5_1" => Self::Mysql51,
18496            "MYSQL_5_5" => Self::Mysql55,
18497            "MYSQL_5_6" => Self::Mysql56,
18498            "MYSQL_5_7" => Self::Mysql57,
18499            "SQLSERVER_2017_STANDARD" => Self::Sqlserver2017Standard,
18500            "SQLSERVER_2017_ENTERPRISE" => Self::Sqlserver2017Enterprise,
18501            "SQLSERVER_2017_EXPRESS" => Self::Sqlserver2017Express,
18502            "SQLSERVER_2017_WEB" => Self::Sqlserver2017Web,
18503            "POSTGRES_9_6" => Self::Postgres96,
18504            "POSTGRES_10" => Self::Postgres10,
18505            "POSTGRES_11" => Self::Postgres11,
18506            "POSTGRES_12" => Self::Postgres12,
18507            "POSTGRES_13" => Self::Postgres13,
18508            "POSTGRES_14" => Self::Postgres14,
18509            "POSTGRES_15" => Self::Postgres15,
18510            "POSTGRES_16" => Self::Postgres16,
18511            "MYSQL_8_0" => Self::Mysql80,
18512            "MYSQL_8_0_18" => Self::Mysql8018,
18513            "MYSQL_8_0_26" => Self::Mysql8026,
18514            "MYSQL_8_0_27" => Self::Mysql8027,
18515            "MYSQL_8_0_28" => Self::Mysql8028,
18516            "MYSQL_8_0_29" => Self::Mysql8029,
18517            "MYSQL_8_0_30" => Self::Mysql8030,
18518            "MYSQL_8_0_31" => Self::Mysql8031,
18519            "MYSQL_8_0_32" => Self::Mysql8032,
18520            "MYSQL_8_0_33" => Self::Mysql8033,
18521            "MYSQL_8_0_34" => Self::Mysql8034,
18522            "MYSQL_8_0_35" => Self::Mysql8035,
18523            "MYSQL_8_0_36" => Self::Mysql8036,
18524            "MYSQL_8_0_37" => Self::Mysql8037,
18525            "MYSQL_8_0_38" => Self::Mysql8038,
18526            "MYSQL_8_0_39" => Self::Mysql8039,
18527            "MYSQL_8_0_40" => Self::Mysql8040,
18528            "MYSQL_8_4" => Self::Mysql84,
18529            "MYSQL_8_4_0" => Self::Mysql840,
18530            "SQLSERVER_2019_STANDARD" => Self::Sqlserver2019Standard,
18531            "SQLSERVER_2019_ENTERPRISE" => Self::Sqlserver2019Enterprise,
18532            "SQLSERVER_2019_EXPRESS" => Self::Sqlserver2019Express,
18533            "SQLSERVER_2019_WEB" => Self::Sqlserver2019Web,
18534            "SQLSERVER_2022_STANDARD" => Self::Sqlserver2022Standard,
18535            "SQLSERVER_2022_ENTERPRISE" => Self::Sqlserver2022Enterprise,
18536            "SQLSERVER_2022_EXPRESS" => Self::Sqlserver2022Express,
18537            "SQLSERVER_2022_WEB" => Self::Sqlserver2022Web,
18538            _ => Self::UnknownValue(sql_database_version::UnknownValue(
18539                wkt::internal::UnknownEnumValue::String(value.to_string()),
18540            )),
18541        }
18542    }
18543}
18544
18545impl serde::ser::Serialize for SqlDatabaseVersion {
18546    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18547    where
18548        S: serde::Serializer,
18549    {
18550        match self {
18551            Self::Unspecified => serializer.serialize_i32(0),
18552            Self::Mysql51 => serializer.serialize_i32(2),
18553            Self::Mysql55 => serializer.serialize_i32(3),
18554            Self::Mysql56 => serializer.serialize_i32(5),
18555            Self::Mysql57 => serializer.serialize_i32(6),
18556            Self::Sqlserver2017Standard => serializer.serialize_i32(11),
18557            Self::Sqlserver2017Enterprise => serializer.serialize_i32(14),
18558            Self::Sqlserver2017Express => serializer.serialize_i32(15),
18559            Self::Sqlserver2017Web => serializer.serialize_i32(16),
18560            Self::Postgres96 => serializer.serialize_i32(9),
18561            Self::Postgres10 => serializer.serialize_i32(18),
18562            Self::Postgres11 => serializer.serialize_i32(10),
18563            Self::Postgres12 => serializer.serialize_i32(19),
18564            Self::Postgres13 => serializer.serialize_i32(23),
18565            Self::Postgres14 => serializer.serialize_i32(110),
18566            Self::Postgres15 => serializer.serialize_i32(172),
18567            Self::Postgres16 => serializer.serialize_i32(272),
18568            Self::Mysql80 => serializer.serialize_i32(20),
18569            Self::Mysql8018 => serializer.serialize_i32(41),
18570            Self::Mysql8026 => serializer.serialize_i32(85),
18571            Self::Mysql8027 => serializer.serialize_i32(111),
18572            Self::Mysql8028 => serializer.serialize_i32(132),
18573            Self::Mysql8029 => serializer.serialize_i32(148),
18574            Self::Mysql8030 => serializer.serialize_i32(174),
18575            Self::Mysql8031 => serializer.serialize_i32(197),
18576            Self::Mysql8032 => serializer.serialize_i32(213),
18577            Self::Mysql8033 => serializer.serialize_i32(238),
18578            Self::Mysql8034 => serializer.serialize_i32(239),
18579            Self::Mysql8035 => serializer.serialize_i32(240),
18580            Self::Mysql8036 => serializer.serialize_i32(241),
18581            Self::Mysql8037 => serializer.serialize_i32(355),
18582            Self::Mysql8038 => serializer.serialize_i32(356),
18583            Self::Mysql8039 => serializer.serialize_i32(357),
18584            Self::Mysql8040 => serializer.serialize_i32(358),
18585            Self::Mysql84 => serializer.serialize_i32(398),
18586            Self::Mysql840 => serializer.serialize_i32(399),
18587            Self::Sqlserver2019Standard => serializer.serialize_i32(26),
18588            Self::Sqlserver2019Enterprise => serializer.serialize_i32(27),
18589            Self::Sqlserver2019Express => serializer.serialize_i32(28),
18590            Self::Sqlserver2019Web => serializer.serialize_i32(29),
18591            Self::Sqlserver2022Standard => serializer.serialize_i32(199),
18592            Self::Sqlserver2022Enterprise => serializer.serialize_i32(200),
18593            Self::Sqlserver2022Express => serializer.serialize_i32(201),
18594            Self::Sqlserver2022Web => serializer.serialize_i32(202),
18595            Self::UnknownValue(u) => u.0.serialize(serializer),
18596        }
18597    }
18598}
18599
18600impl<'de> serde::de::Deserialize<'de> for SqlDatabaseVersion {
18601    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18602    where
18603        D: serde::Deserializer<'de>,
18604    {
18605        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDatabaseVersion>::new(
18606            ".google.cloud.sql.v1.SqlDatabaseVersion",
18607        ))
18608    }
18609}
18610
18611/// The pricing plan for this instance.
18612///
18613/// # Working with unknown values
18614///
18615/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18616/// additional enum variants at any time. Adding new variants is not considered
18617/// a breaking change. Applications should write their code in anticipation of:
18618///
18619/// - New values appearing in future releases of the client library, **and**
18620/// - New values received dynamically, without application changes.
18621///
18622/// Please consult the [Working with enums] section in the user guide for some
18623/// guidelines.
18624///
18625/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18626#[derive(Clone, Debug, PartialEq)]
18627#[non_exhaustive]
18628pub enum SqlPricingPlan {
18629    /// This is an unknown pricing plan for this instance.
18630    Unspecified,
18631    /// The instance is billed at a monthly flat rate.
18632    Package,
18633    /// The instance is billed per usage.
18634    PerUse,
18635    /// If set, the enum was initialized with an unknown value.
18636    ///
18637    /// Applications can examine the value using [SqlPricingPlan::value] or
18638    /// [SqlPricingPlan::name].
18639    UnknownValue(sql_pricing_plan::UnknownValue),
18640}
18641
18642#[doc(hidden)]
18643pub mod sql_pricing_plan {
18644    #[allow(unused_imports)]
18645    use super::*;
18646    #[derive(Clone, Debug, PartialEq)]
18647    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18648}
18649
18650impl SqlPricingPlan {
18651    /// Gets the enum value.
18652    ///
18653    /// Returns `None` if the enum contains an unknown value deserialized from
18654    /// the string representation of enums.
18655    pub fn value(&self) -> std::option::Option<i32> {
18656        match self {
18657            Self::Unspecified => std::option::Option::Some(0),
18658            Self::Package => std::option::Option::Some(1),
18659            Self::PerUse => std::option::Option::Some(2),
18660            Self::UnknownValue(u) => u.0.value(),
18661        }
18662    }
18663
18664    /// Gets the enum value as a string.
18665    ///
18666    /// Returns `None` if the enum contains an unknown value deserialized from
18667    /// the integer representation of enums.
18668    pub fn name(&self) -> std::option::Option<&str> {
18669        match self {
18670            Self::Unspecified => std::option::Option::Some("SQL_PRICING_PLAN_UNSPECIFIED"),
18671            Self::Package => std::option::Option::Some("PACKAGE"),
18672            Self::PerUse => std::option::Option::Some("PER_USE"),
18673            Self::UnknownValue(u) => u.0.name(),
18674        }
18675    }
18676}
18677
18678impl std::default::Default for SqlPricingPlan {
18679    fn default() -> Self {
18680        use std::convert::From;
18681        Self::from(0)
18682    }
18683}
18684
18685impl std::fmt::Display for SqlPricingPlan {
18686    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18687        wkt::internal::display_enum(f, self.name(), self.value())
18688    }
18689}
18690
18691impl std::convert::From<i32> for SqlPricingPlan {
18692    fn from(value: i32) -> Self {
18693        match value {
18694            0 => Self::Unspecified,
18695            1 => Self::Package,
18696            2 => Self::PerUse,
18697            _ => Self::UnknownValue(sql_pricing_plan::UnknownValue(
18698                wkt::internal::UnknownEnumValue::Integer(value),
18699            )),
18700        }
18701    }
18702}
18703
18704impl std::convert::From<&str> for SqlPricingPlan {
18705    fn from(value: &str) -> Self {
18706        use std::string::ToString;
18707        match value {
18708            "SQL_PRICING_PLAN_UNSPECIFIED" => Self::Unspecified,
18709            "PACKAGE" => Self::Package,
18710            "PER_USE" => Self::PerUse,
18711            _ => Self::UnknownValue(sql_pricing_plan::UnknownValue(
18712                wkt::internal::UnknownEnumValue::String(value.to_string()),
18713            )),
18714        }
18715    }
18716}
18717
18718impl serde::ser::Serialize for SqlPricingPlan {
18719    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18720    where
18721        S: serde::Serializer,
18722    {
18723        match self {
18724            Self::Unspecified => serializer.serialize_i32(0),
18725            Self::Package => serializer.serialize_i32(1),
18726            Self::PerUse => serializer.serialize_i32(2),
18727            Self::UnknownValue(u) => u.0.serialize(serializer),
18728        }
18729    }
18730}
18731
18732impl<'de> serde::de::Deserialize<'de> for SqlPricingPlan {
18733    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18734    where
18735        D: serde::Deserializer<'de>,
18736    {
18737        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlPricingPlan>::new(
18738            ".google.cloud.sql.v1.SqlPricingPlan",
18739        ))
18740    }
18741}
18742
18743///
18744/// # Working with unknown values
18745///
18746/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18747/// additional enum variants at any time. Adding new variants is not considered
18748/// a breaking change. Applications should write their code in anticipation of:
18749///
18750/// - New values appearing in future releases of the client library, **and**
18751/// - New values received dynamically, without application changes.
18752///
18753/// Please consult the [Working with enums] section in the user guide for some
18754/// guidelines.
18755///
18756/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18757#[derive(Clone, Debug, PartialEq)]
18758#[non_exhaustive]
18759pub enum SqlReplicationType {
18760    /// This is an unknown replication type for a Cloud SQL instance.
18761    Unspecified,
18762    /// The synchronous replication mode for First Generation instances. It is the
18763    /// default value.
18764    Synchronous,
18765    /// The asynchronous replication mode for First Generation instances. It
18766    /// provides a slight performance gain, but if an outage occurs while this
18767    /// option is set to asynchronous, you can lose up to a few seconds of updates
18768    /// to your data.
18769    Asynchronous,
18770    /// If set, the enum was initialized with an unknown value.
18771    ///
18772    /// Applications can examine the value using [SqlReplicationType::value] or
18773    /// [SqlReplicationType::name].
18774    UnknownValue(sql_replication_type::UnknownValue),
18775}
18776
18777#[doc(hidden)]
18778pub mod sql_replication_type {
18779    #[allow(unused_imports)]
18780    use super::*;
18781    #[derive(Clone, Debug, PartialEq)]
18782    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18783}
18784
18785impl SqlReplicationType {
18786    /// Gets the enum value.
18787    ///
18788    /// Returns `None` if the enum contains an unknown value deserialized from
18789    /// the string representation of enums.
18790    pub fn value(&self) -> std::option::Option<i32> {
18791        match self {
18792            Self::Unspecified => std::option::Option::Some(0),
18793            Self::Synchronous => std::option::Option::Some(1),
18794            Self::Asynchronous => std::option::Option::Some(2),
18795            Self::UnknownValue(u) => u.0.value(),
18796        }
18797    }
18798
18799    /// Gets the enum value as a string.
18800    ///
18801    /// Returns `None` if the enum contains an unknown value deserialized from
18802    /// the integer representation of enums.
18803    pub fn name(&self) -> std::option::Option<&str> {
18804        match self {
18805            Self::Unspecified => std::option::Option::Some("SQL_REPLICATION_TYPE_UNSPECIFIED"),
18806            Self::Synchronous => std::option::Option::Some("SYNCHRONOUS"),
18807            Self::Asynchronous => std::option::Option::Some("ASYNCHRONOUS"),
18808            Self::UnknownValue(u) => u.0.name(),
18809        }
18810    }
18811}
18812
18813impl std::default::Default for SqlReplicationType {
18814    fn default() -> Self {
18815        use std::convert::From;
18816        Self::from(0)
18817    }
18818}
18819
18820impl std::fmt::Display for SqlReplicationType {
18821    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18822        wkt::internal::display_enum(f, self.name(), self.value())
18823    }
18824}
18825
18826impl std::convert::From<i32> for SqlReplicationType {
18827    fn from(value: i32) -> Self {
18828        match value {
18829            0 => Self::Unspecified,
18830            1 => Self::Synchronous,
18831            2 => Self::Asynchronous,
18832            _ => Self::UnknownValue(sql_replication_type::UnknownValue(
18833                wkt::internal::UnknownEnumValue::Integer(value),
18834            )),
18835        }
18836    }
18837}
18838
18839impl std::convert::From<&str> for SqlReplicationType {
18840    fn from(value: &str) -> Self {
18841        use std::string::ToString;
18842        match value {
18843            "SQL_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
18844            "SYNCHRONOUS" => Self::Synchronous,
18845            "ASYNCHRONOUS" => Self::Asynchronous,
18846            _ => Self::UnknownValue(sql_replication_type::UnknownValue(
18847                wkt::internal::UnknownEnumValue::String(value.to_string()),
18848            )),
18849        }
18850    }
18851}
18852
18853impl serde::ser::Serialize for SqlReplicationType {
18854    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18855    where
18856        S: serde::Serializer,
18857    {
18858        match self {
18859            Self::Unspecified => serializer.serialize_i32(0),
18860            Self::Synchronous => serializer.serialize_i32(1),
18861            Self::Asynchronous => serializer.serialize_i32(2),
18862            Self::UnknownValue(u) => u.0.serialize(serializer),
18863        }
18864    }
18865}
18866
18867impl<'de> serde::de::Deserialize<'de> for SqlReplicationType {
18868    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18869    where
18870        D: serde::Deserializer<'de>,
18871    {
18872        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlReplicationType>::new(
18873            ".google.cloud.sql.v1.SqlReplicationType",
18874        ))
18875    }
18876}
18877
18878/// The type of disk that is used for a v2 instance to use.
18879///
18880/// # Working with unknown values
18881///
18882/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18883/// additional enum variants at any time. Adding new variants is not considered
18884/// a breaking change. Applications should write their code in anticipation of:
18885///
18886/// - New values appearing in future releases of the client library, **and**
18887/// - New values received dynamically, without application changes.
18888///
18889/// Please consult the [Working with enums] section in the user guide for some
18890/// guidelines.
18891///
18892/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18893#[derive(Clone, Debug, PartialEq)]
18894#[non_exhaustive]
18895pub enum SqlDataDiskType {
18896    /// This is an unknown data disk type.
18897    Unspecified,
18898    /// An SSD data disk.
18899    PdSsd,
18900    /// An HDD data disk.
18901    PdHdd,
18902    /// This field is deprecated and will be removed from a future version of the
18903    /// API.
18904    #[deprecated]
18905    ObsoleteLocalSsd,
18906    /// If set, the enum was initialized with an unknown value.
18907    ///
18908    /// Applications can examine the value using [SqlDataDiskType::value] or
18909    /// [SqlDataDiskType::name].
18910    UnknownValue(sql_data_disk_type::UnknownValue),
18911}
18912
18913#[doc(hidden)]
18914pub mod sql_data_disk_type {
18915    #[allow(unused_imports)]
18916    use super::*;
18917    #[derive(Clone, Debug, PartialEq)]
18918    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18919}
18920
18921impl SqlDataDiskType {
18922    /// Gets the enum value.
18923    ///
18924    /// Returns `None` if the enum contains an unknown value deserialized from
18925    /// the string representation of enums.
18926    pub fn value(&self) -> std::option::Option<i32> {
18927        match self {
18928            Self::Unspecified => std::option::Option::Some(0),
18929            Self::PdSsd => std::option::Option::Some(1),
18930            Self::PdHdd => std::option::Option::Some(2),
18931            Self::ObsoleteLocalSsd => std::option::Option::Some(3),
18932            Self::UnknownValue(u) => u.0.value(),
18933        }
18934    }
18935
18936    /// Gets the enum value as a string.
18937    ///
18938    /// Returns `None` if the enum contains an unknown value deserialized from
18939    /// the integer representation of enums.
18940    pub fn name(&self) -> std::option::Option<&str> {
18941        match self {
18942            Self::Unspecified => std::option::Option::Some("SQL_DATA_DISK_TYPE_UNSPECIFIED"),
18943            Self::PdSsd => std::option::Option::Some("PD_SSD"),
18944            Self::PdHdd => std::option::Option::Some("PD_HDD"),
18945            Self::ObsoleteLocalSsd => std::option::Option::Some("OBSOLETE_LOCAL_SSD"),
18946            Self::UnknownValue(u) => u.0.name(),
18947        }
18948    }
18949}
18950
18951impl std::default::Default for SqlDataDiskType {
18952    fn default() -> Self {
18953        use std::convert::From;
18954        Self::from(0)
18955    }
18956}
18957
18958impl std::fmt::Display for SqlDataDiskType {
18959    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18960        wkt::internal::display_enum(f, self.name(), self.value())
18961    }
18962}
18963
18964impl std::convert::From<i32> for SqlDataDiskType {
18965    fn from(value: i32) -> Self {
18966        match value {
18967            0 => Self::Unspecified,
18968            1 => Self::PdSsd,
18969            2 => Self::PdHdd,
18970            3 => Self::ObsoleteLocalSsd,
18971            _ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
18972                wkt::internal::UnknownEnumValue::Integer(value),
18973            )),
18974        }
18975    }
18976}
18977
18978impl std::convert::From<&str> for SqlDataDiskType {
18979    fn from(value: &str) -> Self {
18980        use std::string::ToString;
18981        match value {
18982            "SQL_DATA_DISK_TYPE_UNSPECIFIED" => Self::Unspecified,
18983            "PD_SSD" => Self::PdSsd,
18984            "PD_HDD" => Self::PdHdd,
18985            "OBSOLETE_LOCAL_SSD" => Self::ObsoleteLocalSsd,
18986            _ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
18987                wkt::internal::UnknownEnumValue::String(value.to_string()),
18988            )),
18989        }
18990    }
18991}
18992
18993impl serde::ser::Serialize for SqlDataDiskType {
18994    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18995    where
18996        S: serde::Serializer,
18997    {
18998        match self {
18999            Self::Unspecified => serializer.serialize_i32(0),
19000            Self::PdSsd => serializer.serialize_i32(1),
19001            Self::PdHdd => serializer.serialize_i32(2),
19002            Self::ObsoleteLocalSsd => serializer.serialize_i32(3),
19003            Self::UnknownValue(u) => u.0.serialize(serializer),
19004        }
19005    }
19006}
19007
19008impl<'de> serde::de::Deserialize<'de> for SqlDataDiskType {
19009    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19010    where
19011        D: serde::Deserializer<'de>,
19012    {
19013        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDataDiskType>::new(
19014            ".google.cloud.sql.v1.SqlDataDiskType",
19015        ))
19016    }
19017}
19018
19019/// The availability type of the given Cloud SQL instance.
19020///
19021/// # Working with unknown values
19022///
19023/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19024/// additional enum variants at any time. Adding new variants is not considered
19025/// a breaking change. Applications should write their code in anticipation of:
19026///
19027/// - New values appearing in future releases of the client library, **and**
19028/// - New values received dynamically, without application changes.
19029///
19030/// Please consult the [Working with enums] section in the user guide for some
19031/// guidelines.
19032///
19033/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
19034#[derive(Clone, Debug, PartialEq)]
19035#[non_exhaustive]
19036pub enum SqlAvailabilityType {
19037    /// This is an unknown Availability type.
19038    Unspecified,
19039    /// Zonal available instance.
19040    Zonal,
19041    /// Regional available instance.
19042    Regional,
19043    /// If set, the enum was initialized with an unknown value.
19044    ///
19045    /// Applications can examine the value using [SqlAvailabilityType::value] or
19046    /// [SqlAvailabilityType::name].
19047    UnknownValue(sql_availability_type::UnknownValue),
19048}
19049
19050#[doc(hidden)]
19051pub mod sql_availability_type {
19052    #[allow(unused_imports)]
19053    use super::*;
19054    #[derive(Clone, Debug, PartialEq)]
19055    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19056}
19057
19058impl SqlAvailabilityType {
19059    /// Gets the enum value.
19060    ///
19061    /// Returns `None` if the enum contains an unknown value deserialized from
19062    /// the string representation of enums.
19063    pub fn value(&self) -> std::option::Option<i32> {
19064        match self {
19065            Self::Unspecified => std::option::Option::Some(0),
19066            Self::Zonal => std::option::Option::Some(1),
19067            Self::Regional => std::option::Option::Some(2),
19068            Self::UnknownValue(u) => u.0.value(),
19069        }
19070    }
19071
19072    /// Gets the enum value as a string.
19073    ///
19074    /// Returns `None` if the enum contains an unknown value deserialized from
19075    /// the integer representation of enums.
19076    pub fn name(&self) -> std::option::Option<&str> {
19077        match self {
19078            Self::Unspecified => std::option::Option::Some("SQL_AVAILABILITY_TYPE_UNSPECIFIED"),
19079            Self::Zonal => std::option::Option::Some("ZONAL"),
19080            Self::Regional => std::option::Option::Some("REGIONAL"),
19081            Self::UnknownValue(u) => u.0.name(),
19082        }
19083    }
19084}
19085
19086impl std::default::Default for SqlAvailabilityType {
19087    fn default() -> Self {
19088        use std::convert::From;
19089        Self::from(0)
19090    }
19091}
19092
19093impl std::fmt::Display for SqlAvailabilityType {
19094    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19095        wkt::internal::display_enum(f, self.name(), self.value())
19096    }
19097}
19098
19099impl std::convert::From<i32> for SqlAvailabilityType {
19100    fn from(value: i32) -> Self {
19101        match value {
19102            0 => Self::Unspecified,
19103            1 => Self::Zonal,
19104            2 => Self::Regional,
19105            _ => Self::UnknownValue(sql_availability_type::UnknownValue(
19106                wkt::internal::UnknownEnumValue::Integer(value),
19107            )),
19108        }
19109    }
19110}
19111
19112impl std::convert::From<&str> for SqlAvailabilityType {
19113    fn from(value: &str) -> Self {
19114        use std::string::ToString;
19115        match value {
19116            "SQL_AVAILABILITY_TYPE_UNSPECIFIED" => Self::Unspecified,
19117            "ZONAL" => Self::Zonal,
19118            "REGIONAL" => Self::Regional,
19119            _ => Self::UnknownValue(sql_availability_type::UnknownValue(
19120                wkt::internal::UnknownEnumValue::String(value.to_string()),
19121            )),
19122        }
19123    }
19124}
19125
19126impl serde::ser::Serialize for SqlAvailabilityType {
19127    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19128    where
19129        S: serde::Serializer,
19130    {
19131        match self {
19132            Self::Unspecified => serializer.serialize_i32(0),
19133            Self::Zonal => serializer.serialize_i32(1),
19134            Self::Regional => serializer.serialize_i32(2),
19135            Self::UnknownValue(u) => u.0.serialize(serializer),
19136        }
19137    }
19138}
19139
19140impl<'de> serde::de::Deserialize<'de> for SqlAvailabilityType {
19141    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19142    where
19143        D: serde::Deserializer<'de>,
19144    {
19145        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlAvailabilityType>::new(
19146            ".google.cloud.sql.v1.SqlAvailabilityType",
19147        ))
19148    }
19149}
19150
19151///
19152/// # Working with unknown values
19153///
19154/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19155/// additional enum variants at any time. Adding new variants is not considered
19156/// a breaking change. Applications should write their code in anticipation of:
19157///
19158/// - New values appearing in future releases of the client library, **and**
19159/// - New values received dynamically, without application changes.
19160///
19161/// Please consult the [Working with enums] section in the user guide for some
19162/// guidelines.
19163///
19164/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
19165#[derive(Clone, Debug, PartialEq)]
19166#[non_exhaustive]
19167pub enum SqlUpdateTrack {
19168    /// This is an unknown maintenance timing preference.
19169    Unspecified,
19170    /// For an instance with a scheduled maintenance window, this maintenance
19171    /// timing indicates that the maintenance update is scheduled 7 to 14 days
19172    /// after the notification is sent out. Also referred to as `Week 1` (Console)
19173    /// and `preview` (gcloud CLI).
19174    Canary,
19175    /// For an instance with a scheduled maintenance window, this maintenance
19176    /// timing indicates that the maintenance update is scheduled 15 to 21 days
19177    /// after the notification is sent out. Also referred to as `Week 2` (Console)
19178    /// and `production` (gcloud CLI).
19179    Stable,
19180    /// For instance with a scheduled maintenance window, this maintenance
19181    /// timing indicates that the maintenance update is scheduled 35 to 42 days
19182    /// after the notification is sent out.
19183    Week5,
19184    /// If set, the enum was initialized with an unknown value.
19185    ///
19186    /// Applications can examine the value using [SqlUpdateTrack::value] or
19187    /// [SqlUpdateTrack::name].
19188    UnknownValue(sql_update_track::UnknownValue),
19189}
19190
19191#[doc(hidden)]
19192pub mod sql_update_track {
19193    #[allow(unused_imports)]
19194    use super::*;
19195    #[derive(Clone, Debug, PartialEq)]
19196    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19197}
19198
19199impl SqlUpdateTrack {
19200    /// Gets the enum value.
19201    ///
19202    /// Returns `None` if the enum contains an unknown value deserialized from
19203    /// the string representation of enums.
19204    pub fn value(&self) -> std::option::Option<i32> {
19205        match self {
19206            Self::Unspecified => std::option::Option::Some(0),
19207            Self::Canary => std::option::Option::Some(1),
19208            Self::Stable => std::option::Option::Some(2),
19209            Self::Week5 => std::option::Option::Some(3),
19210            Self::UnknownValue(u) => u.0.value(),
19211        }
19212    }
19213
19214    /// Gets the enum value as a string.
19215    ///
19216    /// Returns `None` if the enum contains an unknown value deserialized from
19217    /// the integer representation of enums.
19218    pub fn name(&self) -> std::option::Option<&str> {
19219        match self {
19220            Self::Unspecified => std::option::Option::Some("SQL_UPDATE_TRACK_UNSPECIFIED"),
19221            Self::Canary => std::option::Option::Some("canary"),
19222            Self::Stable => std::option::Option::Some("stable"),
19223            Self::Week5 => std::option::Option::Some("week5"),
19224            Self::UnknownValue(u) => u.0.name(),
19225        }
19226    }
19227}
19228
19229impl std::default::Default for SqlUpdateTrack {
19230    fn default() -> Self {
19231        use std::convert::From;
19232        Self::from(0)
19233    }
19234}
19235
19236impl std::fmt::Display for SqlUpdateTrack {
19237    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19238        wkt::internal::display_enum(f, self.name(), self.value())
19239    }
19240}
19241
19242impl std::convert::From<i32> for SqlUpdateTrack {
19243    fn from(value: i32) -> Self {
19244        match value {
19245            0 => Self::Unspecified,
19246            1 => Self::Canary,
19247            2 => Self::Stable,
19248            3 => Self::Week5,
19249            _ => Self::UnknownValue(sql_update_track::UnknownValue(
19250                wkt::internal::UnknownEnumValue::Integer(value),
19251            )),
19252        }
19253    }
19254}
19255
19256impl std::convert::From<&str> for SqlUpdateTrack {
19257    fn from(value: &str) -> Self {
19258        use std::string::ToString;
19259        match value {
19260            "SQL_UPDATE_TRACK_UNSPECIFIED" => Self::Unspecified,
19261            "canary" => Self::Canary,
19262            "stable" => Self::Stable,
19263            "week5" => Self::Week5,
19264            _ => Self::UnknownValue(sql_update_track::UnknownValue(
19265                wkt::internal::UnknownEnumValue::String(value.to_string()),
19266            )),
19267        }
19268    }
19269}
19270
19271impl serde::ser::Serialize for SqlUpdateTrack {
19272    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19273    where
19274        S: serde::Serializer,
19275    {
19276        match self {
19277            Self::Unspecified => serializer.serialize_i32(0),
19278            Self::Canary => serializer.serialize_i32(1),
19279            Self::Stable => serializer.serialize_i32(2),
19280            Self::Week5 => serializer.serialize_i32(3),
19281            Self::UnknownValue(u) => u.0.serialize(serializer),
19282        }
19283    }
19284}
19285
19286impl<'de> serde::de::Deserialize<'de> for SqlUpdateTrack {
19287    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19288    where
19289        D: serde::Deserializer<'de>,
19290    {
19291        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlUpdateTrack>::new(
19292            ".google.cloud.sql.v1.SqlUpdateTrack",
19293        ))
19294    }
19295}